-
Notifications
You must be signed in to change notification settings - Fork 38
/
build.gradle
118 lines (100 loc) · 4.69 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
apply from: '../config/android/application.gradle'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
def property = { key ->
return System.getenv(key) ?: (project.hasProperty(key) ? project."$key" : null)
}
defaultConfig {
versionCode 1
versionName project.version
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
// Set signing config only if the keystore file exists
def keystoreFile = file('release-keystore.jks')
if (keystoreFile.exists()) {
signingConfigs {
release {
keyAlias "$System.env.MINIAPP_RELEASE_KEY_ALIAS"
keyPassword "$System.env.MINIAPP_RELEASE_KEY_PASSWORD"
storeFile keystoreFile
storePassword "$System.env.MINIAPP_KEYSTORE_PASSWORD"
}
}
buildTypes.release {
signingConfig signingConfigs.release
}
}
def appName = "Mini App Sample"
def stagingManifestPlaceholders = [
baseUrl : property("MINIAPP_SERVER_BASE_URL") ?: "https://www.example.com/",
isTestMode : property("IS_TEST_MODE") ?: false,
hostAppUserAgentInfo : property("HOST_APP_UA_INFO") ?: "MiniApp Demo App/$project.version",
hostAppVersion : property("HOST_APP_VERSION") ?: "test-host-app-version",
appId : property("HOST_APP_ID") ?: "test-host-app-id",
subscriptionKey : property("HOST_APP_SUBSCRIPTION_KEY") ?: "test-subs-key"
]
def prodManifestPlaceholders = [
baseUrl : property("MINIAPP_PROD_SERVER_BASE_URL") ?: "https://www.example.com/",
isTestMode : property("PROD_IS_TEST_MODE") ?: false,
hostAppUserAgentInfo : property("HOST_APP_PROD_UA_INFO") ?: "MiniApp Demo App/$project.version",
hostAppVersion : property("HOST_APP_PROD_VERSION") ?: "test-host-app-version",
appId : property("HOST_APP_PROD_ID") ?: "test-host-app-id",
subscriptionKey : property("HOST_APP_PROD_SUBSCRIPTION_KEY") ?: "test-subs-key"
]
def buildVersion = System.getenv("CIRCLE_BUILD_NUM") ?: new Date().format('yyMMddHHmm')
buildTypes {
debug {
applicationIdSuffix '.debug'
versionNameSuffix '-DEBUG'
resValue "string", "app_name", "$appName DEBUG"
resValue "string", "build_version", buildVersion
resValue "string", "miniapp_sdk_version", project.version
debuggable true
minifyEnabled false
manifestPlaceholders = stagingManifestPlaceholders
}
release {
resValue "string", "app_name", appName
resValue "string", "build_version", buildVersion
resValue "string", "miniapp_sdk_version", project.version
debuggable true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
manifestPlaceholders = prodManifestPlaceholders
}
staging {
initWith release
applicationIdSuffix '.staging'
versionNameSuffix "-STG-build-$buildVersion"
resValue "string", "app_name", "$appName STG"
matchingFallbacks = ['release', 'debug']
manifestPlaceholders = stagingManifestPlaceholders
}
}
dataBinding {
enabled = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compileOnly "javax.annotation:jsr250-api:$jsr250"
implementation project(':miniapp')
implementation "androidx.appcompat:appcompat:$androidx_appcompat"
implementation "androidx.constraintlayout:constraintlayout:$androidx_constraintLayout"
implementation "androidx.core:core-ktx:$androidx_coreKtx"
implementation "androidx.lifecycle:lifecycle-extensions:$androidx_lifecycle"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$androidx_lifecycle"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "com.google.code.gson:gson:$gson"
implementation "com.github.bumptech.glide:glide:$glide"
annotationProcessor "com.github.bumptech.glide:compiler:$glide"
implementation "com.google.android.material:material:$material"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:$swipe_refresh_layout"
implementation "androidx.recyclerview:recyclerview:$recyclerview"
testImplementation "junit:junit:$junit"
}