1616 * along with this program. If not, see <https://www.gnu.org/licenses/>.
1717 */
1818
19+ import java.util.Properties
20+ import com.mikepenz.aboutlibraries.plugin.DuplicateRule
1921import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2022
2123plugins {
@@ -26,6 +28,12 @@ plugins {
2628 alias(libs.plugins.kotlin.serialization.plugin)
2729}
2830
31+ val keystorePropertiesFile: File = rootProject.file(" keystore.properties" )
32+ val keystoreProperties = Properties ()
33+ if (keystorePropertiesFile.exists()) {
34+ keystoreProperties.load(keystorePropertiesFile.inputStream())
35+ }
36+
2937android {
3038 namespace = " com.rohankhayech.choona.app"
3139
@@ -40,11 +48,23 @@ android {
4048 testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
4149 }
4250
51+ signingConfigs {
52+ create(" release" ) {
53+ if (keystoreProperties.isNotEmpty()) {
54+ keyAlias = keystoreProperties[" keyAlias" ] as String
55+ keyPassword = keystoreProperties[" keyPassword" ] as String
56+ storeFile = file(keystoreProperties[" storeFile" ] as String )
57+ storePassword = keystoreProperties[" storePassword" ] as String
58+ }
59+ }
60+ }
61+
4362 buildTypes {
4463 release {
4564 isMinifyEnabled = true
4665 isShrinkResources = true
4766 proguardFiles(getDefaultProguardFile(" proguard-android-optimize.txt" ), " proguard-rules.pro" )
67+ signingConfig = signingConfigs.getByName(" release" )
4868 }
4969 debug {
5070 applicationIdSuffix = " .dev"
@@ -141,13 +161,13 @@ aboutLibraries {
141161 }
142162
143163 export {
144- // Allows to exclude some fields from the generated meta data field.
164+ // Allows to exclude some fields from the generated metadata field.
145165 // If the class name is specified, the field is only excluded for that class; without a class name, the exclusion is global.
146166 excludeFields.addAll(" generated" , " funding" , " scm" , " website" )
147167 }
148168
149169 library {
150170 // Configure the duplication rule, to match "duplicates" with
151- duplicationRule = com.mikepenz.aboutlibraries.plugin. DuplicateRule .SIMPLE
171+ duplicationRule = DuplicateRule .SIMPLE
152172 }
153173}
0 commit comments