File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -9,14 +9,27 @@ if (hasGoogleServicesJson) {
9
9
apply (plugin = " com.google.firebase.crashlytics" )
10
10
}
11
11
12
+ fun getPropertyOrEnv (propertyName : String , envName : String = propertyName): String? {
13
+ return if (project.hasProperty(propertyName)) {
14
+ project.property(propertyName) as String
15
+ } else {
16
+ System .getenv(envName)
17
+ }
18
+ }
19
+
12
20
android {
13
21
signingConfigs {
14
22
create(" release" ) {
15
- if (project.hasProperty(" NETBIRD_UPLOAD_STORE_FILE" )) {
16
- storeFile = file(project.property(" NETBIRD_UPLOAD_STORE_FILE" ) as String )
17
- storePassword = project.property(" NETBIRD_UPLOAD_STORE_PASSWORD" ) as String
18
- keyAlias = project.property(" NETBIRD_UPLOAD_KEY_ALIAS" ) as String
19
- keyPassword = project.property(" NETBIRD_UPLOAD_KEY_PASSWORD" ) as String
23
+ val storeFile = getPropertyOrEnv(" NETBIRD_UPLOAD_STORE_FILE" )
24
+ val storePassword = getPropertyOrEnv(" NETBIRD_UPLOAD_STORE_PASSWORD" )
25
+ val keyAlias = getPropertyOrEnv(" NETBIRD_UPLOAD_KEY_ALIAS" )
26
+ val keyPassword = getPropertyOrEnv(" NETBIRD_UPLOAD_KEY_PASSWORD" )
27
+
28
+ if (storeFile != null ) {
29
+ this .storeFile = file(storeFile)
30
+ this .storePassword = storePassword
31
+ this .keyAlias = keyAlias
32
+ this .keyPassword = keyPassword
20
33
}
21
34
}
22
35
}
You can’t perform that action at this time.
0 commit comments