Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/deploy-to-mavencentral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@ jobs:
echo "mavenCentralPassword=$MAVEN_CENTRAL_PASSWORD" >> gradle.properties
./gradlew --stacktrace documentify-core:publish
./gradlew --stacktrace documentify-plugin:publish
./gradlew --stacktrace documentify-starters:documentify-mvc:publish
./gradlew --stacktrace documentify-starters:documentify-reactive:publish
./gradlew --stacktrace documentify-project:documentify-mvc:publish
./gradlew --stacktrace documentify-project:documentify-reactive:publish
./gradlew --stacktrace documentify-starters:documentify-starter-mvc:publish
./gradlew --stacktrace documentify-starters:documentify-starter-reactive:publish
83 changes: 81 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.time.Year

plugins {
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.plugin.spring) apply false
alias(libs.plugins.gradle.mavenCentral.publish) apply false
alias(libs.plugins.kotlinx.kover)
java
signing
`maven-publish`
}

group = extra["project.group"] as String
version = extra["project.version.id"] as String

val publicModulePathSet = setOf(
rootProject.projects.documentifyCore.identityPath.path,
rootProject.projects.documentifyPlugin.identityPath.path,
rootProject.projects.documentifyProject.documentifyMvc.identityPath.path,
rootProject.projects.documentifyProject.documentifyReactive.identityPath.path,
rootProject.projects.documentifyStarters.documentifyStarterMvc.identityPath.path,
rootProject.projects.documentifyStarters.documentifyStarterReactive.identityPath.path
)

subprojects {
group = rootProject.group
version = rootProject.version
Expand All @@ -36,6 +51,70 @@ subprojects {
useJUnitPlatform()
}
}
if (publicModulePathSet.contains(project.path)) {
with(pluginManager) {
apply(rootProject.libs.plugins.gradle.mavenCentral.publish.get().pluginId)
apply(plugin = "signing")
apply(plugin = "maven-publish")
}
configure<SigningExtension> {
val gpgSecret = project.findProperty("gpg.secret").toString()
val gpgPassphrase = project.findProperty("gpg.passphrase").toString()

useInMemoryPgpKeys(gpgSecret, gpgPassphrase)
sign(publishing.publications)
}
configure<MavenPublishBaseExtension> {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)

val artifactId = name.replace("-plugin", ".gradle.plugin")
val projectGroup = property("project.group").toString()
val projectName = property("project.name").toString()
val projectVersion = property("project.version.id").toString()
val projectDescription = property("project.description").toString()
val projectUrl = property("project.url").toString()
val projectUrlScm = property("project.url.scm").toString()
val projectLicense = property("project.license").toString()
val projectLicenseUrl = property("project.license.url").toString()
val projectDeveloperId = property("project.developer.id").toString()
val projectDeveloperName = property("project.developer.name").toString()
val projectDeveloperEmail = property("project.developer.email").toString()
val projectDeveloperUrl = property("project.developer.url").toString()

coordinates(
groupId = projectGroup,
artifactId = artifactId,
version = projectVersion
)

pom {
name = projectName
description = projectDescription
inceptionYear = "${Year.now().value}"
url = projectUrl
licenses {
license {
name = projectLicense
url = projectLicenseUrl
distribution = projectUrl
}
}
developers {
developer {
id = projectDeveloperId
name = projectDeveloperName
email = projectDeveloperEmail
url = projectDeveloperUrl
}
}
scm {
url = projectUrlScm
connection = "scm:git:git://github.com/${projectDeveloperId}"
developerConnection = "scm:git:ssh://git@github.com/${projectDeveloperId}"
}
}
}
}
}

repositories {
Expand All @@ -46,8 +125,8 @@ kover {
merge {
projects(
rootProject.projects.documentifyCore.identityPath.path,
rootProject.projects.documentifyStarters.documentifyMvc.identityPath.path,
rootProject.projects.documentifyStarters.documentifyReactive.identityPath.path,
rootProject.projects.documentifyProject.documentifyMvc.identityPath.path,
rootProject.projects.documentifyProject.documentifyReactive.identityPath.path,
rootProject.projects.documentifySample.mvcSample.identityPath.path,
rootProject.projects.documentifySample.reactiveSample.identityPath.path
)
Expand Down
67 changes: 0 additions & 67 deletions documentify-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
import com.vanniktech.maven.publish.SonatypeHost
import java.time.Year

plugins {
alias(libs.plugins.gradle.mavenCentral.publish)
signing
`maven-publish`
}

dependencies {
implementation(libs.spring.boot.starter.test)
implementation(libs.restdocs.api.spec)
Expand All @@ -15,62 +6,4 @@ dependencies {
compileOnly(libs.spring.boot.starter.webflux)
api(libs.jackson.databind)
api(libs.jackson.datatype.jsr310)
}

signing {
val gpgSecret = project.findProperty("gpg.secret").toString()
val gpgPassphrase = project.findProperty("gpg.passphrase").toString()

useInMemoryPgpKeys(gpgSecret, gpgPassphrase)
sign(publishing.publications)
}

mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)

val projectGroup = property("project.group").toString()
val projectName = property("project.name").toString()
val projectVersion = property("project.version.id").toString()
val projectDescription = property("project.description").toString()
val projectUrl = property("project.url").toString()
val projectUrlScm = property("project.url.scm").toString()
val projectLicense = property("project.license").toString()
val projectLicenseUrl = property("project.license.url").toString()
val projectDeveloperId = property("project.developer.id").toString()
val projectDeveloperName = property("project.developer.name").toString()
val projectDeveloperEmail = property("project.developer.email").toString()
val projectDeveloperUrl = property("project.developer.url").toString()

coordinates(
groupId = projectGroup,
artifactId = "$projectName-core",
version = projectVersion
)

pom {
name = projectName
description = projectDescription
inceptionYear = "${Year.now().value}"
url = projectUrl
licenses {
license {
name = projectLicense
url = projectLicenseUrl
distribution = projectUrl
}
}
developers {
developer {
id = projectDeveloperId
name = projectDeveloperName
email = projectDeveloperEmail
url = projectDeveloperUrl
}
}
scm {
url = projectUrlScm
connection = "scm:git:git://github.com/${projectDeveloperId}"
developerConnection = "scm:git:ssh://git@github.com/${projectDeveloperId}"
}
}
}
65 changes: 0 additions & 65 deletions documentify-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import com.vanniktech.maven.publish.SonatypeHost
import java.time.Year

plugins {
alias(libs.plugins.gradle.mavenCentral.publish)
`java-gradle-plugin`
`maven-publish`
signing
}

repositories {
Expand All @@ -26,63 +20,4 @@ gradlePlugin {
dependencies {
implementation(gradleApi())
implementation(libs.restdocs.api.spec.gradlePlugin)
}


signing {
val gpgSecret = project.findProperty("gpg.secret").toString()
val gpgPassphrase = project.findProperty("gpg.passphrase").toString()

useInMemoryPgpKeys(gpgSecret, gpgPassphrase)
sign(publishing.publications)
}

mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)

val projectGroup = property("project.group").toString()
val projectName = property("project.name").toString()
val projectVersion = property("project.version.id").toString()
val projectDescription = property("project.description").toString()
val projectUrl = property("project.url").toString()
val projectUrlScm = property("project.url.scm").toString()
val projectLicense = property("project.license").toString()
val projectLicenseUrl = property("project.license.url").toString()
val projectDeveloperId = property("project.developer.id").toString()
val projectDeveloperName = property("project.developer.name").toString()
val projectDeveloperEmail = property("project.developer.email").toString()
val projectDeveloperUrl = property("project.developer.url").toString()

coordinates(
groupId = projectGroup,
artifactId = "$projectName.gradle.plugin",
version = projectVersion
)

pom {
name = projectName
description = projectDescription
inceptionYear = "${Year.now().value}"
url = projectUrl
licenses {
license {
name = projectLicense
url = projectLicenseUrl
distribution = projectUrl
}
}
developers {
developer {
id = projectDeveloperId
name = projectDeveloperName
email = projectDeveloperEmail
url = projectDeveloperUrl
}
}
scm {
url = projectUrlScm
connection = "scm:git:git://github.com/${projectDeveloperId}"
developerConnection = "scm:git:ssh://git@github.com/${projectDeveloperId}"
}
}
}
9 changes: 9 additions & 0 deletions documentify-project/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
subprojects {
with(pluginManager) {
apply(rootProject.libs.plugins.gradle.mavenCentral.publish.get().pluginId)
}
dependencies {
compileOnly(rootProject.libs.spring.boot.starter.test)
api(rootProject.projects.documentifyCore)
}
}
9 changes: 9 additions & 0 deletions documentify-project/documentify-mvc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencies {
compileOnly(libs.spring.boot.starter.web)
implementation(libs.spring.restdocs.mockmvc)
implementation(libs.spring.restdocs.restassured)
implementation(libs.restassured.mockmvc)
implementation(libs.restdocs.api.spec)
implementation(libs.restdocs.api.spec.mockmvc)
implementation(libs.restdocs.api.spec.restassured)
}
6 changes: 6 additions & 0 deletions documentify-project/documentify-reactive/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies {
compileOnly(libs.spring.boot.starter.webflux)
implementation(libs.spring.restdocs.webtestclient)
implementation(libs.restdocs.api.spec)
implementation(libs.restdocs.api.spec.webtestclient)
}
2 changes: 1 addition & 1 deletion documentify-sample/mvc-sample/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies {
implementation(rootProject.libs.spring.boot.starter.web)
testImplementation(rootProject.projects.documentifyStarters.documentifyMvc)
testImplementation(rootProject.projects.documentifyStarters.documentifyStarterMvc)
}

openapi3 {
Expand Down
2 changes: 1 addition & 1 deletion documentify-sample/reactive-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependencies {
implementation(libs.kotlinx.coroutines)
implementation(libs.kotlinx.coroutines.reactor)

testImplementation(rootProject.projects.documentifyStarters.documentifyReactive)
testImplementation(rootProject.projects.documentifyStarters.documentifyStarterReactive)
testImplementation(libs.kotlinx.coroutines.test)
testImplementation(kotlin("test"))
}
Expand Down
Loading