-
Notifications
You must be signed in to change notification settings - Fork 264
Enable R8 for release build #596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+193
−41
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
23b13c8
Set a keystore to release build
jmatsu 5098667
Added some proguard rules
jmatsu d1acedb
Remove suffix id only for production build
jmatsu 5dd2f0c
Fixed build.gradle
61f45c6
Enabled proguard surely
jmatsu f842f0f
Keep names of those which navigation component touchs
jmatsu 19d83d3
Removed unused code
jmatsu 717fcbf
Addressed ktlint
jmatsu 0d061f8
Run release lint on CI
jmatsu c46c513
Fixed applicationIdSuffix and reduce memory allocation
jmatsu 8e4eeb7
Enable logcat tree for non-production release build
jmatsu 6bfbe6c
Remove the custom logger on production
jmatsu 8cd3072
Removed unused statements
jmatsu f7e9db9
Update config.yml
jmatsu 5d66f80
Create staging build type instead
jmatsu dafae31
No-op leakcanary and enable hyperion
jmatsu f091ffe
Make staging debuggable
jmatsu e2595e9
Use new dsl
jmatsu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,3 +18,5 @@ build/ | |
|
|
||
| **/vendor/bundle/ | ||
| **/xcuserdata/ | ||
|
|
||
| proguard-merged-config.txt | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Remove LogCat Tree anyway | ||
| -assumenosideeffects class io.github.droidkaigi.confsched2019.App { | ||
| public *** enableLogCatLogging(); | ||
| } | ||
|
|
||
| # Remove Android Log's methods | ||
| -assumenosideeffects class android.util.Log { | ||
| public static *** e(...); | ||
| public static *** d(...); | ||
| public static *** i(...); | ||
| public static *** v(...); | ||
| public static *** w(...); | ||
| public static *** wtf(...); | ||
| } | ||
|
|
||
| # Remove log methods which CrashlyticsTree doesn't support | ||
| -assumenosideeffects class timber.log.Timber { | ||
| public static *** d(...); | ||
| public static *** i(...); | ||
| public static *** v(...); | ||
| public static *** w(...); | ||
| public static *** wtf(...); | ||
| } | ||
|
|
||
| # Remove our log methods which are lower than ERROR | ||
| -assumenosideeffects class io.github.droidkaigi.confsched2019.timber.Timber { | ||
| *** info(...); | ||
| *** warn(...); | ||
| *** debug(...); | ||
| *** verbose(...); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,10 @@ apply plugin: 'androidx.navigation.safeargs' | |
|
|
||
| apply from: rootProject.file('gradle/android.gradle') | ||
|
|
||
| android.buildTypes.release { | ||
| consumerProguardFiles 'proguard-rules-navigation.pro' | ||
| } | ||
|
|
||
| dependencies { | ||
| api project(":model") | ||
| api project(":feature:notification") | ||
|
|
@@ -37,9 +41,14 @@ dependencies { | |
| androidTestImplementation Dep.Test.espressoCore | ||
| } | ||
| repositories { | ||
| if (!isCi) { maven { url "https://maven-central-asia.storage-download.googleapis.com/repos/central/data/" } } | ||
| if (!isCi) { | ||
| maven { | ||
| url "https://maven-central-asia.storage-download.googleapis.com/repos/central/data/" | ||
| } | ||
| } | ||
| mavenCentral() | ||
| } | ||
|
|
||
| tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { | ||
| kotlinOptions { | ||
| freeCompilerArgs = [ | ||
|
|
@@ -48,3 +57,38 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { | |
| ] | ||
| } | ||
| } | ||
|
|
||
| task buildNavigationProguard << { | ||
| def navigationGraphXml = project.file("src/main/res/navigation/navigation.xml") | ||
|
|
||
| // XmlParser didn't work so let me use the dirty hack | ||
| if (!navigationGraphXml.text.contains("xmlns:app=\"http://schemas.android.com/apk/res-auto\"")) { | ||
| throw new GradleScriptException("the namespace has been changed from app") | ||
| } | ||
|
|
||
| def fqdns = [] | ||
|
|
||
| navigationGraphXml.eachLine { | ||
| def line = it.trim() | ||
|
|
||
| if (line.startsWith("android:name=\"")) { | ||
| def className = line.substring("android:name=\"".length(), line.lastIndexOf("\"")) | ||
|
|
||
| if (className.contains(".")) { | ||
| fqdns << className | ||
| } | ||
| } else if (line.startsWith("app:argType=\"")) { | ||
| def className = line.substring("app:argType=\"".length(), line.lastIndexOf("\"")) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 |
||
|
|
||
| if (className.contains(".")) { | ||
| fqdns << className | ||
| } | ||
| } | ||
| } | ||
|
|
||
| project.file("proguard-rules-navigation.pro").write(fqdns.sort().collect { | ||
| "-keepnames class $it" | ||
| }.join("\n")) | ||
| } | ||
|
|
||
| preBuild.dependsOn(buildNavigationProguard) | ||
17 changes: 17 additions & 0 deletions
17
frontendcomponent/androidcomponent/proguard-rules-navigation.pro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| -keepnames class com.google.android.gms.oss.licenses.OssLicensesMenuActivity | ||
| -keepnames class io.github.droidkaigi.confsched2019.about.ui.AboutFragment | ||
| -keepnames class io.github.droidkaigi.confsched2019.announcement.ui.AnnouncementFragment | ||
| -keepnames class io.github.droidkaigi.confsched2019.floormap.ui.FloorMapFragment | ||
| -keepnames class io.github.droidkaigi.confsched2019.model.SpeechSession | ||
| -keepnames class io.github.droidkaigi.confsched2019.session.ui.BottomSheetDaySessionsFragment | ||
| -keepnames class io.github.droidkaigi.confsched2019.session.ui.BottomSheetFavoriteSessionsFragment | ||
| -keepnames class io.github.droidkaigi.confsched2019.session.ui.SearchFragment | ||
| -keepnames class io.github.droidkaigi.confsched2019.session.ui.SessionDetailFragment | ||
| -keepnames class io.github.droidkaigi.confsched2019.session.ui.SessionPageFragment | ||
| -keepnames class io.github.droidkaigi.confsched2019.session.ui.SessionPagesFragment | ||
| -keepnames class io.github.droidkaigi.confsched2019.session.ui.SpeakerFragment | ||
| -keepnames class io.github.droidkaigi.confsched2019.session.ui.TabularFormSessionPagesFragment | ||
| -keepnames class io.github.droidkaigi.confsched2019.settings.ui.SettingsFragment | ||
| -keepnames class io.github.droidkaigi.confsched2019.sponsor.ui.SponsorFragment | ||
| -keepnames class io.github.droidkaigi.confsched2019.staff.ui.StaffSearchFragment | ||
| -keepnames class io.github.droidkaigi.confsched2019.survey.ui.SessionSurveyFragment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,14 +15,17 @@ android { | |
| buildTypes { | ||
| release { | ||
| minifyEnabled false | ||
| proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
| consumerProguardFiles 'proguard-rules.pro' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| } | ||
| } | ||
| lintOptions { | ||
| def lintFile = file("${project.projectDir}/lint.xml") | ||
| if (lintFile.exists()) { | ||
| lintConfig lintFile | ||
| } | ||
|
|
||
| checkReleaseBuilds !isCi | ||
| abortOnError !isCi | ||
| } | ||
| } | ||
| kotlin.sourceSets.all { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😇