99 * You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
1010 */
1111
12+ import java.util.Properties
13+
1214plugins {
1315 alias(libs.plugins.android.application)
1416 alias(libs.plugins.kotlin.android)
@@ -32,13 +34,35 @@ android {
3234 compose = true
3335 }
3436
37+ signingConfigs {
38+ create(" release" ) {
39+ val props = Properties ().apply {
40+ val propsFile = File (" signing.properties" )
41+ if (propsFile.exists()) {
42+ load(propsFile.reader())
43+ }
44+ }
45+ storeFile = props.getProperty(" storeFilePath" )?.let { File (it) }
46+ storePassword = props.getProperty(" storePassword" )
47+ keyPassword = props.getProperty(" keyPassword" )
48+ keyAlias = props.getProperty(" keyAlias" )
49+ }
50+ }
51+
3552 buildTypes {
3653 release {
3754 isMinifyEnabled = true
3855 proguardFiles(
3956 getDefaultProguardFile(" proguard-android-optimize.txt" ),
4057 " proguard-rules.pro"
4158 )
59+ val signing = signingConfigs.findByName(" release" )
60+ if (signing != null && signing.storeFile != null && signing.storePassword != null && signing.keyPassword != null && signing.keyAlias != null ) {
61+ signingConfig = signing
62+ } else {
63+ println (" Release signing config not available, falling back to debug config" )
64+ signingConfig = signingConfigs.getByName(" debug" )
65+ }
4266 }
4367 }
4468 compileOptions {
@@ -64,4 +88,4 @@ dependencies {
6488 implementation(libs.androidx.wear.compose.material)
6589 implementation(libs.androidx.wear.tooling.preview)
6690 implementation(project(" :wearapi" ))
67- }
91+ }
0 commit comments