Skip to content

Commit

Permalink
build: activate shrink and minify in app
Browse files Browse the repository at this point in the history
  • Loading branch information
Balcan committed Nov 27, 2024
1 parent 5c87b66 commit 5a26c89
Show file tree
Hide file tree
Showing 28 changed files with 59 additions and 172 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pipeline {
steps {
script {
echo 'Building UI APKs'
sh './gradlew :app:assembleDhisUITestingDebug :app:assembleDhisUITestingDebugAndroidTest :compose-table:assembleAndroidTest :form:assembleAndroidTest'
sh './gradlew :app:assembleDhisDebug :app:assembleDebugAndroidTest :compose-table:assembleAndroidTest :form:assembleAndroidTest'
}
}
}
Expand Down
10 changes: 2 additions & 8 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ android {
buildConfigField("String", "GIT_SHA", "\"" + getCommitHash() + "\"")
}
getByName("release") {
isMinifyEnabled = false
isShrinkResources = true
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android.txt"),
"proguard-rules.pro"
Expand All @@ -170,13 +171,6 @@ android {
versionCode = libs.versions.vCode.get().toInt()
versionName = libs.versions.vName.get()
}

create("dhisUITesting") {
applicationId = "com.dhis2"
dimension = "default"
versionCode = libs.versions.vCode.get().toInt()
versionName = libs.versions.vName.get()
}
}

compileOptions {
Expand Down
58 changes: 56 additions & 2 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,62 @@

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-renamesourcefileattribute SourceFile

-dontwarn autovalue.shaded.com.google$.errorprone.annotations.$CanIgnoreReturnValue
-dontwarn autovalue.shaded.com.google$.errorprone.annotations.concurrent.$LazyInit
-dontwarn com.android.org.conscrypt.SSLParametersImpl
-dontwarn java.lang.management.ManagementFactory
-dontwarn javax.lang.model.SourceVersion
-dontwarn javax.lang.model.element.Element
-dontwarn javax.lang.model.element.Modifier
-dontwarn javax.lang.model.type.TypeMirror
-dontwarn javax.lang.model.type.TypeVisitor
-dontwarn javax.lang.model.util.SimpleTypeVisitor7
-dontwarn javax.management.InstanceAlreadyExistsException
-dontwarn javax.management.MBeanServer
-dontwarn javax.management.ObjectInstance
-dontwarn javax.management.ObjectName
-dontwarn javax.naming.Context
-dontwarn javax.naming.InitialContext
-dontwarn javax.naming.NameNotFoundException
-dontwarn javax.naming.NoInitialContextException
-dontwarn org.apache.harmony.xnet.provider.jsse.SSLParametersImpl
-dontwarn org.bouncycastle.jsse.BCSSLParameters
-dontwarn org.bouncycastle.jsse.BCSSLSocket
-dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider
-dontwarn org.dhis2.tracker.NavigationBarUIState
-dontwarn org.dhis2.tracker.TEIDashboardItems
-dontwarn org.dhis2.tracker.data.ProfilePictureProvider
-dontwarn org.dhis2.tracker.events.CreateEventUseCase
-dontwarn org.dhis2.tracker.events.CreateEventUseCaseRepository
-dontwarn org.dhis2.tracker.relationships.data.EventRelationshipsRepository
-dontwarn org.dhis2.tracker.relationships.data.RelationshipsRepository
-dontwarn org.dhis2.tracker.relationships.data.TrackerRelationshipsRepository
-dontwarn org.dhis2.tracker.relationships.domain.DeleteRelationships
-dontwarn org.dhis2.tracker.relationships.domain.GetRelationshipsByType
-dontwarn org.dhis2.tracker.relationships.model.ListSelectionState
-dontwarn org.dhis2.tracker.relationships.model.RelationshipDirection
-dontwarn org.dhis2.tracker.relationships.model.RelationshipItem
-dontwarn org.dhis2.tracker.relationships.model.RelationshipModel
-dontwarn org.dhis2.tracker.relationships.model.RelationshipOwnerType
-dontwarn org.dhis2.tracker.relationships.model.RelationshipSection
-dontwarn org.dhis2.tracker.relationships.model.RelationshipTopBarIconState$List
-dontwarn org.dhis2.tracker.relationships.model.RelationshipTopBarIconState$Map
-dontwarn org.dhis2.tracker.relationships.model.RelationshipTopBarIconState$Selecting
-dontwarn org.dhis2.tracker.relationships.model.RelationshipTopBarIconState
-dontwarn org.dhis2.tracker.relationships.ui.RelationshipsScreenKt
-dontwarn org.dhis2.tracker.relationships.ui.RelationshipsUiState$Success
-dontwarn org.dhis2.tracker.relationships.ui.RelationshipsUiState
-dontwarn org.dhis2.tracker.relationships.ui.RelationshipsViewModel
-dontwarn org.dhis2.tracker.ui.AvatarProvider
-dontwarn org.joda.convert.FromString
-dontwarn org.joda.convert.ToString
-dontwarn org.openjsse.javax.net.ssl.SSLParameters
-dontwarn org.openjsse.javax.net.ssl.SSLSocket
-dontwarn org.openjsse.net.ssl.OpenJSSE
-dontwarn org.slf4j.impl.StaticLoggerBinder
File renamed without changes.
File renamed without changes.
File renamed without changes.
49 changes: 0 additions & 49 deletions app/src/dhisUITesting/java/org/dhis2/bindings/ContextExtensions.kt

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 5a26c89

Please sign in to comment.