@@ -25,7 +25,7 @@ android {
25
25
minSdk = 23
26
26
targetSdk = 35
27
27
versionCode = 2
28
- versionName = exec(" git describe --tags --long --always" )
28
+ versionName = exec(" git describe --tags --long --always" , " 1.1.0 " )
29
29
setProperty(" archivesBaseName" , " $applicationId -$versionName " )
30
30
}
31
31
buildTypes {
@@ -36,7 +36,7 @@ android {
36
36
getDefaultProguardFile(" proguard-android-optimize.txt" ),
37
37
" proguard-rules.pro"
38
38
)
39
- signingConfig = createSigningConfigFromEnv(signingConfigs )
39
+ signingConfig = signingConfigs. createSigningConfigFromEnv()
40
40
}
41
41
debug {
42
42
applicationIdSuffix = " .debug"
@@ -67,11 +67,11 @@ android {
67
67
generateLocaleConfig = true
68
68
}
69
69
compileOptions {
70
- sourceCompatibility = JavaVersion .VERSION_1_8
71
- targetCompatibility = JavaVersion .VERSION_1_8
70
+ sourceCompatibility = JavaVersion .VERSION_11
71
+ targetCompatibility = JavaVersion .VERSION_11
72
72
}
73
73
kotlinOptions {
74
- jvmTarget = JavaVersion .VERSION_1_8 .toString()
74
+ jvmTarget = JavaVersion .VERSION_11 .toString()
75
75
}
76
76
buildFeatures {
77
77
buildConfig = true
@@ -101,17 +101,17 @@ tasks.withType<CompileArtProfileTask> { enabled = false }
101
101
dependencies {
102
102
implementation(" net.swiftzer.semver:semver:2.0.0" )
103
103
implementation(" com.squareup.okhttp3:okhttp:5.0.0-alpha.14" )
104
- implementation(" androidx.core:core-ktx:1.13.1 " )
105
- implementation(" androidx.activity:activity-compose:1.9.2 " )
106
- implementation(platform(" androidx.compose:compose-bom:2024.09.01 " ))
104
+ implementation(" androidx.core:core-ktx:1.15.0 " )
105
+ implementation(" androidx.activity:activity-compose:1.9.3 " )
106
+ implementation(platform(" androidx.compose:compose-bom:2024.11.00 " ))
107
107
implementation(" androidx.compose.material:material" )
108
108
implementation(" androidx.compose.material:material-icons-extended" )
109
109
implementation(" androidx.compose.ui:ui" )
110
110
implementation(" androidx.compose.ui:ui-tooling-preview" )
111
111
debugImplementation(" androidx.compose.ui:ui-tooling" )
112
- implementation(" androidx.constraintlayout:constraintlayout-compose:1.0.1 " )
113
- implementation(" androidx.navigation:navigation-compose:2.8.0 " )
114
- val lifecycleVersion = " 2.8.5 "
112
+ implementation(" androidx.constraintlayout:constraintlayout-compose:1.1.0 " )
113
+ implementation(" androidx.navigation:navigation-compose:2.8.4 " )
114
+ val lifecycleVersion = " 2.8.7 "
115
115
implementation(" androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion " )
116
116
implementation(" androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycleVersion " )
117
117
}
@@ -125,19 +125,22 @@ configurations {
125
125
}
126
126
}
127
127
128
- fun exec (cmd : String ): String = ByteArrayOutputStream ().use {
129
- project.exec {
130
- commandLine = cmd.split(" " )
131
- standardOutput = it
128
+ fun exec (cmd : String , defaultValue : String = ""): String {
129
+ val stdout = ByteArrayOutputStream ()
130
+ val result = stdout.use {
131
+ project.exec {
132
+ commandLine = cmd.split(" " )
133
+ standardOutput = stdout
134
+ }
132
135
}
133
- it. toString().trim()
136
+ return if (result.exitValue == 0 ) stdout. toString().trim() else defaultValue
134
137
}
135
138
136
139
fun env (name : String ): String? = System .getenv(name)
137
140
138
141
private var signKeyTempFile: File ? = null
139
142
140
- fun createSigningConfigFromEnv ( signingConfigs : NamedDomainObjectContainer <SigningConfig >): SigningConfig ? {
143
+ fun NamedDomainObjectContainer<SigningConfig>. createSigningConfigFromEnv ( ): SigningConfig ? {
141
144
var signKeyFile: File ? = null
142
145
env(" SIGN_KEY_FILE" )?.let {
143
146
val file = File (it)
@@ -164,7 +167,7 @@ fun createSigningConfigFromEnv(signingConfigs: NamedDomainObjectContainer<Signin
164
167
}
165
168
}
166
169
signKeyFile ? : return null
167
- return signingConfigs. create(" release" ) {
170
+ return create(" release" ) {
168
171
storeFile = signKeyFile
169
172
storePassword = env(" SIGN_KEY_PWD" )
170
173
keyAlias = env(" SIGN_KEY_ALIAS" )
0 commit comments