Skip to content

Commit

Permalink
Bump Java version used by asciidoc-converter; bump Kotlin version; fi…
Browse files Browse the repository at this point in the history
…x Github request error.
  • Loading branch information
d-gregorczyk committed Sep 16, 2024
1 parent ce19b12 commit fe47a9d
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 24 deletions.
27 changes: 19 additions & 8 deletions .ci/asciidoc-converter/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
java
kotlin("jvm") version "1.8.10"
kotlin("plugin.serialization") version "1.8.10"
application
idea
kotlin("jvm") version "2.0.10"
kotlin("plugin.serialization") version "2.0.10"
}

group = "org.sdpi"
Expand All @@ -15,9 +16,8 @@ repositories {
}

dependencies {

// regex pattern
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.7.10")
implementation(kotlin("stdlib"))

// command line parsing
// https://mvnrepository.com/artifact/com.github.ajalt/clikt
Expand All @@ -44,23 +44,34 @@ dependencies {
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine
runtimeOnly(group = "org.junit.jupiter", name = "junit-jupiter-engine", version = "5.7.1")

implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.1")

// https://mvnrepository.com/artifact/org.kohsuke/github-api
implementation("org.kohsuke:github-api:1.315")


testImplementation(kotlin("test"))
}

tasks.test {
useJUnitPlatform()
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
val javaSource: Int = 17
val jdkVersion: Int = javaSource

java {
toolchain {
languageVersion = JavaLanguageVersion.of(javaSource)
}
withJavadocJar()
withSourcesJar()
}

kotlin {
jvmToolchain(jdkVersion)
}


application {
mainClass.set("org.sdpi.ConvertAndVerifySupplementKt")
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ class IssuesSectionPreprocessor(
.filter { it.variableName == VAR_MILESTONE_PUBLICATION || it.variableName == VAR_MILESTONE_REVIEW }
.associateBy(VariableDeclaration::variableName)

val issues = IssueImport(
githubToken,
variables[VAR_MILESTONE_PUBLICATION]!!.variableValue,
variables[VAR_MILESTONE_REVIEW]!!.variableValue
).requestIssues().issues()

val issues = try {
IssueImport(
githubToken,
variables[VAR_MILESTONE_PUBLICATION]!!.variableValue,
variables[VAR_MILESTONE_REVIEW]!!.variableValue
).requestIssues().issues()
} catch (e: Exception) {
logger.error(e) { e.message }
throw e
}
reader.restoreLines(lines.fold(mutableListOf<String>()) { acc, line ->

when (line.trim().lowercase()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,14 @@ class IssueImport(
return this
}


private fun issuesInMilestones(
repository: GHRepository,
state: GHIssueState,
vararg milestones: String
): List<GHIssue> {
return milestones
.map { ms ->
repository.listMilestones(GHIssueState.ALL).first { it.title == ms }.let {
.mapNotNull { ms ->
repository.listMilestones(GHIssueState.ALL).firstOrNull { it.title == ms }?.let {
repository.getIssues(state, it)
}
}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/feature-review-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
- name: Checkout branch
uses: actions/checkout@v4

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/latest-master-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
- name: Checkout branch
uses: actions/checkout@v4

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
- name: Checkout branch
uses: actions/checkout@v4

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
Expand Down

0 comments on commit fe47a9d

Please sign in to comment.