Skip to content

Commit 5e45db9

Browse files
openapi-generator-gradle-plugin: upgrade Gradle to v8 (#22864)
1 parent 17a28eb commit 5e45db9

File tree

20 files changed

+110
-89
lines changed

20 files changed

+110
-89
lines changed

.github/workflows/gradle-plugin-tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v5
17-
- name: Set up JDK 11
17+
- name: Set up JDK 21
1818
uses: actions/setup-java@v5
1919
with:
20-
java-version: 11
20+
java-version: 21
2121
distribution: 'temurin'
2222
cache: gradle
2323
- name: Cache maven dependencies

modules/openapi-generator-gradle-plugin/README.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ This task exposes all options available via OpenAPI Generator CLI and the OpenAP
541541
openApiGenerate {
542542
generatorName.set("kotlin")
543543
inputSpec.set("$rootDir/specs/petstore-v3.0.yaml")
544-
outputDir.set("$buildDir/generated")
544+
outputDir.set(layout.buildDirectory.dir("generated").get().asFile.path)
545545
apiPackage.set("org.openapi.example.api")
546546
invokerPackage.set("org.openapi.example.invoker")
547547
modelPackage.set("org.openapi.example.model")
@@ -694,15 +694,15 @@ task buildGoClient(type: org.openapitools.generator.gradle.plugin.tasks.Generate
694694
additionalProperties.set([
695695
packageName: "petstore"
696696
])
697-
outputDir.set("$buildDir/go")
697+
outputDir.set(layout.buildDirectory.dir("go").get().asFile.path)
698698
configOptions.set([
699699
dateLibrary: "threetenp"
700700
])
701701
}
702702
task buildKotlinClient(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask) {
703703
generatorName.set("kotlin")
704704
inputSpec.set("$rootDir/petstore-v3.0.yaml")
705-
outputDir.set("$buildDir/kotlin")
705+
outputDir.set(layout.buildDirectory.dir("kotlin").get().asFile.path)
706706
apiPackage.set("org.openapitools.example.api")
707707
invokerPackage.set("org.openapitools.example.invoker")
708708
modelPackage.set("org.openapitools.example.model")

modules/openapi-generator-gradle-plugin/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import io.github.gradlenexus.publishplugin.ReleaseNexusStagingRepository
33
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
44

55
plugins {
6-
id("com.gradle.plugin-publish") version "1.1.0"
7-
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
6+
id("com.gradle.plugin-publish") version "2.0.0"
7+
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
88
id("java-gradle-plugin")
99
id("maven-publish")
10-
id("org.gradle.kotlin.kotlin-dsl") version "2.4.1"
11-
id("org.jetbrains.kotlin.jvm") version "1.9.0"
10+
id("org.gradle.kotlin.kotlin-dsl") version "5.2.0"
11+
id("org.jetbrains.kotlin.jvm") version "2.0.21"
1212
id("signing")
1313
}
1414

@@ -35,7 +35,7 @@ repositories {
3535
mavenCentral()
3636
maven {
3737
name = "Sonatype Snapshots"
38-
url "https://oss.sonatype.org/content/repositories/snapshots/"
38+
url = "https://oss.sonatype.org/content/repositories/snapshots/"
3939
}
4040
}
4141

@@ -117,7 +117,7 @@ nexusPublishing {
117117
// or stored as key=value pairs in ~/.gradle/gradle.properties
118118
// You can also apply them in CI via environment variables. See Gradle's docs for details.
119119
signing {
120-
required { isReleaseVersion && gradle.taskGraph.hasTask("publishPluginMavenPublicationToSonatypeRepository") }
120+
required = { isReleaseVersion && gradle.taskGraph.hasTask("publishPluginMavenPublicationToSonatypeRepository") }
121121
sign(publishing.publications)
122122
}
123123

Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

modules/openapi-generator-gradle-plugin/gradlew

Lines changed: 22 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/openapi-generator-gradle-plugin/gradlew.bat

Lines changed: 14 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/openapi-generator-gradle-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<properties>
1919
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
20-
<gradleVersion>7.6.4</gradleVersion>
20+
<gradleVersion>8.14.4</gradleVersion>
2121
<gradle-tooling.version>7.4.2</gradle-tooling.version>
2222
</properties>
2323

modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
buildscript {
22
repositories {
33
mavenLocal()
4-
maven { url "https://repo1.maven.org/maven2" }
4+
maven { url = "https://repo1.maven.org/maven2" }
55
maven {
6-
url "https://plugins.gradle.org/m2/"
6+
url = "https://plugins.gradle.org/m2/"
77
}
88
maven {
9-
url "https://oss.sonatype.org/content/repositories/releases/"
9+
url = "https://oss.sonatype.org/content/repositories/releases/"
1010
}
1111
maven {
12-
url "https://oss.sonatype.org/content/repositories/snapshots/"
12+
url = "https://oss.sonatype.org/content/repositories/snapshots/"
1313
}
1414
}
1515
dependencies {
@@ -23,7 +23,7 @@ apply plugin: 'org.openapi.generator'
2323
openApiMeta {
2424
generatorName = "Sample"
2525
packageName = "org.openapitools.example"
26-
outputFolder = "$buildDir/meta".toString()
26+
outputFolder = layout.buildDirectory.dir("meta").get().asFile.toString()
2727
}
2828

2929
openApiValidate {
@@ -35,7 +35,7 @@ openApiValidate {
3535
openApiGenerate {
3636
generatorName = "kotlin"
3737
inputSpec = "$rootDir/petstore-v3.0.yaml".toString()
38-
outputDir = "$buildDir/kotlin".toString()
38+
outputDir = layout.buildDirectory.dir("kotlin").get().asFile.toString()
3939
apiPackage = "org.openapitools.example.api"
4040
invokerPackage = "org.openapitools.example.invoker"
4141
modelPackage = "org.openapitools.example.model"
@@ -58,7 +58,7 @@ task buildJavaResttemplateSdk(type: org.openapitools.generator.gradle.plugin.tas
5858
generatorName = "java"
5959
library = "resttemplate"
6060
inputSpec = "$rootDir/petstore-v3.0.yaml".toString()
61-
outputDir = "$buildDir/java-resttemplate-api-client"
61+
outputDir = layout.buildDirectory.dir("java-resttemplate-api-client").get().asFile.toString()
6262
apiPackage = "com.example.client"
6363
invokerPackage = "com.example.invoker"
6464
modelPackage = "com.example.cdm"
@@ -79,7 +79,7 @@ task buildGoSdk(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTas
7979
additionalProperties = [
8080
packageName: "petstore"
8181
]
82-
outputDir = "$buildDir/go".toString()
82+
outputDir = layout.buildDirectory.dir("go").get().asFile.toString()
8383
configOptions = [
8484
dateLibrary: "threetenp"
8585
]
@@ -92,7 +92,7 @@ task buildDotnetSdk(type: org.openapitools.generator.gradle.plugin.tasks.Generat
9292
packageGuid: "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}",
9393
useCompareNetObjects: "true"
9494
]
95-
outputDir = "$buildDir/csharp".toString()
95+
outputDir = layout.buildDirectory.dir("csharp").get().asFile.toString()
9696
globalProperties = [
9797
models: "",
9898
apis : "",
@@ -106,7 +106,7 @@ task generateGoWithInvalidSpec(type: org.openapitools.generator.gradle.plugin.ta
106106
additionalProperties = [
107107
packageName: "petstore"
108108
]
109-
outputDir = "$buildDir/go".toString()
109+
outputDir = layout.buildDirectory.dir("go").get().asFile.toString()
110110
configOptions = [
111111
dateLibrary: "threetenp"
112112
]
Binary file not shown.

0 commit comments

Comments
 (0)