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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ bin/
.vscode/

### Mac OS ###
.DS_Store
.DS_Store
/.kotlin/
28 changes: 11 additions & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -50,6 +51,7 @@ val projectVersion = determineVersion()

group = Conf.GROUP
version = projectVersion

allprojects {
group = Conf.GROUP
version = projectVersion
Expand All @@ -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<MavenPublication> {
// 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([email protected])
})*/

// 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 {
Expand Down
53 changes: 1 addition & 52 deletions gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
plugins {
kotlin("jvm")
`java-gradle-plugin`
`maven-publish`
signing
}

group = "net.kigawa"
Expand All @@ -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"
Expand Down Expand Up @@ -46,52 +44,3 @@ java {
}


publishing {
publications.withType<MavenPublication> {
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("[email protected]")
}
}

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)
}
}
68 changes: 8 additions & 60 deletions kotlin-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
plugins {
kotlin("multiplatform")
`maven-publish`
signing
}

group = "net.kigawa"
Expand All @@ -14,52 +12,51 @@ 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")
implementation("org.jetbrains.kotlin:kotlin-compiler-embeddable:2.0.21")
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"))
Expand All @@ -69,52 +66,3 @@ kotlin {
}


publishing {
publications.withType<MavenPublication> {
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("[email protected]")
}
}

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)
}
}