luncliff / Muffin

Experiments with the Android NDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deploy of AAR

luncliff opened this issue · comments

Specify maven URL.

// see https://developer.android.com/studio/build/dependencies#google-maven
repositories {
    google()
    jcenter()
    maven { url "http://repo.nexus.com/content/repositories/releases/" }
    maven { url "http://repo.nexus.com/content/repositories/snapshots/" }
    maven { url "http://repo.nexus.com/content/repositories/nightly/" }
}

Publish to nightly

Publishing can be done with 1 command. Be aware of the credential issue in the CI environment.

gradle --info publish

Referenced

apply plugin: "maven-publish"
afterEvaluate {
    publishing {
        repositories {
            maven {
                url = "https://repo.nexus.com/content/repositories/nightly/"
                credentials {
                    username = System.getenv("PUBLISH_USERNAME")
                    password = System.getenv("PUBLISH_PASSWORD")
                }
            }
        }
        // https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm
        publications {
            // for AAR, use components.variant
            release(MavenPublication) {
                from components.release
                groupId = "org.luncliff"
                version = "1.2.4-SNAPSHOT"
                artifactId = "luncliff-muffin-release"
            }
            debug(MavenPublication) {
                from components.debug
                groupId = "org.luncliff"
                version = "1.2.4-SNAPSHOT"
                artifactId = "luncliff-muffin-debug"
            }
        }
    }
}