-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Expand file tree
/
Copy pathbuild.gradle
More file actions
73 lines (61 loc) · 2.36 KB
/
build.gradle
File metadata and controls
73 lines (61 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
plugins {
id("com.gradle.plugin-publish") version "1.3.1"
id("signing")
}
group = "org.openapitools"
version = "$openApiGeneratorVersion"
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
description = """
This plugin supports common functionality found in Open API Generator CLI as a Gradle plugin.
This gives you the ability to generate client SDKs, documentation, new generators, and to validate Open API 2.0 and 3.x
specifications as part of your build. Other tasks are available as command line tasks.
"""
java {
withSourcesJar()
withJavadocJar()
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation("org.openapitools:openapi-generator:$openApiGeneratorVersion")
testImplementation("org.jetbrains.kotlin:kotlin-test-testng:1.9.0")
}
tasks.named("test", Test).configure {
useTestNG()
testLogging.showStandardStreams = false
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}
onOutput { descriptor, event ->
// SLF4J may complain about multiple bindings depending on how this is run.
// This is just a warning, but can make test output less readable. So we ignore it specifically.
if (!event.message.contains("SLF4J:")) {
logger.lifecycle("Test: " + descriptor + " produced standard out/err: " + event.message)
}
}
}
tasks.withType(Javadoc).configureEach {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption("html5", true)
}
}
tasks.named("validatePlugins").configure {
enableStricterValidation = true
}
gradlePlugin {
website = "https://openapi-generator.tech/"
vcsUrl = "https://github.com/OpenAPITools/openapi-generator"
plugins {
openApiGenerator {
id = "org.openapi.generator"
description = "OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)."
displayName = "OpenAPI Generator Gradle Plugin"
implementationClass = "org.openapitools.generator.gradle.plugin.OpenApiGeneratorPlugin"
tags.addAll("openapi-3.1", "openapi-3.0", "openapi-2.0", "openapi", "swagger", "codegen", "sdk")
}
}
}