File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed
Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 22
33buildscript {
44 ext. kotlin_version = ' 1.1.2-4'
5- ext. app_version = " 1.2 .1"
5+ ext. app_version = " 1.3 .1"
66 repositories {
77 jcenter()
88 }
Original file line number Diff line number Diff line change @@ -40,3 +40,36 @@ dependencies {
4040repositories {
4141 mavenCentral()
4242}
43+
44+ // build a jar with source files
45+ task sourcesJar (type : Jar ) {
46+ from android. sourceSets. main. java. srcDirs
47+ classifier = ' sources'
48+ }
49+
50+ task javadoc (type : Javadoc ) {
51+ failOnError false
52+ source = android. sourceSets. main. java. sourceFiles
53+ classpath + = project. files(android. getBootClasspath(). join(File . pathSeparator))
54+ classpath + = configurations. compile
55+ }
56+
57+ // build a jar with javadoc
58+ task javadocJar (type : Jar , dependsOn : javadoc) {
59+ classifier = ' javadoc'
60+ from javadoc. destinationDir
61+ }
62+
63+ artifacts {
64+ archives sourcesJar
65+ archives javadocJar
66+ }
67+
68+ // uncomment to build a jar file in addition to the default aar file
69+ android. libraryVariants. all { variant ->
70+ def name = variant. buildType. name
71+ def task = project. tasks. create " jar${ name.capitalize()} " , Jar
72+ task. dependsOn variant. javaCompile
73+ task. from variant. javaCompile. destinationDir
74+ artifacts. add(' archives' , task);
75+ }
You can’t perform that action at this time.
0 commit comments