1- apply plugin : ' com.android.library'
1+ def plugins = rootProject. ext. plugins
2+ def cfg = rootProject. ext. android
3+ def libs = rootProject. ext. dependencies
4+
5+ apply plugin : plugins. library
26
37android {
4- compileSdkVersion 25
8+ compileSdkVersion cfg . compileSdkVersion
59
610 defaultConfig {
7- minSdkVersion 15
8- targetSdkVersion 25
9- versionCode 1
10- versionName " 1.0 "
11+ minSdkVersion cfg . minSdkVersion
12+ targetSdkVersion cfg . targetSdkVersion
13+ versionCode cfg . versionCode
14+ versionName cfg . versionName
1115
1216 testInstrumentationRunner " android.support.test.runner.AndroidJUnitRunner"
1317
@@ -25,75 +29,12 @@ android {
2529dependencies {
2630 implementation fileTree(dir : ' libs' , include : [' *.jar' ])
2731
28- implementation ' com.android.support:appcompat-v7:25.0.0'
2932 testImplementation ' junit:junit:4.12'
3033 androidTestImplementation ' com.android.support.test:runner:1.0.2'
3134 androidTestImplementation ' com.android.support.test.espresso:espresso-core:3.0.2'
32- implementation ' io.reactivex.rxjava2:rxjava:2.2.3'
33- implementation ' io.reactivex.rxjava2:rxandroid:2.1.0'
34- }
35-
36- /* ********************上传jCenter依赖*********************/
37- apply plugin : ' com.novoda.bintray-release'
38-
39- buildscript {
40- repositories {
41- jcenter()
42- }
43- dependencies {
44- classpath ' com.android.tools.build:gradle:2.3.3'
45- classpath ' com.novoda:bintray-release:0.8.0'
46- // NOTE: Do not place your application dependencies here; they belong
47- // in the individual module build.gradle files
48- }
49- }
50-
51- /* *避免中文注释:编码GBK的不可映射字符**/
52- tasks. withType(Javadoc ) {
53- options {
54- encoding " UTF-8"
55- charSet ' UTF-8'
56- links " http://docs.oracle.com/javase/7/docs/api"
57- }
35+ implementation libs[" appcompat-v7" ]
36+ implementation libs[" rxjava2" ]
37+ implementation libs[" rxandroid2" ]
5838}
5939
60- /* *避免Javadocs错误:找不到引用**/
61- tasks. withType(Javadoc ) {
62- options. addStringOption(' Xdoclint:none' , ' -quiet' )
63- options. addStringOption(' encoding' , ' UTF-8' )
64- }
65-
66- /* *发布到我的Bintray仓库**/
67- def user = getPropertyValue(' bintrayUser' )
68- def key = getPropertyValue(' bintrayKey' )
69- def org = getPropertyValue(' userOrg' )
70-
71- publish {
72- bintrayUser = user
73- bintrayKey = key
74- dryRun = false
75- userOrg = org
76- groupId = ' com.excellence'
77- artifactId = ' exec'
78- publishVersion = ' 1.1.1'
79- desc = ' android命令执行'
80- website = ' https://github.com/VeiZhang/AndroidExec'
81- licences = [' Apache-2.0' ]
82- }
83-
84- /* *读取bintray.key文件的key**/
85- def getPropertyValue (String key ) {
86- if (key == null || key. length() == 0 )
87- return null
88-
89- File file = project. rootProject. file(' ../../bintray.key' )
90- if (! file. exists())
91- return null
92-
93- InputStream inputStream = file. newDataInputStream()
94- Properties properties = new Properties ()
95- properties. load(inputStream)
96-
97- // 读取Key
98- return properties. getProperty(key)
99- }
40+ apply from : ' bintray.gradle'
0 commit comments