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

304 lines
9.3 KiB

3 years ago
/*
* This file is part of FYReader.
* FYReader is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FYReader is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with FYReader. If not, see <https://www.gnu.org/licenses/>.
*
* Copyright (C) 2020 - 2022 fengyuecanzhu
*/
3 years ago
apply plugin: 'com.android.application'
apply plugin: 'org.greenrobot.greendao'
4 years ago
apply plugin: 'kotlin-android'
4 years ago
3 years ago
import com.android.build.OutputFile
4 years ago
def releaseTime() {
return new Date().format("yy.MMddHH", TimeZone.getTimeZone("GMT+08:00"))
}
def commitId = 'git rev-parse --short HEAD'.execute().text.trim()
def getVersionC() {
4 years ago
def versionCodeFile = file('version_code.properties')
if (versionCodeFile.canRead()) {
Properties properties = new Properties()
properties.load(new FileInputStream(versionCodeFile))
3 years ago
return properties['VERSION_CODE'].toInteger()
4 years ago
} else {
3 years ago
return 200
4 years ago
}
}
4 years ago
def name = "风月读书"
def versionC = getVersionC()
3 years ago
def versionN = versionC.toString()
versionN = versionN[0] + "." + versionN[1] + "." + versionN[2]
3 years ago
// 读取keystore.properties
def keyProps = new Properties()
def keyPropsFile = rootProject.file('keystore/keystore.properties')
if (keyPropsFile.exists()) {
keyProps.load(new FileInputStream(keyPropsFile))
}
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
versionCode versionC
versionName versionN
4 years ago
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
3 years ago
signingConfigs {
myConifg {
keyAlias keyProps['keyAlias']
keyPassword keyProps['keyPassword']
storeFile keyProps['storeFile'] ? file(keyProps['storeFile']) : null
storePassword keyProps['storePassword']
3 years ago
v1SigningEnabled true
v2SigningEnabled true
3 years ago
}
}
buildFeatures {
viewBinding true
}
2 years ago
/*splits {
3 years ago
abi {
reset()
enable true
universalApk true // If true, also generate a universal APK
include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}
2 years ago
}*/
3 years ago
4 years ago
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
3 years ago
if (keyPropsFile.exists()) {
3 years ago
signingConfig signingConfigs.myConifg
3 years ago
}
2 years ago
ndk {
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}
4 years ago
}
debug {
3 years ago
minifyEnabled false
4 years ago
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
3 years ago
if (keyPropsFile.exists()) {
3 years ago
signingConfig signingConfigs.myConifg
3 years ago
}
applicationIdSuffix ".debug"
versionNameSuffix "-" + commitId
2 years ago
ndk {
abiFilters "arm64-v8a"
}
4 years ago
}
android.applicationVariants.all { variant ->
2 years ago
def buildType = variant.buildType.name
def fileName = "${name}v${defaultConfig.versionName}.apk"
if (buildType == "debug"){
fileName = "${name}v${defaultConfig.versionName}-${commitId}.apk"
}
2 years ago
variant.outputs.all {
2 years ago
outputFileName = fileName
2 years ago
}
/*variant.outputs.each { output ->
3 years ago
def abi = output.getFilter(OutputFile.ABI)
if (abi == null) {
abi = "universal"
}
def fileName = "${name}v${defaultConfig.versionName}-${abi}.apk"
output.outputFileName = fileName
2 years ago
}*/
4 years ago
}
}
sourceSets.main {
jni.srcDirs = []
jniLibs.srcDir "libs/"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
4 years ago
productFlavors {
}
4 years ago
packagingOptions {
// pickFirsts:当出现重复文件,会使用第一个匹配的文件打包进入apk
pickFirst 'lib/*/libRSSupport.so'
pickFirst 'lib/*/librsjni.so'
}
4 years ago
}
repositories {
flatDir {
dirs 'libs'
}
}
4 years ago
dependencies {
implementation fileTree(dir: 'libs', include: ['*.aar'])
3 years ago
implementation fileTree(dir: 'libs', include: ['*.jar'])
4 years ago
implementation project(path: ':DialogX')
3 years ago
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
3 years ago
// androidx
3 years ago
implementation "androidx.core:core-ktx:$kotlin_version"
3 years ago
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
3 years ago
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
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.13.1'
4 years ago
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
4 years ago
implementation 'com.google.code.gson:gson:2.9.0'
4 years ago
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
3 years ago
implementation 'org.jsoup:jsoup:1.14.3'
implementation 'cn.wanghaomiao:JsoupXpath:2.5.1'
implementation 'com.jayway.jsonpath:json-path:2.7.0'
4 years ago
//SmartRefreshLayout
4 years ago
implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.2'
implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.2'
3 years ago
implementation 'com.google.android.material:material:1.4.0'
4 years ago
//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.7.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'
implementation 'com.liulishuo.filedownloader:library:1.7.7'
//SwipeBackLayout
implementation 'me.imid.swipebacklayout.lib:library:1.1.0'
4 years ago
//JS
//noinspection GradleDependency
3 years ago
implementation 'com.github.gedoor:rhino-android:1.6'
4 years ago
//XXPermissions
implementation 'com.github.getActivity:XXPermissions:11.2'
//epub
implementation('com.positiondev.epublib:epublib-core:3.1') {
exclude group: 'org.slf4j'
exclude group: 'xmlpull'
}
implementation 'com.nshmura:recyclertablayout:1.5.0'
3 years ago
// https://mvnrepository.com/artifact/net.lingala.zip4j/zip4j
implementation group: 'net.lingala.zip4j', name: 'zip4j', version: '2.9.1'
//协程
def coroutines_version = '1.5.1'
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version")
//apache
implementation('org.apache.commons:commons-text:1.9')
3 years ago
//DDSDK
implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-exo:0.8.8'
implementation 'com.lzy.net:okgo:3.0.4'
implementation 'com.pangle.cn:ads-sdk-pro:4.2.5.2'
implementation('com.facebook.fresco:fresco:0.12.0') {
exclude module: 'support-v4'
exclude group: 'com.android.support'
}
implementation('com.facebook.fresco:animated-gif:0.12.0') {
exclude module: 'support-v4'
exclude group: 'com.android.support'
}
implementation('com.facebook.fresco:animated-webp:0.12.0') {
exclude module: 'support-v4'
exclude group: 'com.android.support'
}
implementation('com.facebook.fresco:webpsupport:0.12.0') {
exclude module: 'support-v4'
exclude group: 'com.android.support'
}
3 years ago
3 years ago
//https://github.com/fengyuecanzhu/Maple
implementation("me.fycz.maple:maple:1.9")
4 years ago
}
greendao {
schemaVersion 35
4 years ago
daoPackage 'xyz.fycz.myreader.greendao.gen'
// targetGenDir 'src/main/java'
}