Skip to content

Commit 3958163

Browse files
committed
Change the publication steps in the rest-api module.
1 parent 6e04b9e commit 3958163

File tree

2 files changed

+26
-20
lines changed

2 files changed

+26
-20
lines changed

build.gradle.kts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ subprojects {
3131
}
3232

3333
publishing {
34-
publications {
35-
create<MavenPublication>("maven") {
36-
groupId = "com.jongsoft.finance"
37-
version = System.getProperty("version")
38-
from(components["java"])
34+
if (project.name != "fintrack-api") {
35+
publications {
36+
create<MavenPublication>("maven") {
37+
groupId = "com.jongsoft.finance"
38+
version = System.getProperty("version")
39+
from(components["java"])
40+
}
3941
}
4042
}
4143

fintrack-api/build.gradle.kts

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,6 @@ openApiGenerate {
2020
skipValidateSpec.set(true)
2121
}
2222

23-
publishing {
24-
publications {
25-
create<MavenPublication>("documentation") {
26-
groupId = "com.jongsoft.finance"
27-
artifactId = "api-docs"
28-
version = System.getProperty("version")
29-
artifacts.add(artifact(layout.buildDirectory.dir("asciidoc").get().file("index.adoc")))
30-
}
31-
}
32-
}
33-
3423
val integration by sourceSets.creating
3524

3625
configurations[integration.implementationConfigurationName].extendsFrom(configurations.testImplementation.get())
@@ -53,12 +42,27 @@ tasks.jacocoTestReport {
5342
tasks.check {
5443
dependsOn("itTest")
5544
}
56-
tasks.publishMavenPublicationToGitHubPackagesRepository {
57-
dependsOn("openApiGenerate")
45+
46+
tasks.withType<JavaCompile> {
47+
finalizedBy(tasks.getByName("openApiGenerate"))
5848
}
5949

60-
tasks.compileJava {
61-
finalizedBy(tasks.openApiGenerate)
50+
configurations {
51+
create("api-docs")
52+
}
53+
54+
val apiArtifact = artifacts.add("api-docs", layout.buildDirectory.file("asciidoc/index.adoc")) {
55+
type = "asciidoc"
56+
builtBy(tasks.getByName("openApiGenerate"))
57+
}
58+
59+
publishing.publications {
60+
create<MavenPublication>("maven") {
61+
groupId = "com.jongsoft.finance"
62+
version = System.getProperty("version")
63+
from(components["java"])
64+
artifact(apiArtifact)
65+
}
6266
}
6367

6468
dependencies {

0 commit comments

Comments
 (0)