Skip to content

Commit e60721e

Browse files
authored
Merge pull request #665 from openziti/mgmt-api
add management-api module/artifact
2 parents 66a6039 + a2dab23 commit e60721e

File tree

599 files changed

+181364
-125
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

599 files changed

+181364
-125
lines changed

build.gradle.kts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ plugins {
2424
alias(libs.plugins.kotlin).apply(false)
2525
alias(libs.plugins.nexus.publish)
2626
alias(libs.plugins.semver.git)
27-
alias(libs.plugins.openapi)
2827
}
2928

3029
semver {
@@ -110,31 +109,3 @@ nexusPublishing {
110109
}
111110

112111

113-
// generate Ziti Edge API client
114-
// only needed if new version was published in github.com/openziti/edge-api
115-
// run `./gradlew :openApiGenerate`, check build, commit, push
116-
val edgeApiVersion = libs.versions.ziti.api.get()
117-
118-
openApiGenerate {
119-
applyDefaults()
120-
121-
remoteInputSpec.set("https://raw.githubusercontent.com/openziti/edge-api/v${edgeApiVersion}/client.yml")
122-
outputDir.set("$projectDir/edge-api")
123-
generatorName.set("java")
124-
groupId.set("org.openziti")
125-
id.set("edge-api")
126-
modelPackage.set("org.openziti.edge.model")
127-
apiPackage.set("org.openziti.edge.api")
128-
generateModelTests.set(false)
129-
generateApiTests.set(false)
130-
configOptions = mapOf(
131-
"dateLibrary" to "java8",
132-
"library" to "native",
133-
"asyncNative" to true.toString(),
134-
)
135-
}
136-
137-
tasks.named("openApiGenerate").get().finalizedBy(":edge-api:spotlessApply")
138-
139-
140-

edge-api/build.gradle

Lines changed: 0 additions & 95 deletions
This file was deleted.

edge-api/build.gradle.kts

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
2+
plugins {
3+
id("java")
4+
id("maven-publish")
5+
alias(libs.plugins.openapi)
6+
alias(libs.plugins.spotless)
7+
}
8+
9+
// Some text from the schema is copy/pasted into the source files as UTF-8
10+
// but the default still seems to be to use platform encoding
11+
tasks.withType<JavaCompile>().configureEach {
12+
sourceCompatibility = "11"
13+
targetCompatibility = "11"
14+
15+
options.encoding = "UTF-8"
16+
}
17+
18+
tasks.withType<Javadoc>().configureEach {
19+
options.encoding = "UTF-8"
20+
}
21+
22+
java {
23+
withSourcesJar()
24+
}
25+
26+
tasks.register<Jar>("javadocJar") {
27+
archiveClassifier = "javadoc"
28+
from(tasks.javadoc.get().destinationDir)
29+
dependsOn(tasks.javadoc)
30+
}
31+
32+
33+
publishing {
34+
publications {
35+
create<MavenPublication>(project.name) {
36+
artifactId = project.name
37+
from(components["java"])
38+
artifact(tasks["javadocJar"])
39+
}
40+
}
41+
}
42+
43+
val jacksonVersion = libs.versions.jackson.get()
44+
val jakartaAnnotationVersion = libs.versions.jakarta.annotation.get()
45+
46+
ext {
47+
description = "OpenZiti Edge API client"
48+
}
49+
50+
dependencies {
51+
implementation("com.google.code.findbugs:jsr305:3.0.2")
52+
implementation(libs.jackson.core)
53+
implementation(libs.jackson.annotations)
54+
implementation(libs.jackson.bind)
55+
implementation(libs.jackson.datatype)
56+
implementation("org.openapitools:jackson-databind-nullable:0.2.6")
57+
implementation("jakarta.annotation:jakarta.annotation-api:$jakartaAnnotationVersion")
58+
}
59+
60+
61+
// generate Ziti Edge API client
62+
// only needed if new version was published in github.com/openziti/edge-api
63+
// run `./gradlew :openApiGenerate`, check build, commit, push
64+
val edgeApiVersion = libs.versions.ziti.api.get()
65+
66+
openApiGenerate {
67+
applyDefaults()
68+
69+
remoteInputSpec.set("https://raw.githubusercontent.com/openziti/edge-api/v${edgeApiVersion}/client.yml")
70+
version.set(project.version.toString())
71+
outputDir.set("$projectDir")
72+
generatorName.set("java")
73+
groupId.set("org.openziti")
74+
id.set("edge-api")
75+
modelPackage.set("org.openziti.edge.model")
76+
apiPackage.set("org.openziti.edge.api")
77+
generateModelTests.set(false)
78+
generateApiTests.set(false)
79+
configOptions = mapOf(
80+
"dateLibrary" to "java8",
81+
"library" to "native",
82+
"asyncNative" to true.toString(),
83+
)
84+
}
85+
86+
87+
tasks.named("openApiGenerate").get().finalizedBy("spotlessApply")
88+
// Use spotless plugin to automatically format code, remove unused import, etc
89+
// To apply changes directly to the file, run `gradlew spotlessApply`
90+
// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle
91+
spotless {
92+
// comment out below to run spotless as part of the `check` task
93+
// enforceCheck = false
94+
format("misc") {
95+
// define the files (e.g. '*.gradle', '*.md') to apply `misc` to
96+
target(".gitignore")
97+
// define the steps to apply to those files
98+
trimTrailingWhitespace()
99+
leadingTabsToSpaces() // Takes an integer argument if you don't like 4
100+
endWithNewline()
101+
}
102+
java {
103+
// don't need to set target, it is inferred from java
104+
// apply a specific flavor of google-java-format
105+
googleJavaFormat("1.22.0").aosp().reflowLongStrings()
106+
removeUnusedImports()
107+
importOrder()
108+
}
109+
}
110+
111+
112+
tasks.named("spotlessApply").get().mustRunAfter("openApiGenerate")
113+
tasks.named("spotlessJava").get().mustRunAfter("openApiGenerate")
114+
tasks.named("spotlessMisc").get().mustRunAfter("openApiGenerate")
115+
116+
apply(from = rootProject.file("publish.gradle"))
117+
118+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
24+
25+
settings.gradle
26+
build.sbt
27+
git_push.sh
28+
pom.xml
29+
gradle*
30+
.gitignore
31+
.travis.yml
32+
.github/
33+
gradle/
34+
35+
build.gradle

0 commit comments

Comments
 (0)