Skip to content

Commit

Permalink
[Publishing] Add Android publishing for both debug and release (#5)
Browse files Browse the repository at this point in the history
* Add publishing for Android library

* Rename to just simply version

* Retire Jcenter and co.
  • Loading branch information
kittinunf authored May 6, 2021
1 parent fdaaa67 commit 65ca5f8
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
allprojects {
repositories {
jcenter()
mavenCentral()
google()
}
}
3 changes: 1 addition & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ plugins {
}

repositories {
google()
mavenCentral()
jcenter()
google()
maven { setUrl("https://plugins.gradle.org/m2/") }
}

Expand Down
2 changes: 1 addition & 1 deletion buildSrc/buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ plugins {
}

repositories {
jcenter()
mavenCentral()
}
11 changes: 6 additions & 5 deletions buildSrc/buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Main libraries
object Kotlin {

private const val version = "1.4.32"
Expand Down Expand Up @@ -32,10 +33,10 @@ object AndroidX {

object Coroutines {

private const val mtVersion = "1.4.3-native-mt"
private const val version = "1.4.3-native-mt"

const val core = "org.jetbrains.kotlinx:kotlinx-coroutines-core:$mtVersion"
const val test = "org.jetbrains.kotlinx:kotlinx-coroutines-test:$mtVersion"
const val core = "org.jetbrains.kotlinx:kotlinx-coroutines-core:$version"
const val test = "org.jetbrains.kotlinx:kotlinx-coroutines-test:$version"
}

// Test libraries
Expand All @@ -52,10 +53,10 @@ object Jacoco {
const val version = "0.8.6"
}

// Publishing
// Publishing libraries
object Publishing {
const val groupId = "com.github.kittinunf.cored"
const val version = "0.1.1"
const val version = "0.1.2"
}

object GradleNexus {
Expand Down
5 changes: 4 additions & 1 deletion cored/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ android {
}

kotlin {
android()
android {
publishLibraryVariants("release", "debug")
}

ios {
binaries {
framework {
Expand Down
3 changes: 0 additions & 3 deletions plugins/src/main/kotlin/publication.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ plugins {
signing
}

// Stub secrets to let the project sync and build without the publication values set up
ext["signing.key"] = null
ext["signing.password"] = null
ext["sonatype.username"] = null
ext["sonatype.password"] = null

// Grabbing secrets from local.properties file or from environment variables, which could be used on CI
val secretPropsFile = project.rootProject.file("local.properties")
if (secretPropsFile.exists()) {
secretPropsFile.reader().use {
Expand All @@ -40,7 +38,6 @@ val isReleaseBuild: Boolean
get() = properties.containsKey("release")

publishing {
// Configure maven central repository
repositories {
maven {
name = "sonatype"
Expand Down
3 changes: 1 addition & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
pluginManagement {
repositories {
jcenter()
google()
mavenCentral()
google()

maven { setUrl("https://dl.bintray.com/kotlin/kotlin") }
maven { setUrl("https://kotlin.bintray.com/kotlinx") }
Expand Down

0 comments on commit 65ca5f8

Please sign in to comment.