File tree Expand file tree Collapse file tree 5 files changed +18
-14
lines changed
plugin/src/main/java/ru/cleverpumpkin/plugin Expand file tree Collapse file tree 5 files changed +18
-14
lines changed Original file line number Diff line number Diff line change 22
33Gradle Plugin that generates randomized dictionaries for proguard
44
5- ** Tested on Android Gradle Plugin version 3.4.1. **
5+ ** Tested on Android Gradle Plugin version 3.5.0 and 3.6.0-alpha10 **
66
77## How to add
88Add to your ** root project's** ` build.gradle ` :
@@ -17,7 +17,7 @@ buildscript {
1717 }
1818
1919 dependencies {
20- classpath "gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.6 "
20+ classpath "gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.7 "
2121 }
2222}
2323```
@@ -31,7 +31,7 @@ buildscript {
3131 }
3232 }
3333 dependencies {
34- classpath(" gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.6 " )
34+ classpath(" gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.7 " )
3535 }
3636}
3737```
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ buildscript {
55 jcenter()
66 google()
77 mavenCentral()
8+ gradlePluginPortal()
89 maven(uri(" plugin/pluginRepo" ))
9- maven(" https://plugins.gradle.org/m2/" )
1010 }
1111 dependencies {
1212 classpath(BuildScriptPlugins .kotlin)
Original file line number Diff line number Diff line change @@ -6,31 +6,31 @@ import PluginVersions.SAMPLE
66import PluginVersions.UPLOAD
77
88object LibrariesVersions {
9- const val KOTLIN_VERSION = " 1.3.11 "
9+ const val KOTLIN_VERSION = " 1.3.50 "
1010 const val ANDROID_X_VERSION = " 1.0.0"
11- const val GRADLE_PLUGIN_VERSION = " 3.4.1 "
11+ const val GRADLE_PLUGIN_VERSION = " 3.5.0 "
1212}
1313
1414object PluginVersions {
1515 /* *
1616 * The constant used to specify the version of a plugin which will be uploaded to
1717 * the Gradle Plugin portal when "publishPlugins" task runs.
1818 */
19- const val UPLOAD = " 1.0.6 "
19+ const val UPLOAD = " 1.0.7 "
2020
2121 /* *
2222 * The constant used to specify the version of a plugin which is applied to the Sample app.
2323 * Usually it equals [UPLOAD] constant and differs only when a new plugin version is about
2424 * to be uploaded.
2525 */
26- const val SAMPLE = " 1.0.6 "
26+ const val SAMPLE = " 1.0.7 "
2727}
2828
2929object BuildScriptPlugins {
3030 const val android = " com.android.tools.build:gradle:$GRADLE_PLUGIN_VERSION "
3131 const val kotlin = " org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION "
3232 const val dictionariesGenerator =
33- " gradle.plugin. ru.cleverpumpkin.proguard-dictionaries-generator:plugin:$SAMPLE "
33+ " ru.cleverpumpkin.proguard-dictionaries-generator:plugin:$SAMPLE "
3434}
3535
3636object Plugins {
Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33distributionPath =wrapper/dists
44zipStoreBase =GRADLE_USER_HOME
55zipStorePath =wrapper/dists
6- distributionUrl =https\://services.gradle.org/distributions/gradle-5.3 -all.zip
6+ distributionUrl =https\://services.gradle.org/distributions/gradle-5.6.2 -all.zip
Original file line number Diff line number Diff line change @@ -12,8 +12,11 @@ class ProguardR8DictionaryGeneratorPlugin : Plugin<Project> {
1212
1313 private companion object {
1414 const val LOG_TAG = " ProguardR8DictionaryGenerator"
15- const val TARGET_R8_TASK = " transformClassesAndResourcesWithR8For"
16- const val TARGET_PROGUARD_TASK = " transformClassesAndResourcesWithProguardFor"
15+ val TARGET_TASKS = listOf (
16+ " minifyReleaseWithR8" ,
17+ " transformClassesAndResourcesWithR8For" ,
18+ " transformClassesAndResourcesWithProguardFor"
19+ )
1720 }
1821
1922 override fun apply (project : Project ) {
@@ -63,8 +66,9 @@ class ProguardR8DictionaryGeneratorPlugin : Plugin<Project> {
6366 }
6467
6568 private fun Project.findObfuscationTasks (): List <Task > {
66- return tasks.filter { task -> task.name.startsWith(TARGET_R8_TASK ) } +
67- tasks.filter { task -> task.name.startsWith(TARGET_PROGUARD_TASK ) }
69+ return TARGET_TASKS .flatMap { taskName ->
70+ tasks.filter { task -> task.name.startsWith(taskName) }
71+ }
6872 }
6973
7074 private fun Project.findPluginExtension (): ProguardR8DictionaryPluginExtension {
You can’t perform that action at this time.
0 commit comments