Skip to content

Commit 1ed3458

Browse files
committed
downgrade gradle version to v7.6
1 parent 5b8b972 commit 1ed3458

File tree

5 files changed

+22
-21
lines changed

5 files changed

+22
-21
lines changed

build.gradle.kts

+14-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
`java-gradle-plugin`
33
id("com.gradle.plugin-publish") version "1.2.0"
44
id("org.sonarqube") version "3.1.1"
5-
kotlin("jvm") version "1.8.21"
5+
kotlin("jvm") version "1.7.10"
66
`maven-publish`
77
id("com.github.ben-manes.versions") version "0.38.0"
88
id("io.gitlab.arturbosch.detekt") version "1.16.0"
@@ -39,7 +39,11 @@ publishing {
3939
uri("https://oss.sonatype.org/content/repositories/snapshots")
4040
url = if (version.toString()
4141
.endsWith("SNAPSHOT")
42-
) snapshotsRepoUrl else releasesRepoUrl
42+
) {
43+
snapshotsRepoUrl
44+
} else {
45+
releasesRepoUrl
46+
}
4347
credentials {
4448
username = System.getenv("OSSRH_USER")
4549
password = System.getenv("OSSRH_PASS")
@@ -66,21 +70,22 @@ dependencies {
6670
}
6771

6872
gradlePlugin {
69-
website = "https://github.com/springdoc/springdoc-openapi-gradle-plugin"
70-
vcsUrl = "https://github.com/springdoc/springdoc-openapi-gradle-plugin.git"
7173
plugins {
7274
create("springdoc-gradle-plugin") {
7375
id = "org.springdoc.openapi-gradle-plugin"
7476
displayName = "A Gradle plugin for the springdoc-openapi library"
75-
description =
76-
" This plugin uses springdoc-openapi to generate an OpenAPI description at build time"
77-
implementationClass =
78-
"org.springdoc.openapi.gradle.plugin.OpenApiGradlePlugin"
79-
tags = listOf("springdoc", "openapi", "swagger")
77+
description = " This plugin uses springdoc-openapi to generate an OpenAPI description at build time"
78+
implementationClass = "org.springdoc.openapi.gradle.plugin.OpenApiGradlePlugin"
8079
}
8180
}
8281
}
8382

83+
pluginBundle {
84+
website = "https://github.com/springdoc/springdoc-openapi-gradle-plugin"
85+
vcsUrl = "https://github.com/springdoc/springdoc-openapi-gradle-plugin.git"
86+
tags = listOf("springdoc", "openapi", "swagger")
87+
}
88+
8489
val jvmVersion: JavaLanguageVersion = JavaLanguageVersion.of(8)
8590

8691
java {

config/detekt/detekt.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ exceptions:
206206
- NumberFormatException
207207
- ParseException
208208
- MalformedURLException
209+
- UnknownDomainObjectException
209210
allowedExceptionNameRegex: '_|(ignore|expected).*'
210211
ThrowingExceptionFromFinally:
211212
active: true
@@ -230,7 +231,6 @@ exceptions:
230231
- IllegalMonitorStateException
231232
- NullPointerException
232233
- IndexOutOfBoundsException
233-
- RuntimeException
234234
- Throwable
235235
allowedExceptionNameRegex: '_|(ignore|expected).*'
236236
TooGenericExceptionThrown:
@@ -325,10 +325,6 @@ formatting:
325325
PackageName:
326326
active: true
327327
autoCorrect: true
328-
ParameterListWrapping:
329-
active: true
330-
autoCorrect: true
331-
indentSize: 4
332328
SpacingAroundAngleBrackets:
333329
active: false
334330
autoCorrect: true

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

src/main/kotlin/org/springdoc/openapi/gradle/plugin/OpenApiGeneratorTask.kt

+2-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ open class OpenApiGeneratorTask : DefaultTask() {
5252

5353
// set a default value if not provided
5454
val defaultOutputDir = project.objects.directoryProperty()
55-
defaultOutputDir.convention(project.layout.buildDirectory.dir("openapi"))
55+
defaultOutputDir.set(project.buildDir)
5656

5757
apiDocsUrl.convention(extension.apiDocsUrl.getOrElse(DEFAULT_API_DOCS_URL))
5858
outputFileName.convention(
@@ -80,8 +80,7 @@ open class OpenApiGeneratorTask : DefaultTask() {
8080

8181
private fun generateApiDocs(url: String, fileName: String) {
8282
try {
83-
val isYaml =
84-
url.lowercase(Locale.getDefault()).matches(Regex(".+[./]yaml(/.+)*"))
83+
val isYaml = url.toLowerCase().matches(Regex(".+[./]yaml(/.+)*"))
8584
await ignoreException ConnectException::class withPollInterval Durations.ONE_SECOND atMost Duration.of(
8685
waitTimeInSeconds.get().toLong(),
8786
SECONDS

src/main/kotlin/org/springdoc/openapi/gradle/plugin/OpenApiGradlePlugin.kt

+4-3
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ open class OpenApiGradlePlugin : Plugin<Project> {
7373
val tasksNames = tasks.names
7474
val boot2TaskName = "bootRunMainClassName"
7575
val boot3TaskName = "resolveMainClassName"
76-
if (!tasksNames.contains(boot2TaskName) && tasksNames.contains(boot3TaskName))
77-
tasks.register(boot2TaskName) { it.dependsOn(tasks.named(boot3TaskName)) }
76+
if (!tasksNames.contains(boot2TaskName) && tasksNames.contains(boot3TaskName)) {
77+
tasks.register(boot2TaskName) { it.dependsOn(tasks.named(boot3TaskName)) }
78+
}
7879
}
7980

8081
private fun needToFork(
@@ -95,7 +96,7 @@ open class OpenApiGradlePlugin : Plugin<Project> {
9596

9697
// use original bootRun parameter if the list-type customBootRun properties are empty
9798
workingDir = customBootRun.workingDir.asFile.orNull
98-
?: fork.temporaryDir
99+
?: fork.workingDir
99100
args = customBootRun.args.orNull?.takeIf { it.isNotEmpty() }?.toMutableList()
100101
?: bootRun.args?.toMutableList() ?: mutableListOf()
101102
classpath = customBootRun.classpath.takeIf { !it.isEmpty }

0 commit comments

Comments
 (0)