Skip to content

Commit

Permalink
Let user to specify directory relative to module's root, update to 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
creati8e committed Jan 23, 2019
1 parent 41e5ae0 commit ab55102
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*.iml
.gradle
/local.properties
/.idea/codeStyles
/.idea
.DS_Store
/build
/captures
Expand Down
29 changes: 0 additions & 29 deletions .idea/codeStyles/Project.xml

This file was deleted.

20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
gradlePluginPortal()
dependencies {
classpath "gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.0"
classpath "gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.1"
}
}
```
Expand All @@ -23,9 +23,9 @@ apply plugin: "ru.cleverpumpkin.proguard-dictionaries-generator"
proguardDictionaries {
dictionaryNames = [
"class-dictionary",
"package-dictionary",
"obfuscation-dictionary"
"build/class-dictionary",
"build/package-dictionary",
"build/obfuscation-dictionary"
]
}
```
Expand All @@ -35,16 +35,18 @@ plugins {
id("ru.cleverpumpkin.proguard-dictionaries-generator")
}
proguardDictionaries {
dictionaryNames = dictionaryNames = listOf(
"class-dictionary",
"package-dictionary",
"obfuscation-dictionary"
dictionaryNames = listOf(
"build/class-dictionary",
"build/package-dictionary",
"build/obfuscation-dictionary"
)
}
```
This simple setup will generate file `class-dictionary.txt`
in `build` folder of module on which plugin applied.
This file generated on each build
You can specify any directory relatively to your module's root.

These files are generated on each build
(so you'll get different dictionary on each build)

### Advanced configuration
Expand Down
6 changes: 3 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ android {

proguardDictionaries {
dictionaryNames = listOf(
"class-dictionary",
"package-dictionary",
"obfuscation-dictionary"
"build/class-dictionary",
"build/package-dictionary",
"build/obfuscation-dictionary"
)
}

Expand Down
7 changes: 1 addition & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,14 @@ subprojects {
versionName = Versions.projectVer
}

buildTypes {
maybeCreate("debug")
maybeCreate("release")
}

buildTypes {
maybeCreate("release").apply {
isDebuggable = false
isMinifyEnabled = true
signingConfig = signingConfigs.getByName("debug")

proguardFiles(
getDefaultProguardFile("proguard-android.txt"),
getDefaultProguardFile("proguard-android-optimize.txt"),
File("proguard-rules.pro")
)
}
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Versions.projectVer

object Versions {
const val kotlinVer = "1.3.11"
const val projectVer = "1.0.0"
const val projectVer = "1.0.1"
const val androidXVer = "1.0.0"
const val gradlePluginVer = "3.3.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ open class ProguardDictionaryGeneratorTask @Inject constructor(
}
}

val projectBuildDir = project.buildDir.apply { createNewFile() }
File("$projectBuildDir/$dictionaryName.txt").run {
createNewFile()
File(project.projectDir, "$dictionaryName.txt").run {
parentFile.mkdirs()
writeText(dictionarySet.joinToString("\n"))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ open class ProguardDictionaryPluginExtension {
}

var dictionaryNames = listOf<String>()
var minLineLength: Int =
DEFAULT_MIN_LINE_LENGTH
var maxLineLength: Int =
DEFAULT_MAX_LINE_LENGTH
var linesCountInDictionary: Int =
DEFAULT_LINES_COUNT
var minLineLength: Int = DEFAULT_MIN_LINE_LENGTH
var maxLineLength: Int = DEFAULT_MAX_LINE_LENGTH
var linesCountInDictionary: Int = DEFAULT_LINES_COUNT

}

0 comments on commit ab55102

Please sign in to comment.