Skip to content

Commit

Permalink
Change the publication steps in the rest-api module.
Browse files Browse the repository at this point in the history
  • Loading branch information
gjong committed Sep 11, 2024
1 parent 6e04b9e commit 3958163
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
12 changes: 7 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ subprojects {
}

publishing {
publications {
create<MavenPublication>("maven") {
groupId = "com.jongsoft.finance"
version = System.getProperty("version")
from(components["java"])
if (project.name != "fintrack-api") {
publications {
create<MavenPublication>("maven") {
groupId = "com.jongsoft.finance"
version = System.getProperty("version")
from(components["java"])
}
}
}

Expand Down
34 changes: 19 additions & 15 deletions fintrack-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@ openApiGenerate {
skipValidateSpec.set(true)
}

publishing {
publications {
create<MavenPublication>("documentation") {
groupId = "com.jongsoft.finance"
artifactId = "api-docs"
version = System.getProperty("version")
artifacts.add(artifact(layout.buildDirectory.dir("asciidoc").get().file("index.adoc")))
}
}
}

val integration by sourceSets.creating

configurations[integration.implementationConfigurationName].extendsFrom(configurations.testImplementation.get())
Expand All @@ -53,12 +42,27 @@ tasks.jacocoTestReport {
tasks.check {
dependsOn("itTest")
}
tasks.publishMavenPublicationToGitHubPackagesRepository {
dependsOn("openApiGenerate")

tasks.withType<JavaCompile> {
finalizedBy(tasks.getByName("openApiGenerate"))
}

tasks.compileJava {
finalizedBy(tasks.openApiGenerate)
configurations {
create("api-docs")
}

val apiArtifact = artifacts.add("api-docs", layout.buildDirectory.file("asciidoc/index.adoc")) {
type = "asciidoc"
builtBy(tasks.getByName("openApiGenerate"))
}

publishing.publications {
create<MavenPublication>("maven") {
groupId = "com.jongsoft.finance"
version = System.getProperty("version")
from(components["java"])
artifact(apiArtifact)
}
}

dependencies {
Expand Down

0 comments on commit 3958163

Please sign in to comment.