1+ plugins {
2+ id ' com.android.library'
3+ }
4+
5+ android {
6+ compileSdkVersion 29
7+ buildToolsVersion " 29.0.3"
8+
9+ defaultConfig {
10+ minSdkVersion 19
11+ targetSdkVersion 29
12+
13+ testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
14+ consumerProguardFiles " consumer-rules.pro"
15+ }
16+
17+ buildTypes {
18+ release {
19+ minifyEnabled false
20+ proguardFiles getDefaultProguardFile(' proguard-android-optimize.txt' ), ' proguard-rules.pro'
21+ }
22+ }
23+
24+ tasks. withType(Javadoc ) {
25+ failOnError false
26+ options. addStringOption(' Xdoclint:none' , ' -quiet' )
27+ options. addStringOption(' encoding' , ' UTF-8' )
28+ options. addStringOption(' charSet' , ' UTF-8' )
29+ }
30+
31+ compileOptions {
32+ sourceCompatibility JavaVersion . VERSION_1_8
33+ targetCompatibility JavaVersion . VERSION_1_8
34+ }
35+ }
36+
37+ android. libraryVariants. all { variant ->
38+ def javadoc = task(" generate${ variant.name} Javadoc" , type : Javadoc ) {
39+ description " Generates Javadoc for $variant . name . "
40+ def compileTask = variant. hasProperty(' javaCompileProvider' )? variant. javaCompileProvider. get() : variant. javaCompile
41+ source = compileTask. source
42+ ext. androidJar = " ${ android.sdkDirectory} /platforms/${ android.compileSdkVersion} /android.jar"
43+ options. links(" http://docs.oracle.com/javase/8/docs/api/" );
44+ options. links(" http://d.android.com/reference/" );
45+ exclude ' **/BuildConfig.java'
46+ exclude ' **/R.java'
47+ failOnError false
48+ }
49+ def name = variant. buildType. name
50+ def task = project. tasks. create " jar${ name.capitalize()} " , Jar
51+ def compileTask = variant. hasProperty(' javaCompileProvider' )? variant. javaCompileProvider. get() : variant. javaCompile
52+ task. dependsOn compileTask
53+ task. dependsOn javadoc
54+ task. from compileTask. destinationDir
55+ task. exclude ' **/BuildConfig.class'
56+ task. exclude ' **/R.class'
57+ task. exclude ' **/R$*.class'
58+ artifacts. add(' archives' , task)
59+ }
60+
61+ dependencies {
62+ implementation project(' :realtime-android' )
63+ implementation project(' :storage-android' )
64+
65+ implementation(" cn.leancloud:realtime-core:${ rootProject.ext.sdkVersion} " )
66+
67+ implementation ' com.hihonor.mcs:push:7.0.39.303'
68+
69+ testImplementation ' junit:junit:4.13.2'
70+ androidTestImplementation ' androidx.test.ext:junit:1.1.5'
71+ androidTestImplementation ' androidx.test.espresso:espresso-core:3.5.1'
72+ }
73+
74+ apply from : ' ../maven_push.gradle'
0 commit comments