diff --git a/README.md b/README.md index 0f006e4..45e92ff 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Gradle Plugin that generates randomized dictionaries for proguard -**Tested on Android Gradle Plugin version 3.4.1.** +**Tested on Android Gradle Plugin version 3.5.0 and 3.6.0-alpha10** ## How to add Add to your **root project's** `build.gradle`: @@ -17,7 +17,7 @@ buildscript { } dependencies { - classpath "gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.6" + classpath "gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.7" } } ``` @@ -31,7 +31,7 @@ buildscript { } } dependencies { - classpath("gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.6") + classpath("gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.7") } } ``` diff --git a/build.gradle.kts b/build.gradle.kts index 7e0e3cb..2879565 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,8 +5,8 @@ buildscript { jcenter() google() mavenCentral() + gradlePluginPortal() maven(uri("plugin/pluginRepo")) - maven("https://plugins.gradle.org/m2/") } dependencies { classpath(BuildScriptPlugins.kotlin) diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 64461c5..f9285c4 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -6,9 +6,9 @@ import PluginVersions.SAMPLE import PluginVersions.UPLOAD object LibrariesVersions { - const val KOTLIN_VERSION = "1.3.11" + const val KOTLIN_VERSION = "1.3.50" const val ANDROID_X_VERSION = "1.0.0" - const val GRADLE_PLUGIN_VERSION = "3.4.1" + const val GRADLE_PLUGIN_VERSION = "3.5.0" } object PluginVersions { @@ -16,21 +16,21 @@ object PluginVersions { * The constant used to specify the version of a plugin which will be uploaded to * the Gradle Plugin portal when "publishPlugins" task runs. */ - const val UPLOAD = "1.0.6" + const val UPLOAD = "1.0.7" /** * The constant used to specify the version of a plugin which is applied to the Sample app. * Usually it equals [UPLOAD] constant and differs only when a new plugin version is about * to be uploaded. */ - const val SAMPLE = "1.0.6" + const val SAMPLE = "1.0.7" } object BuildScriptPlugins { const val android = "com.android.tools.build:gradle:$GRADLE_PLUGIN_VERSION" const val kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION" const val dictionariesGenerator = - "gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:$SAMPLE" + "ru.cleverpumpkin.proguard-dictionaries-generator:plugin:$SAMPLE" } object Plugins { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 74939a6..4834427 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.3-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip \ No newline at end of file diff --git a/plugin/src/main/java/ru/cleverpumpkin/plugin/ProguardR8DictionaryGeneratorPlugin.kt b/plugin/src/main/java/ru/cleverpumpkin/plugin/ProguardR8DictionaryGeneratorPlugin.kt index 02db998..593a235 100644 --- a/plugin/src/main/java/ru/cleverpumpkin/plugin/ProguardR8DictionaryGeneratorPlugin.kt +++ b/plugin/src/main/java/ru/cleverpumpkin/plugin/ProguardR8DictionaryGeneratorPlugin.kt @@ -12,8 +12,11 @@ class ProguardR8DictionaryGeneratorPlugin : Plugin { private companion object { const val LOG_TAG = "ProguardR8DictionaryGenerator" - const val TARGET_R8_TASK = "transformClassesAndResourcesWithR8For" - const val TARGET_PROGUARD_TASK = "transformClassesAndResourcesWithProguardFor" + val TARGET_TASKS = listOf( + "minifyReleaseWithR8", + "transformClassesAndResourcesWithR8For", + "transformClassesAndResourcesWithProguardFor" + ) } override fun apply(project: Project) { @@ -63,8 +66,9 @@ class ProguardR8DictionaryGeneratorPlugin : Plugin { } private fun Project.findObfuscationTasks(): List { - return tasks.filter { task -> task.name.startsWith(TARGET_R8_TASK) } + - tasks.filter { task -> task.name.startsWith(TARGET_PROGUARD_TASK) } + return TARGET_TASKS.flatMap { taskName -> + tasks.filter { task -> task.name.startsWith(taskName) } + } } private fun Project.findPluginExtension(): ProguardR8DictionaryPluginExtension {