Skip to content

Commit

Permalink
Update README and plugin version
Browse files Browse the repository at this point in the history
  • Loading branch information
creati8e committed Feb 6, 2020
1 parent 07f990e commit d78b46f
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 10 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript {
}
dependencies {
classpath "gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.7"
classpath "gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.8"
}
}
```
Expand All @@ -31,7 +31,7 @@ buildscript {
}
}
dependencies {
classpath("gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.7")
classpath("gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.8")
}
}
```
Expand Down Expand Up @@ -151,7 +151,18 @@ You don't have to specify anything special to get it work.
Whitespaces, punctuation characters, duplicate words, and comments after a `#` sign are ignored
in dictionaries by Proguard. So generated file could contains any symbols except listed above.
https://www.guardsquare.com/en/products/proguard/manual/usage#obfuscationoptions
<https://www.guardsquare.com/en/products/proguard/manual/usage#obfuscationoptions>
### Contribution
You need to test plugin locally, right?
To build plugin locally `uploadArchives` gradle task is used that puts plugin into
`PROJECT_DIR/plugin/pluginRepo` folder.
Plugin should be added to project's buildscript.
First time after cloning the project there's no locally built plugin so plugin should be downloaded from Gradle Plugin portal thus artifactId is
`gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin`
After project sync upload plugin locally and set artifactId to `ru.cleverpumpkin.proguard-dictionaries-generator:plugin`.
You can find artifactId [here](https://github.com/CleverPumpkin/Proguard-Dictionaries-Generator/blob/master/buildSrc/src/main/kotlin/Dependencies.kt#L45)
## Authors
Developed by Sergey Chuprin (<gregamer@gmail.com>)<br/>
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/kotlin/ru/cleverpumpkin/dictgen/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import android.app.Activity
import android.os.Bundle
import android.util.Log

/**
* Created by Sergey Chuprin on 16/01/2019.
*/
class MainActivity : Activity() {

override fun onCreate(savedInstanceState: Bundle?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.content.Context
import androidx.core.content.ContextCompat

/**
* @author Sergey Chuprin
* Created by Sergey Chuprin on 16/01/2019.
*/
class ResourceManager(
private val context: Context
Expand Down
16 changes: 14 additions & 2 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import LibrariesVersions.KOTLIN_VERSION
import PluginVersions.SAMPLE
import PluginVersions.UPLOAD

/**
* Created by Sergey Chuprin on 11/09/2019.
*/
object LibrariesVersions {
const val KOTLIN_VERSION = "1.3.61"
const val ANDROID_X_VERSION = "1.0.0"
Expand All @@ -16,19 +19,28 @@ 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.7"
const val UPLOAD = "1.0.8"

/**
* 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.7"
const val SAMPLE = "1.0.8"
}

object BuildScriptPlugins {
const val android = "com.android.tools.build:gradle:$GRADLE_PLUGIN_VERSION"
const val kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"

/**
* When cloning project there's no locally built plugin so
* 'gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin' is used to
* download plugin from gradle plugin portal.
*
* After building plugin locally with 'uploadArchives' task use
* 'ru.cleverpumpkin.proguard-dictionaries-generator:plugin' for testing plugin.
*/
const val dictionariesGenerator =
"gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:$SAMPLE"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class ProguardR8DictionaryGeneratorPlugin : Plugin<Project> {
private companion object {
const val LOG_TAG = "ProguardR8DictionaryGenerator"
val TARGET_TASKS_REGEX = listOf(
Regex("minify(.*?)With(?:R8|Proguard)"),
Regex("transformClassesAndResourcesWith(?:R8|Proguard)For")
Regex("minify(.*?)With(?:R8|Proguard)"),
Regex("transformClassesAndResourcesWith(?:R8|Proguard)For")
)
}

Expand Down Expand Up @@ -66,8 +66,8 @@ class ProguardR8DictionaryGeneratorPlugin : Plugin<Project> {

private fun Project.findObfuscationTasks(): List<Task> {
return TARGET_TASKS_REGEX.flatMap { taskNameRegex ->
tasks.filter {
task -> taskNameRegex.matches(task.name)
tasks.filter { task ->
taskNameRegex.matches(task.name)
}
}
}
Expand Down

0 comments on commit d78b46f

Please sign in to comment.