Helper to config Gradle Artifacts for publishing to Maven repositories.
Supports:
- Java
- Android (working with Android Gradle plugin)
- Android with Kotlin (javadoc generated by dokka)
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.
publishing {
publications {
myPub(MavenPublication) {
artifact sourcesJar
artifact javadocJar
}
}
}
Or
./gradlew sourcesJar javadocJar