You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
FYReader/app/build.gradle

200 lines
5.9 KiB

4 years ago
apply plugin: 'com.android.application'
apply plugin: 'org.greenrobot.greendao'//greendao插件dependencies
4 years ago
apply plugin: 'kotlin-android'
4 years ago
def releaseTime() {
return new Date().format("yy.MMddHH", TimeZone.getTimeZone("GMT+08:00"))
}
def getVersionCode() {
def versionCodeFile = file('version_code.properties')
if (versionCodeFile.canRead()) {
Properties properties = new Properties()
properties.load(new FileInputStream(versionCodeFile))
def versionCode = properties['VERSION_CODE'].toInteger()//读取version_code.properties文件存放的版本号。
def runTasks = gradle.startParameter.taskNames
def task = ':app:assembleRelease'
if (task in runTasks) {
properties['VERSION_CODE'] = (++versionCode).toString()
properties.store(versionCodeFile.newWriter(), null)
}
return versionCode
} else {
4 years ago
throw new FileNotFoundException("无法读取version_code.properties文件!")
4 years ago
}
}
def getVersionCodeNotIncrease() {
def versionCodeFile = file('version_code.properties')
if (versionCodeFile.canRead()) {
Properties properties = new Properties()
properties.load(new FileInputStream(versionCodeFile))
def versionCode = properties['VERSION_CODE'].toInteger()//读取version_code.properties文件存放的版本号。
return versionCode
} else {
throw new FileNotFoundException("无法读取version_code.properties文件!")
}
}
4 years ago
def name = "风月读书"
def version = getVersionCode()
def getVersionName(){
def version = getVersionCodeNotIncrease()
def hun = (version / 100).toInteger()
def ten = (version / 10).toInteger() % 10
def one = version % 10
return hun + "." + ten + "." + one
}
def versionN = getVersionName()
4 years ago
android {
compileSdkVersion 29
4 years ago
buildToolsVersion '29.0.3'
4 years ago
defaultConfig {
applicationId "xyz.fycz.myreader"
minSdkVersion 21
targetSdkVersion 29
4 years ago
versionCode version
versionName versionN
4 years ago
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildFeatures {
viewBinding true
}
4 years ago
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ndk {
abiFilters "x86", "armeabi", "armeabi-v7a"
}
}
debug {
ndk {
abiFilters "x86", "armeabi", "armeabi-v7a"
}
4 years ago
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
4 years ago
}
android.applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "${name}v${defaultConfig.versionName}.apk"
}
}
}
sourceSets.main {
jni.srcDirs = []
jniLibs.srcDir "libs/"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
productFlavors {
}
4 years ago
4 years ago
}
repositories {
flatDir {
dirs 'libs'
}
}
4 years ago
dependencies {
implementation fileTree(dir: 'libs', include: ['*.aar'])
4 years ago
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
4 years ago
api 'androidx.core:core-ktx:1.3.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
4 years ago
4 years ago
//anko
def anko_version = '0.10.8'
implementation "org.jetbrains.anko:anko-sdk27:$anko_version"
implementation "org.jetbrains.anko:anko-sdk27-listeners:$anko_version"
4 years ago
//Glide
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation 'com.squareup.okhttp3:okhttp:3.14.7'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.journeyapps:zxing-android-embedded:3.5.0'
implementation 'org.greenrobot:greendao:3.3.0'
implementation 'com.github.yuweiguocn:GreenDaoUpgradeHelper:v2.2.1'
4 years ago
4 years ago
//JSoup
4 years ago
implementation 'org.jsoup:jsoup:1.11.3'
4 years ago
implementation 'cn.wanghaomiao:JsoupXpath:2.4.3'
implementation 'com.jayway.jsonpath:json-path:2.5.0'
4 years ago
//SmartRefreshLayout
4 years ago
implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.2'
implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.2'
4 years ago
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.3'
implementation 'me.gujun.android.taggroup:library:1.4@aar'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'io.alterac.blurkit:blurkit:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
//Scroller
implementation 'com.futuremind.recyclerfastscroll:fastscroll:0.2.5'
//Toasty
implementation 'com.github.GrenderG:Toasty:1.5.0'
//字符串比较
implementation 'net.ricecode:string-similarity:1.0.0'
implementation 'com.jayway.jsonpath:json-path:2.4.0'
4 years ago
//RxAndroid
implementation 'io.reactivex.rxjava2:rxjava:2.2.19'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
4 years ago
//ImmersionBar
implementation 'com.gyf.immersionbar:immersionbar:3.0.0'
//简繁转换
implementation 'com.luhuiguo:chinese-utils:1.0'
//颜色选择
implementation 'com.jaredrummler:colorpicker:1.1.0'
//二维码
implementation 'cn.bingoogolapple:bga-qrcode-zxing:1.3.7'
//编码识别
implementation 'com.github.albfernandez:juniversalchardet:2.4.0'
// 标签 https://github.com/hongyangAndroid/FlowLayout
implementation 'com.hyman:flowlayout-lib:1.1.2'
4 years ago
}
greendao {
4 years ago
schemaVersion 23
4 years ago
daoPackage 'xyz.fycz.myreader.greendao.gen'
// targetGenDir 'src/main/java'
}