mirror of
https://github.com/KitsunePie/AppErrorsTracking.git
synced 2025-09-04 02:05:16 +08:00
Modify merge contents of build.gradle into constant definitions
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,7 +1,7 @@
|
|||||||
# Project exclude paths
|
# Project exclude paths
|
||||||
*.iml
|
*.iml
|
||||||
.gradle
|
.gradle
|
||||||
.secret
|
.secret/APP_CENTER_SECRET
|
||||||
/local.properties
|
/local.properties
|
||||||
/.idea/caches
|
/.idea/caches
|
||||||
/.idea/libraries
|
/.idea/libraries
|
||||||
|
6
.secret/key_store_secret.json
Normal file
6
.secret/key_store_secret.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"keyAlias": "public",
|
||||||
|
"keyPassword": "123456",
|
||||||
|
"storeFileName": "universal.p12",
|
||||||
|
"storePassword": "123456"
|
||||||
|
}
|
@@ -1,43 +1,54 @@
|
|||||||
|
import groovy.json.JsonSlurper
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.android.application'
|
id 'com.android.application'
|
||||||
id 'org.jetbrains.kotlin.android'
|
id 'org.jetbrains.kotlin.android'
|
||||||
id 'com.google.devtools.ksp' version '1.8.20-1.0.10'
|
id 'com.google.devtools.ksp'
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace 'com.fankes.apperrorstracking'
|
|
||||||
compileSdk 33
|
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
debug {
|
universal {
|
||||||
storeFile file('../keystore/public')
|
def dirPath = rootProject.ext.app.signingConfigs.secretConfigsDirPath
|
||||||
storePassword '123456'
|
def fileName = rootProject.ext.app.signingConfigs.secretConfigsFileName
|
||||||
keyAlias 'public'
|
def configs = new JsonSlurper().parse(file("${dirPath}/${fileName}"))
|
||||||
keyPassword '123456'
|
keyAlias configs.keyAlias
|
||||||
|
keyPassword configs.keyPassword
|
||||||
|
storeFile file("${dirPath}/${configs.storeFileName}")
|
||||||
|
storePassword configs.storePassword
|
||||||
v1SigningEnabled true
|
v1SigningEnabled true
|
||||||
v2SigningEnabled true
|
v2SigningEnabled true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
namespace 'com.fankes.apperrorstracking'
|
||||||
applicationId "com.fankes.apperrorstracking"
|
compileSdk rootProject.ext.android.compileSdk
|
||||||
minSdk 24
|
|
||||||
targetSdk 33
|
|
||||||
versionCode rootProject.ext.appVersionCode
|
|
||||||
versionName rootProject.ext.appVersionName
|
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
defaultConfig {
|
||||||
|
applicationId 'com.fankes.apperrorstracking'
|
||||||
|
|
||||||
|
minSdk rootProject.ext.android.minSdk
|
||||||
|
targetSdk rootProject.ext.android.targetSdk
|
||||||
|
|
||||||
|
versionCode rootProject.ext.app.versionCode
|
||||||
|
versionName rootProject.ext.app.versionName
|
||||||
|
|
||||||
|
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||||
|
|
||||||
/** 添加 App Center Secret 到 BuildConfig */
|
/** 添加 App Center Secret 到 BuildConfig */
|
||||||
buildConfigField("String", "APP_CENTER_SECRET", "\"${getAppCenterSecret()}\"")
|
buildConfigField('String', 'APP_CENTER_SECRET', "\"${getAppCenterSecret()}\"")
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
signingConfig signingConfigs.universal
|
||||||
|
}
|
||||||
release {
|
release {
|
||||||
minifyEnabled rootProject.ext.enableR8
|
minifyEnabled true
|
||||||
shrinkResources rootProject.ext.enableR8
|
shrinkResources true
|
||||||
zipAlignEnabled rootProject.ext.enableR8
|
zipAlignEnabled true
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.universal
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
18
build.gradle
18
build.gradle
@@ -2,10 +2,22 @@ plugins {
|
|||||||
id 'com.android.application' version '7.4.1' apply false
|
id 'com.android.application' version '7.4.1' apply false
|
||||||
id 'com.android.library' version '7.4.1' apply false
|
id 'com.android.library' version '7.4.1' apply false
|
||||||
id 'org.jetbrains.kotlin.android' version '1.8.20' apply false
|
id 'org.jetbrains.kotlin.android' version '1.8.20' apply false
|
||||||
|
id 'com.google.devtools.ksp' version '1.8.20-1.0.10' apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
appVersionName = "1.2"
|
android = [
|
||||||
appVersionCode = 4
|
compileSdk: 33,
|
||||||
enableR8 = true
|
minSdk : 24,
|
||||||
|
targetSdk : 33,
|
||||||
|
ndkVersion: '24.0.8215888'
|
||||||
|
]
|
||||||
|
app = [
|
||||||
|
versionName : '1.2',
|
||||||
|
versionCode : 4,
|
||||||
|
signingConfigs: [
|
||||||
|
secretConfigsDirPath : "${projectDir.getAbsolutePath()}/.secret",
|
||||||
|
secretConfigsFileName: "key_store_secret.json"
|
||||||
|
]
|
||||||
|
]
|
||||||
}
|
}
|
@@ -1,3 +1,5 @@
|
|||||||
|
import groovy.json.JsonSlurper
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.android.application'
|
id 'com.android.application'
|
||||||
id 'org.jetbrains.kotlin.android'
|
id 'org.jetbrains.kotlin.android'
|
||||||
@@ -5,39 +7,44 @@ plugins {
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
namespace 'com.fankes.apperrorsdemo'
|
namespace 'com.fankes.apperrorsdemo'
|
||||||
compileSdk 33
|
compileSdk rootProject.ext.android.compileSdk
|
||||||
ndkVersion '24.0.8215888'
|
ndkVersion rootProject.ext.android.ndkVersion
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
debug {
|
universal {
|
||||||
storeFile file('../keystore/public')
|
def dirPath = rootProject.ext.app.signingConfigs.secretConfigsDirPath
|
||||||
storePassword '123456'
|
def fileName = rootProject.ext.app.signingConfigs.secretConfigsFileName
|
||||||
keyAlias 'public'
|
def configs = new JsonSlurper().parse(file("${dirPath}/${fileName}"))
|
||||||
keyPassword '123456'
|
keyAlias configs.keyAlias
|
||||||
|
keyPassword configs.keyPassword
|
||||||
|
storeFile file("${dirPath}/${configs.storeFileName}")
|
||||||
|
storePassword configs.storePassword
|
||||||
v1SigningEnabled true
|
v1SigningEnabled true
|
||||||
v2SigningEnabled true
|
v2SigningEnabled true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdk 24
|
applicationId 'com.fankes.apperrorsdemo'
|
||||||
targetSdk 33
|
|
||||||
versionCode 1
|
|
||||||
versionName "1.0"
|
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
minSdk rootProject.ext.android.minSdk
|
||||||
consumerProguardFiles "consumer-rules.pro"
|
targetSdk rootProject.ext.android.targetSdk
|
||||||
externalNativeBuild {
|
|
||||||
cmake {
|
versionCode rootProject.ext.app.versionCode
|
||||||
cppFlags ""
|
versionName rootProject.ext.app.versionName
|
||||||
}
|
|
||||||
}
|
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||||
|
consumerProguardFiles 'consumer-rules.pro'
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
signingConfig signingConfigs.universal
|
||||||
|
}
|
||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.universal
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user