File tree Expand file tree Collapse file tree 4 files changed +27
-5
lines changed
src/jvmMain/resources/META-INF/proguard Expand file tree Collapse file tree 4 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,16 @@ and this project orients towards [Semantic Versioning](http://semver.org/spec/v2
77Note: This project needs KSP to work and every new Ktorfit with an update of the KSP version is technically a breaking change.
88But there is no intent to bump the Ktorfit major version for every KSP update.
99
10+
11+ # [ Unreleased] ( )
12+
13+ Unreleased - 2025-xx-xx
14+ ========================================
15+
16+ ## Added
17+ - Bundle proguard rules for Android
18+
19+
1020# [ 2.4.1] ( )
1121
12222.4.1 - 2025-03-14
Original file line number Diff line number Diff line change 1- proguard-rules.pro
2- ```
3- -keep class de.jensklingenberg.ktorfit.** { *; }
4- -keepclassmembers class de.jensklingenberg.ktorfit.** { *; }
5- ```
1+ If you use Ktorfit as a dependency in an Android project which uses R8 as a default compiler you don’t have to
2+ do anything. The specific rules are
3+ [ already bundled] ( ../../ktorfit-lib-core/src/jvmMain/resources/META-INF/proguard/ktorfit.pro ) into the JAR
4+ which can be interpreted by R8 automatically.
Original file line number Diff line number Diff line change @@ -173,6 +173,17 @@ android {
173173 defaultConfig {
174174 minSdk = 21
175175 targetSdk = 34
176+
177+ val proguardFile =
178+ file(" src/jvmMain/resources/META-INF/proguard/ktorfit.pro" ).also {
179+ if (! it.exists()) {
180+ throw NoSuchFileException (
181+ file = it,
182+ reason = " We have to provide a proguard rules file for the library." ,
183+ )
184+ }
185+ }
186+ consumerProguardFiles(proguardFile)
176187 }
177188 namespace = " de.jensklingenberg.ktorfit.common"
178189}
Original file line number Diff line number Diff line change 1+ -keep class de.jensklingenberg.ktorfit.** { *; }
2+ -keepclassmembers class de.jensklingenberg.ktorfit.** { *; }
You can’t perform that action at this time.
0 commit comments