Created
September 12, 2017 00:17
-
-
Save rockaport/65f9476f8858ee983de03f4b788dc3ad to your computer and use it in GitHub Desktop.
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
task sourceJar(type: Jar) { | |
from android.sourceSets.main.java.srcDirs | |
classifier "source" | |
} | |
android.libraryVariants.all { variant -> | |
variant.outputs.all { output -> | |
println variant.name + " " + output.name | |
publishing.publications.create(variant.name, MavenPublication) { | |
artifact sourceJar | |
artifact source: output.outputFile, classifier: output.name | |
configurations.all { | |
println it.name | |
println it.allDependencies | |
} | |
} | |
} | |
} | |
tasks.all { task -> | |
if (task instanceof AbstractPublishToMaven) { | |
task.dependsOn assemble | |
} | |
} | |
//publishing { | |
// publications { | |
// aar(MavenPublication) { | |
// artifact Jar { | |
// from android.sourceSets.main.java.srcDirs | |
// classifier "source" | |
// } | |
// artifact("$buildDir/outputs/aar/library-release.aar") | |
// } | |
// } | |
// repositories { | |
// maven { | |
// // change to point to your repo, e.g. http://my.org/repo | |
// url "s3://" | |
// credentials(AwsCredentials) { | |
// accessKey "" | |
// secretKey "" | |
// } | |
// } | |
// } | |
//} | |
// | |
//task printShit { | |
// doLast { | |
// android.libraryVariants.all { variant -> | |
// variant.outputs.all { output -> | |
// println output.outputFile.absolutePath | |
//// println groovy.json.JsonOutput.toJson(out) | |
// } | |
// } | |
// } | |
//} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment