Files
2020-01-20 21:40:43 +08:00

107 lines
3.7 KiB
Groovy

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
def getVersion() {
def gitVersion
try {
def cmd = 'git rev-list HEAD --count'
gitVersion = cmd.execute().text.trim().toInteger()
} catch (Exception e) {
gitVersion = 1
}
return gitVersion
}
def gitVersion = getVersion()
def javaVersion = JavaVersion.VERSION_1_8
android {
signingConfigs {
Properties properties = new Properties()
File propFile = project.file('release.properties')
if (propFile.exists()) {
properties.load(propFile.newDataInputStream())
}
release {
keyAlias properties.getProperty("RELEASE_KEY_ALIAS")
keyPassword properties.getProperty("RELEASE_KEY_PASSWORD")
storeFile file('qmuidemo.keystore')
storePassword properties.getProperty("RELEASE_STORE_PASSWORD")
v2SigningEnabled false
}
}
compileSdkVersion parent.ext.compileSdkVersion
// for butterknife, see https://github.com/JakeWharton/butterknife/blob/master/CHANGELOG.md#version-900-rc2-2018-11-19
compileOptions {
sourceCompatibility javaVersion
targetCompatibility javaVersion
}
defaultConfig {
applicationId "com.qmuiteam.qmuidemo"
minSdkVersion parent.ext.minSdkVersion
targetSdkVersion parent.ext.targetSdkVersion
versionCode gitVersion
versionName QMUI_VERSION
}
buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
// 避免 lint 检测出错时停止构建
lintOptions {
abortOnError false
}
}
//apply plugin: 'com.qmuiteam.qmui.skinMaker'
//skinMaker{
// file rootProject.file('qmuidemo-skin-code-generator-source')
//}
// 加@aar与不加@aar的区别:
// http://stackoverflow.com/questions/30157575/why-should-i-include-a-gradle-dependency-as-aar
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "androidx.appcompat:appcompat:$appcompatVersion"
implementation "androidx.annotation:annotation:$annotationVersion"
implementation "com.google.android.material:material:$materialVersion"
implementation "com.jakewharton:butterknife:$butterknifeVersion"
kapt "com.jakewharton:butterknife-compiler:$butterknifeVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
// implementation 'com.qmuiteam:qmuilint:1.0.1'
// implementation 'com.qmuiteam:arch:0.3.1'
// implementation 'com.qmuiteam:qmui:1.2.0'
implementation project(':lib')
api project(':lint')
implementation project(':qmui')
implementation project(':arch')
kapt project(':compiler')
kapt project(':arch-compiler')
implementation project(":skin-maker")
//leak
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
testImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
//test
testImplementation 'junit:junit:4.12'
// androidTestImplementation 'com.android.support.test:runner:1.0.2'
// androidTestImplementation 'com.android.support.test:rules:1.0.2' // Set this dependency to use JUnit 4 rules
// androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' // Set this dependency to build and run Espresso tests
}