Created
August 26, 2015 11:34
-
-
Save damonliuchn/76fc85265e8bf138d70b to your computer and use it in GitHub Desktop.
publish aar to maven by gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.library' | |
apply plugin: 'maven' | |
uploadArchives { | |
repositories { | |
mavenDeployer { | |
//repository(url: "file:///Users/liumeng/Documents/Backup/maven") | |
repository(url: "http://localhost:8081/nexus/content/repositories/snapshots") { | |
authentication(userName: "admin", password: "admin") | |
} | |
pom.version = "1.3.6" | |
pom.artifactId = "android" | |
pom.groupId = "com.example" | |
} | |
} | |
} | |
task sourcesJar(type: Jar) { | |
classifier = 'sources' | |
from android.sourceSets.main.java.srcDirs | |
} | |
task onlyClassJar(type: Jar) { | |
from "${project.buildDir}/intermediates/classes/release/" | |
} | |
task androidJavadocs(type: Javadoc) { | |
source = android.sourceSets.main.java.srcDirs | |
} | |
task javadocJars(type: Jar, dependsOn: androidJavadocs) { | |
classifier = 'javadoc' | |
from androidJavadocs.destinationDir | |
} | |
artifacts { | |
archives onlyClassJar | |
archives sourcesJar | |
archives javadocJar | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment