1
1
import com.google.firebase.appdistribution.gradle.AppDistributionExtension
2
- import java.io.FileInputStream
3
2
import org.apache.commons.io.output.ByteArrayOutputStream
4
3
import org.jetbrains.kotlin.konan.properties.Properties
4
+ import java.io.FileInputStream
5
5
6
6
@Suppress(" dsl_scope_violation" )
7
7
@@ -69,7 +69,7 @@ android {
69
69
70
70
signingConfigs {
71
71
val keystoreProperties = Properties ()
72
- val keystorePropertiesFile: File = rootProject.file(" config/keystore.properties" )
72
+ val keystorePropertiesFile = rootProject.file(" config/keystore.properties" )
73
73
if (keystorePropertiesFile.exists()) {
74
74
keystoreProperties.load(FileInputStream (keystorePropertiesFile))
75
75
} else {
@@ -78,10 +78,11 @@ android {
78
78
keystoreProperties[" storePassword" ] = System .getenv(" KEYSTORE_STORE_PASSWORD" ).orEmpty()
79
79
keystoreProperties[" storeFile" ] = System .getenv(" KEYSTORE_FILE" ).orEmpty()
80
80
}
81
- create(" release" ) { // todo Uncomment to create a signed release
81
+ val keystoreFile = keystoreProperties[" storeFile" ] as String
82
+ create(" release" ) {
82
83
keyAlias = keystoreProperties[" keyAlias" ] as String
83
84
keyPassword = keystoreProperties[" keyPassword" ] as String
84
- storeFile = file(keystoreProperties[ " storeFile " ] as String )
85
+ storeFile = if (keystoreFile.isNotEmpty()) file(keystoreFile) else null
85
86
storePassword = keystoreProperties[" storePassword" ] as String
86
87
}
87
88
}
@@ -90,13 +91,12 @@ android {
90
91
release {
91
92
isMinifyEnabled = true
92
93
isShrinkResources = true
93
- signingConfig = signingConfigs.getByName(" release" ) // todo Uncomment to create a signed release
94
+ signingConfig = signingConfigs.getByName(" release" )
94
95
applicationIdSuffix = MoviesBuildType .RELEASE .applicationIdSuffix
95
96
manifestPlaceholders + = mapOf (" appName" to " @string/app_name" )
96
97
proguardFiles(
97
98
getDefaultProguardFile(" proguard-android-optimize.txt" ),
98
99
" proguard-rules.pro" ,
99
- " retrofit2.pro" ,
100
100
" okhttp3.pro" ,
101
101
" coroutines.pro"
102
102
)
@@ -108,7 +108,6 @@ android {
108
108
applicationIdSuffix = MoviesBuildType .DEBUG .applicationIdSuffix
109
109
manifestPlaceholders + = mapOf (" appName" to " @string/app_name_dev" )
110
110
isDefault = true
111
- // vcsInfo { include = true } // Version control system integration in App Quality Insights
112
111
}
113
112
create(" benchmark" ) {
114
113
initWith(getByName(" release" ))
0 commit comments