diff --git a/.gitignore b/.gitignore index b63da45..2f08700 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,5 @@ bin/ .vscode/ ### Mac OS ### -.DS_Store \ No newline at end of file +.DS_Store +/.kotlin/ diff --git a/build.gradle.kts b/build.gradle.kts index bab4492..6a346b4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,7 @@ import com.vanniktech.maven.publish.SonatypeHost plugins { + `kotlin-dsl` kotlin("multiplatform") version "2.0.21" apply false kotlin("jvm") version "2.0.21" apply false application @@ -10,7 +11,7 @@ plugins { } object Conf { - const val GROUP = "net.kigawa" + const val GROUP = "net.kigawa.renlin-compiler" // Base version - will be modified based on branch name if available const val BASE_VERSION = "1.3.0" @@ -50,6 +51,7 @@ val projectVersion = determineVersion() group = Conf.GROUP version = projectVersion + allprojects { group = Conf.GROUP version = projectVersion @@ -58,28 +60,20 @@ repositories { mavenCentral() } -// Root project - no source code, only module aggregation - +// Root project - only manages subprojects and Maven Central publishing configuration publishing { // Configure all publications publications.withType { - // disabled https://github.com/vanniktech/gradle-maven-publish-plugin/issues/754 - // and configured at library build.gradle.kts using `JavadocJar.Dokka("dokkaHtml")`. - /* - // Stub javadoc.jar artifact - artifact(tasks.register("${name}JavadocJar", Jar::class) { - archiveClassifier.set("javadoc") - archiveAppendix.set(this@withType.name) - })*/ - - // Provide artifacts information required by Maven Central pom { - name = "net.kigawa.renlin-compiler.gradle.plugin" - description = "Kotlin Compiler Plugin for automatic value injection with @AutoFill annotation" - url = "https://github.com/Code-Sakura/renlin-compiler" - properties = mapOf( + artifactId = "net.kigawa.renlin-compiler.gradle.plugin" + name.set("net.kigawa.renlin-compiler.gradle.plugin") + description.set("Kotlin Compiler Plugin for automatic value injection with @AutoFill annotation") + url.set("https://github.com/Code-Sakura/renlin-compiler") + properties.set( + mapOf( + ) ) licenses { license { diff --git a/gradle-plugin/build.gradle.kts b/gradle-plugin/build.gradle.kts index 79d9b4c..45231de 100644 --- a/gradle-plugin/build.gradle.kts +++ b/gradle-plugin/build.gradle.kts @@ -1,8 +1,6 @@ plugins { kotlin("jvm") `java-gradle-plugin` - `maven-publish` - signing } group = "net.kigawa" @@ -16,7 +14,7 @@ repositories { gradlePlugin { website.set("https://github.com/Code-Sakura/renlin-compiler") vcsUrl.set("https://github.com/Code-Sakura/renlin-compiler.git") - + plugins { create("renlinCompiler") { id = "net.kigawa.renlin-compiler" @@ -46,52 +44,3 @@ java { } -publishing { - publications.withType { - pom { - name.set("Renlin Compiler Gradle Plugin") - description.set("Gradle plugin that enables automatic value injection for @AutoFill annotated parameters using Kotlin Compiler Plugin") - url.set("https://github.com/Code-Sakura/renlin-compiler") - - licenses { - license { - name.set("MIT License") - url.set("https://opensource.org/licenses/MIT") - } - } - - developers { - developer { - id.set("kigawa01") - name.set("kigawa") - email.set("kigawa.inbox@gmail.com") - } - } - - scm { - connection.set("scm:git:https://github.com/Code-Sakura/renlin-compiler.git") - developerConnection.set("scm:git:https://github.com/Code-Sakura/renlin-compiler.git") - url.set("https://github.com/Code-Sakura/renlin-compiler") - } - } - } - repositories { - mavenLocal() - } -} - - -signing { - val signingKey: String? by project - val signingPassword: String? by project - val hasSigningCredentials = (System.getenv("GPG_SIGNING_KEY") != null && System.getenv("GPG_SIGNING_PASSWORD") != null) || - (signingKey != null && signingPassword != null) - - if (hasSigningCredentials) { - useInMemoryPgpKeys( - System.getenv("GPG_SIGNING_KEY") ?: signingKey, - System.getenv("GPG_SIGNING_PASSWORD") ?: signingPassword - ) - sign(publishing.publications) - } -} \ No newline at end of file diff --git a/kotlin-plugin/build.gradle.kts b/kotlin-plugin/build.gradle.kts index e45892d..7528a17 100644 --- a/kotlin-plugin/build.gradle.kts +++ b/kotlin-plugin/build.gradle.kts @@ -1,7 +1,5 @@ plugins { kotlin("multiplatform") - `maven-publish` - signing } group = "net.kigawa" @@ -14,32 +12,32 @@ repositories { kotlin { jvmToolchain(17) - + jvm { compilations.all { kotlinOptions.jvmTarget = "17" } withJava() } - + js(IR) { browser() nodejs() } - + sourceSets { val commonMain by getting { dependencies { implementation("org.jetbrains.kotlin:kotlin-stdlib-common") } } - + val commonTest by getting { dependencies { implementation(kotlin("test")) } } - + val jvmMain by getting { dependencies { implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") @@ -47,19 +45,18 @@ kotlin { compileOnly("com.google.auto.service:auto-service:1.1.1") } } - + val jvmTest by getting { dependencies { - implementation(kotlin("test-junit5")) } } - + val jsMain by getting { dependencies { implementation("org.jetbrains.kotlin:kotlin-stdlib-js") } } - + val jsTest by getting { dependencies { implementation(kotlin("test-js")) @@ -69,52 +66,3 @@ kotlin { } -publishing { - publications.withType { - pom { - name.set("Renlin AutoFill Annotation") - description.set("Multiplatform annotation library for automatic parameter value injection, supporting both JVM and JavaScript") - url.set("https://github.com/Code-Sakura/renlin-compiler") - - licenses { - license { - name.set("MIT License") - url.set("https://opensource.org/licenses/MIT") - } - } - - developers { - developer { - id.set("kigawa01") - name.set("kigawa") - email.set("kigawa.inbox@gmail.com") - } - } - - scm { - connection.set("scm:git:https://github.com/Code-Sakura/renlin-compiler.git") - developerConnection.set("scm:git:https://github.com/Code-Sakura/renlin-compiler.git") - url.set("https://github.com/Code-Sakura/renlin-compiler") - } - } - } - repositories { - mavenLocal() - } -} - - -signing { - val signingKey: String? by project - val signingPassword: String? by project - val hasSigningCredentials = (System.getenv("GPG_SIGNING_KEY") != null && System.getenv("GPG_SIGNING_PASSWORD") != null) || - (signingKey != null && signingPassword != null) - - if (hasSigningCredentials) { - useInMemoryPgpKeys( - System.getenv("GPG_SIGNING_KEY") ?: signingKey, - System.getenv("GPG_SIGNING_PASSWORD") ?: signingPassword - ) - sign(publishing.publications) - } -} \ No newline at end of file