forked from TonyJiangWJ/Auto.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
246 lines (229 loc) · 8.89 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
import java.text.SimpleDateFormat
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.jakewharton.butterknife'
def AAVersion = '4.8.0'
def SupportLibVersion = '28.0.0'
def homePath = System.properties['user.home']
def storePasswd = System.getenv('autojspasswd')
def keyPasswd = System.getenv('autojspasswd')
def alias = System.getenv('autojsalias')
def buglyAppId = System.getenv("bugly_app_id")
def flurryAppId = System.getenv("flurry_app_id")
def signSupport = false
android {
signingConfigs {
if (file(homePath + '/auto-js-t-pkcs12.jks').exists()) {
signSupport = true
release {
storeFile file(homePath + '/auto-js-t-pkcs12.jks')
storePassword storePasswd
keyPassword keyPasswd
keyAlias = alias
}
}
debug {
storeFile file('debug/autojs-pkcs12-debug.jks')
storePassword 'fixture'
keyPassword 'fixture'
keyAlias = 'autojs-debug'
}
}
compileSdkVersion versions.compile
buildToolsVersion versions.buildTool
defaultConfig {
applicationId "org.autojs.autojs"
minSdkVersion versions.mini
targetSdkVersion versions.target
versionCode versions.appVersionCode
versionName versions.appVersionName
buildConfigField "String", "BUGLY_APP_ID", "\"${buglyAppId ?: ''}\""
buildConfigField "String", "FLURRY_APP_ID", "\"${flurryAppId ?: ''}\""
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
javaCompileOptions {
annotationProcessorOptions {
arguments = [
"resourcePackageName": android.defaultConfig.applicationId
]
}
}
ndk { }
}
buildTypes {
debug {
shrinkResources false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
applicationIdSuffix ".debug"
}
release {
// debuggable true
shrinkResources false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
applicationIdSuffix ".modify"
}
if (signSupport) {
println('sign support')
release.signingConfig = signingConfigs.release
} else {
println('sign is not support')
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
encoding = 'utf-8'
}
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'
}
splits {
// Configures multiple APKs based on ABI.
abi {
// Enables building multiple APKs per ABI.
enable true
// By default all ABIs are included, so use reset() and include to specify that we only
// want APKs for x86 and x86_64.
// Resets the list of ABIs that Gradle should create APKs for to none.
reset()
// Specifies a list of ABIs that Gradle should create APKs for.
include "x86", "x86_64", "armeabi-v7a", "arm64-v8a"
// include "x86", "armeabi-v7a"
// Specifies that we do not want to also generate a universal APK that includes all ABIs.
universalApk false
}
}
lint {
abortOnError false
disable 'MissingTranslation', 'ExtraTranslation'
}
}
def copyRelease(abi) {
copy {
def fromFile = file('./build/outputs/apk/release')
def intoFile = file('../common/release')
println 'copy release apk ' + abi + ' from ' + fromFile + ' into ' + intoFile
from fromFile
into intoFile
def fileName = 'app-' + abi + '-release.apk'
include fileName
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd")
def currentDate = sdf.format(new Date())
rename fileName, versions.patchName + '.' + abi + '.' + currentDate + '.apk'
}
}
task copyReleaseApk {
doLast {
copyRelease('armeabi-v7a')
copyRelease('arm64-v8a')
}
}
tasks.whenTaskAdded { task ->
if (task.name == 'assembleRelease') {
task.finalizedBy 'copyReleaseApk'
}
}
repositories {
google()
}
dependencies {
// implementation fileTree(dir: 'libs', include: ['*.jar'])
// TensorFlow-lite
// implementation 'org.tensorflow:tensorflow-lite:0.0.0-nightly'
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1-alpha01', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testImplementation "junit:junit:$junit_version"
// Kotlin
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1"
// Android Annotations
kapt "org.androidannotations:androidannotations:$AAVersion"
implementation "org.androidannotations:androidannotations-api:$AAVersion"
// ButterKnife
implementation('com.jakewharton:butterknife:10.2.3', {
exclude group: 'com.android.support'
})
kapt 'com.jakewharton:butterknife-compiler:10.2.3'
// Android supports
implementation "androidx.appcompat:appcompat:$appcompat_version"
implementation "androidx.appcompat:appcompat-resources:$appcompat_version"
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.activity:activity-ktx:1.4.0'
// old version support
implementation "com.android.support:appcompat-v7:${SupportLibVersion}"
implementation "com.android.support:support-v4:${SupportLibVersion}"
// Personal libraries
implementation 'com.github.hyb1996:MutableTheme:1.0.0'
// Material Dialogs
implementation('com.afollestad.material-dialogs:core:0.9.2.3', {
exclude group: 'com.android.support'
})
// Common Markdown
implementation 'com.github.atlassian:commonmark-java:commonmark-parent-0.9.0'
// Android issue reporter (a github issue reporter)
implementation('com.heinrichreimersoftware:android-issue-reporter:1.3.1', {
exclude group: 'com.afollestad.material-dialogs'
exclude group: 'com.android.support'
})
//MultiLevelListView
implementation 'com.github.hyb1996:android-multi-level-listview:1.1'
//Licenses Dialog
implementation 'de.psdev.licensesdialog:licensesdialog:1.8.1'
//Expandable RecyclerView
implementation 'com.bignerdranch.android:expandablerecyclerview:3.0.0-RC1'
//FlexibleDivider
implementation 'com.yqritc:recyclerview-flexibledivider:1.4.0'
//???
implementation 'com.wang.avi:library:2.1.3'
//Commons-lang
implementation 'org.apache.commons:commons-lang3:3.12.0'
//Expandable RecyclerView
implementation 'com.thoughtbot:expandablerecyclerview:1.3'
// RxJava
implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2'
//Glide
implementation('com.github.bumptech.glide:glide:4.12.0', {
exclude group: 'com.android.support'
})
kapt 'com.github.bumptech.glide:compiler:4.15.1'
//joda time
implementation 'joda-time:joda-time:2.12.5'
// Tasker Plugin
implementation 'com.twofortyfouram:android-plugin-client-sdk-for-locale:4.0.3'
// Flurry
implementation 'com.flurry.android:analytics:14.4.0@aar'
// Bugly
implementation 'com.tencent.bugly:crashreport:4.0.4'
// 4.+ 合并了 不需要手动引入
// implementation 'com.tencent.bugly:nativecrashreport:3.9.2'
// MaterialDialogCommon
implementation('com.afollestad.material-dialogs:commons:0.9.6.0', {
exclude group: 'com.android.support'
})
// WorkManager
implementation 'androidx.work:work-runtime:2.8.1'
// Android job
implementation 'com.evernote:android-job:1.4.2'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.12'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'
// Optional, if you use support library fragments:
debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.3'
implementation project(':automator')
implementation project(':common')
implementation project(':autojs')
implementation project(':apkbuilder')
implementation project(':autojs-aar:apksigner')
}