Skip to content

Commit

Permalink
[#513] Apply some more new configration from Gradle 8
Browse files Browse the repository at this point in the history
  • Loading branch information
luongvo committed Aug 31, 2023
1 parent cf0814e commit 0892122
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 11 deletions.
14 changes: 10 additions & 4 deletions template-compose/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
}

buildTypes {
getByName(BuildTypes.RELEASE) {
release {
isMinifyEnabled = true
isDebuggable = false
isShrinkResources = true
Expand All @@ -56,7 +56,7 @@ android {
buildConfigField("String", "BASE_API_URL", "\"https://jsonplaceholder.typicode.com/\"")
}

getByName(BuildTypes.DEBUG) {
debug {
// For quickly testing build with proguard, enable this
isMinifyEnabled = false
signingConfig = signingConfigs[BuildTypes.DEBUG]
Expand Down Expand Up @@ -86,12 +86,18 @@ android {
jvmTarget = JavaVersion.VERSION_17.toString()
}

buildFeatures {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = Versions.COMPOSE_COMPILER
}

buildFeatures {
compose = true
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}

lint {
Expand Down
11 changes: 8 additions & 3 deletions template-compose/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="co.nimblehq.template.compose">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".MainApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
tools:targetApi="31">

<activity android:name="co.nimblehq.template.compose.ui.screens.MainActivity" android:exported="true">
<activity
android:name=".ui.screens.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
13 changes: 13 additions & 0 deletions template-compose/app/src/main/res/xml/backup_rules.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See https://developer.android.com/guide/topics/data/autobackup
for details.
Note: This file is ignored for devices older that API 31
See https://developer.android.com/about/versions/12/backup-restore
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="device.xml"/>
-->
</full-backup-content>
19 changes: 19 additions & 0 deletions template-compose/app/src/main/res/xml/data_extraction_rules.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample data extraction rules file; uncomment and customize as necessary.
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>
5 changes: 2 additions & 3 deletions template-compose/data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,19 @@ android {

defaultConfig {
minSdk = Versions.ANDROID_MIN_SDK
targetSdk = Versions.ANDROID_TARGET_SDK

consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
getByName(BuildTypes.RELEASE) {
release {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
)
}

getByName(BuildTypes.DEBUG) {
debug {
isMinifyEnabled = false
}
}
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion template-compose/data/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="co.nimblehq.template.compose.data" />
<manifest />

0 comments on commit 0892122

Please sign in to comment.