Skip to content

Commit

Permalink
add pro rules to consumer-sules.pro
Browse files Browse the repository at this point in the history
  • Loading branch information
0xZhangKe committed Sep 20, 2024
1 parent 51e1e32 commit dc9024a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ object ProjectVersion {
private const val MONIR = "0"

// backwards compatible bug fixes
private const val PATH = "0"
private const val PATH = "1"
const val VERSION = "$MAJOR.$MONIR.$PATH"
}

Expand Down
8 changes: 8 additions & 0 deletions krouter-annotation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@ import com.vanniktech.maven.publish.MavenPublishBaseExtension

plugins {
id("org.jetbrains.kotlin.multiplatform")
id("com.android.library")
alias(libs.plugins.dokka)
id("com.vanniktech.maven.publish")
}

android {
namespace = "com.zhangke.krouter.annotation"
defaultConfig {
consumerProguardFiles("consumer-rules.pro")
}
}

kotlin {
applyDefaultHierarchyTemplate()
jvm()
Expand Down
6 changes: 2 additions & 4 deletions krouter-annotation/consumer-rules.pro
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Keep everything in the com.zhangke.krouter package
-keep class com.zhangke.krouter.** { *; }
-keep class com.zhangke.krouter.annotation.** { *; }

# Keep the class members (methods and fields) of the classes in the package
-keepclassmembers class com.zhangke.krouter.** { *; }
-keepclassmembers class com.zhangke.krouter.annotation.** { *; }
8 changes: 8 additions & 0 deletions krouter-runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@ import org.jetbrains.kotlin.config.LanguageFeature

plugins {
id("org.jetbrains.kotlin.multiplatform")
id("com.android.library")
id("com.vanniktech.maven.publish")
alias(libs.plugins.dokka)
}

android {
namespace = "com.zhangke.krouter"
defaultConfig {
consumerProguardFiles("consumer-rules.pro")
}
}

kotlin {
jvm()
iosX64()
Expand Down
6 changes: 4 additions & 2 deletions krouter-runtime/consumer-rules.pro
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Keep everything in the com.zhangke.krouter package
-keep class com.zhangke.krouter.generated.** { *; }

-keepclassmembers class com.zhangke.krouter.generated.** { *; }

-keep class com.zhangke.krouter.** { *; }

# Keep the class members (methods and fields) of the classes in the package
-keepclassmembers class com.zhangke.krouter.** { *; }

0 comments on commit dc9024a

Please sign in to comment.