diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 00e81bf..0000000 --- a/build.gradle +++ /dev/null @@ -1,51 +0,0 @@ -buildscript { - ext.kotlin_version = '1.6.10' - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:7.0.4' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -plugins { - id "signing" - id "maven-publish" - id "io.github.gradle-nexus.publish-plugin" version "1.1.0" -} - -signing { - def signingKey = findProperty("signingKey") - def signingPassword = findProperty("signingPassword") - useInMemoryPgpKeys(signingKey, signingPassword) - sign publishing.publications -} - -nexusPublishing { - packageGroup = "org.bitcoindevkit" - repositories { - sonatype { - nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) - snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) - - username = project.findProperty("ossrhUsername") - password = project.findProperty("ossrhPassword") - } - } -} - -allprojects { - repositories { - google() - mavenCentral() - } - tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { - kotlinOptions { - freeCompilerArgs += [ - "-Xopt-in=kotlin.ExperimentalUnsignedTypes", - ] - } - } -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..a03245b --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,52 @@ +buildscript { + repositories { + google() + mavenCentral() + } + dependencies { + classpath("com.android.tools.build:gradle:7.0.4") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10") + } +} + +plugins { + id("signing") + id("maven-publish") + id("io.github.gradle-nexus.publish-plugin") version "1.1.0" +} + +signing { + val signingKey: String? by project + val signingPassword: String? by project + useInMemoryPgpKeys(signingKey, signingPassword) + sign(publishing.publications) +} + +// does this need to be defined here? Not sure +// it used to be defined in the nexusPublishing block but is not required +// I think the group ID is defined in the specific publishing blocks in the respective build.gradle.kts +group = "org.bitcoindevkit" + +nexusPublishing { + repositories { + create("sonatype") { + nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) + snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) + + val ossrhUsername: String? by project + val ossrhPassword: String? by project + username.set(ossrhUsername) + password.set(ossrhPassword) + } + } +} + +allprojects { + repositories { + google() + mavenCentral() + } + tasks.withType().configureEach { + kotlinOptions.freeCompilerArgs += "-opt-in=kotlin.ExperimentalUnsignedTypes" + } +}