fdroid: Add build.gradle_fdroid (WAR)
Need to copy build.gradle_fdroid to overwrite build.gradle before building.
This commit is contained in:
parent
5ce24cab64
commit
3d486cab9f
|
@ -0,0 +1,108 @@
|
|||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withReader('UTF-8') { reader ->
|
||||
localProperties.load(reader)
|
||||
}
|
||||
}
|
||||
|
||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||
if (flutterRoot == null) {
|
||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
def keystoreProperties = new Properties()
|
||||
def keystorePropertiesFile = rootProject.file('key.properties')
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||
} else {
|
||||
if (System.getenv('KEY_STORE_PASSWORD')) {
|
||||
keystoreProperties.setProperty('storePassword', System.getenv('KEY_STORE_PASSWORD'));
|
||||
keystoreProperties.setProperty('keyPassword', System.getenv('KEY_PASSWORD'));
|
||||
keystoreProperties.setProperty('keyAlias', System.getenv('ALIAS'));
|
||||
keystoreProperties.setProperty('storeFile', System.getenv('KEY_PATH'));
|
||||
} else {
|
||||
//throw new GradleException("key.properties not found. Copy key.properties.example to key.properties and modify it to suit your needs.")
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
|
||||
lintOptions {
|
||||
disable 'InvalidPackage'
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.calcitem.sanmill"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 30
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
ndk{
|
||||
ldLibs "log"
|
||||
debugSymbolLevel 'FULL'
|
||||
}
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
//arguments "-DANDROID_ARM_MODE=arm", "-DANDROID_STL=c++_shared"
|
||||
//abiFilters "arm64-v8a"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
keyAlias keystoreProperties['keyAlias']
|
||||
keyPassword keystoreProperties['keyPassword']
|
||||
storeFile file(keystoreProperties['storeFile'])
|
||||
storePassword keystoreProperties['storePassword']
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
debug {
|
||||
signingConfig signingConfigs.debug
|
||||
//applicationIdSuffix ".debug"
|
||||
//debuggable true
|
||||
}
|
||||
release {
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
}
|
||||
|
||||
flavorDimensions "deploy"
|
||||
|
||||
productFlavors {
|
||||
fdroid {
|
||||
dimension "deploy"
|
||||
signingConfig null
|
||||
}
|
||||
}
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
path "CMakeLists.txt"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source '../..'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.iqiyi.xcrash:xcrash-android-lib:3.0.0'
|
||||
}
|
Loading…
Reference in New Issue