CrazyOrr / gradle-mvn-artifacts

Helper to config Gradle Artifacts for publishing to Maven repositories

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gradle-mvn-artifacts

Helper to config Gradle Artifacts for publishing to Maven repositories.

Supports:

Usage

1. Have a working Gradle build

This is up to you.

2. Apply the script from each sub-modules build.gradle where you want to create sources and javadoc jars

android {
    // ...
}
dependencies {
    // ...
}
// after android and dependencies configurations

apply from: 'https://raw.githubusercontent.com/CrazyOrr/gradle-mvn-artifacts/master/gradle-mvn-artifacts.gradle'

// before publishing configurations
publishing {
    publications {
        // ...
    }
}

Note: You must apply this script after android and dependencies configurations, before publishing configuration, so that this script can create sourcesJar and javadocJar 2 tasks for you to reference in publishing configuration.

3. Use added tasks

publishing {
    publications {
        myPub(MavenPublication) {
            artifact sourcesJar
            artifact javadocJar
        }
    }
}

Or

./gradlew sourcesJar javadocJar

Credits

About

Helper to config Gradle Artifacts for publishing to Maven repositories

License:Apache License 2.0