diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index a83157c..48e9987 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -9,7 +9,7 @@ on: - created permissions: - contents: read + contents: write pages: write id-token: write @@ -48,7 +48,7 @@ jobs: - name: Publish to Sonatype env: - ORG_GRADLE_PROJECT_publishVersion: ${{ github.event.release.tag_name }} + ORG_GRADLE_PROJECT_VERSION_NAME: ${{ github.event.release.tag_name }} ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} diff --git a/build.gradle.kts b/build.gradle.kts index e51d461..4fbba26 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,9 +1,8 @@ -import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.gradle.DokkaMultiModuleTask -import org.jetbrains.dokka.gradle.DokkaTaskPartial plugins { alias(libs.plugins.dokka) + alias(libs.plugins.kotlin.jvm) } allprojects { @@ -13,16 +12,11 @@ allprojects { } subprojects { - apply(plugin = "org.jetbrains.dokka") + apply(plugin = rootProject.libs.plugins.kotlin.jvm.get().pluginId) + apply(plugin = rootProject.libs.plugins.dokka.get().pluginId) - group = property("publishGroupId").toString() - version = property("publishVersion").toString() - - tasks.withType().configureEach { - dokkaSourceSets.configureEach { - includes.from("README.md") - } - } + group = property("GROUP").toString() + version = property("VERSION_NAME").toString() } tasks.withType().configureEach { diff --git a/gradle.properties b/gradle.properties index c00037d..fc60db4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,22 +1,23 @@ org.gradle.parallel=true org.gradle.caching=true -# Project -publishGroupId=net.gouline.kapsule -publishVersion=0.1-SNAPSHOT -publishName=Kapsule -publishDescription=Minimalist dependency injection library for Kotlin -publishUrl=https://github.com/gouline/kapsule +RELEASE_SIGNING_ENABLED=true +SONATYPE_HOST=DEFAULT +SONATYPE_AUTOMATIC_RELEASE=true -# Licence -publishLicenseName=MIT -publishLicenseUrl=https://opensource.org/licenses/MIT +GROUP=net.gouline.kapsule +VERSION_NAME=0.1-SNAPSHOT -# Developer -publishDeveloperId=gouline -publishDeveloperName=Mike Gouline +POM_NAME=Kapsule +POM_DESCRIPTION=Minimalist dependency injection library for Kotlin +POM_URL=https://github.com/gouline/kapsule -# SCM -publishScmConnection=scm:git:git://github.com/gouline/kapsule.git -publishScmDeveloperConnection="scm:git:ssh://github.com/gouline/kapsule.git" -publishScmUrl=https://github.com/gouline/kapsule +POM_LICENSE_NAME=MIT +POM_LICENSE_URL=https://opensource.org/licenses/MIT + +POM_SCM_URL=https://github.com/gouline/kapsule +POM_SCM_CONNECTION=scm:git:git://github.com/gouline/kapsule.git +POM_SCM_DEV_CONNECTION=scm:git:ssh://github.com/gouline/kapsule.git + +POM_DEVELOPER_ID=gouline +POM_DEVELOPER_NAME=Mike Gouline diff --git a/kapsule-core/build.gradle.kts b/kapsule-core/build.gradle.kts index 2a52185..e5fb4e0 100644 --- a/kapsule-core/build.gradle.kts +++ b/kapsule-core/build.gradle.kts @@ -1,9 +1,7 @@ import com.vanniktech.maven.publish.JavadocJar import com.vanniktech.maven.publish.KotlinJvm -import com.vanniktech.maven.publish.SonatypeHost plugins { - alias(libs.plugins.kotlin.jvm) `java-library` alias(libs.plugins.maven.publish) } @@ -27,37 +25,4 @@ mavenPublishing { sourcesJar = true, ) ) - - publishToMavenCentral(SonatypeHost.DEFAULT) - - signAllPublications() - - coordinates( - artifactId = name, - groupId = group.toString(), - version = version.toString(), - ) - - pom { - name.set(property("publishName").toString()) - description.set(property("publishDescription").toString()) - url.set(property("publishUrl").toString()) - licenses { - license { - name.set(property("publishLicenseName").toString()) - url.set(property("publishLicenseUrl").toString()) - } - } - developers { - developer { - id.set(property("publishDeveloperId").toString()) - name.set(property("publishDeveloperName").toString()) - } - } - scm { - connection.set(property("publishScmConnection").toString()) - developerConnection.set(property("publishScmDeveloperConnection").toString()) - url.set(property("publishScmUrl").toString()) - } - } } diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index af15d90..fbd6a02 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -1,12 +1,7 @@ plugins { - alias(libs.plugins.kotlin.jvm) application } -repositories { - mavenCentral() -} - dependencies { implementation(project(":kapsule-core")) @@ -19,12 +14,6 @@ application { mainClass = "net.gouline.kapsule.demo.DemoKt" } -java { - toolchain { - languageVersion = JavaLanguageVersion.of(17) - } -} - tasks.named("test") { useJUnitPlatform() }