mirror of
https://github.com/TonyJiangWJ/Auto.js.git
synced 2026-06-21 21:01:43 +08:00
93 lines
2.6 KiB
Groovy
93 lines
2.6 KiB
Groovy
apply plugin: 'com.android.application'
|
|
|
|
android {
|
|
compileSdkVersion versions.compile
|
|
buildToolsVersion versions.buildTool
|
|
|
|
defaultConfig {
|
|
applicationId "com.stardust.auojs.inrt"
|
|
minSdkVersion versions.mini
|
|
targetSdkVersion versions.target
|
|
versionCode versions.appVersionCode - 200
|
|
versionName versions.appVersionName
|
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
|
ndk {
|
|
abiFilters 'armeabi-v7a'
|
|
}
|
|
|
|
}
|
|
lintOptions {
|
|
disable 'MissingTranslation'
|
|
disable 'ExtraTranslation'
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
buildTypes {
|
|
debug {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
}
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
task buildApkPlugin {
|
|
doLast {
|
|
def pluginProjectDirPath = '..\\..\\AutoJsApkBuilderPlugin'
|
|
def pluginProjectDir = file(pluginProjectDirPath)
|
|
if(!pluginProjectDir.exists() || !pluginProjectDir.isDirectory()){
|
|
println 'pluginProjectDir not exists'
|
|
return
|
|
}
|
|
copy {
|
|
from file('build\\outputs\\apk\\release\\')
|
|
into new File(pluginProjectDir, 'app\\src\\main\\assets')
|
|
include "inrt-release-unsigned.apk"
|
|
rename "inrt-release-unsigned.apk", 'template.apk'
|
|
}
|
|
exec {
|
|
workingDir pluginProjectDir
|
|
commandLine 'gradlew.bat', 'assembleRelease'
|
|
}
|
|
copy {
|
|
from new File(pluginProjectDir, 'app\\build\\outputs\\apk\\release')
|
|
into file('..\\common\\release')
|
|
include '*-release.apk'
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.whenTaskAdded { task ->
|
|
if (task.name == 'assembleRelease') {
|
|
task.finalizedBy 'buildApkPlugin'
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
flatDir {
|
|
dirs 'libs'
|
|
}
|
|
google()
|
|
}
|
|
|
|
dependencies {
|
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
|
|
exclude group: 'com.android.support', module: 'support-annotations'
|
|
})
|
|
//Glide
|
|
implementation('com.github.bumptech.glide:glide:4.2.0', {
|
|
exclude group: 'com.android.support'
|
|
})
|
|
testImplementation 'junit:junit:4.12'
|
|
implementation project(':automator')
|
|
implementation project(':common')
|
|
implementation project(':autojs')
|
|
}
|