diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 32fd465..05e8f7d 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,7 +1,7 @@ plugins { id("com.android.application") id("kotlin-android") - id(Plugins.dictgen) + id(Plugins.proguardDictionaries) } android { diff --git a/build.gradle.kts b/build.gradle.kts index 5276b6e..dd8fd94 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,7 @@ buildscript { dependencies { classpath(BuildScriptPlugins.kotlin) classpath(BuildScriptPlugins.android) - classpath(BuildScriptPlugins.dictgen) + classpath(BuildScriptPlugins.proguardDictionaries) } } @@ -34,7 +34,7 @@ subprojects { minSdkVersion(21) targetSdkVersion(28) versionCode = 1 - versionName = Versions.projectVersion + versionName = Versions.projectVer } buildTypes { diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index dba52f4..e0551c2 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -1,21 +1,27 @@ +import Versions.androidXVer +import Versions.gradlePluginVer +import Versions.kotlinVer +import Versions.projectVer + object Versions { - const val kotlin = "1.3.11" - const val androidX = "1.0.0" - const val gradlePlugin = "3.3.0" - const val projectVersion = "1.0.0" + const val kotlinVer = "1.3.11" + const val projectVer = "1.0.0" + const val androidXVer = "1.0.0" + const val gradlePluginVer = "3.3.0" } object BuildScriptPlugins { - const val dictgen = "ru.cleverpumpkin.dictgen:plugin:${Versions.projectVersion}" - const val android = "com.android.tools.build:gradle:${Versions.gradlePlugin}" - const val kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}" + const val android = "com.android.tools.build:gradle:$gradlePluginVer" + const val kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVer" + const val proguardDictionaries = + "ru.cleverpumpkin.proguard-dictionaries-generator:plugin:$projectVer" } object Plugins { - const val dictgen = "ru.cleverpumpkin.dictgen" + const val proguardDictionaries = "ru.cleverpumpkin.proguard-dictionaries-generator" } object Libraries { - const val kotlin = "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}" - const val androidX = "androidx.appcompat:appcompat:${Versions.androidX}" + const val androidX = "androidx.appcompat:appcompat:$androidXVer" + const val kotlin = "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVer" } \ No newline at end of file diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index bcad742..857ae89 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -15,9 +15,10 @@ dependencies { implementation(BuildScriptPlugins.android) } -group = Plugins.dictgen +group = Plugins.proguardDictionaries // Upload archive to rootProject/plugin/badgeRepo folder to test plugin locale. +// Use "uploadArchives" task. tasks.named("uploadArchives") { repositories.withGroovyBuilder { "mavenDeployer" { @@ -28,22 +29,21 @@ tasks.named("uploadArchives") { // Add info for publication to plugin portal. pluginBundle { - // TODO - vcsUrl = "TODO" - website = "TODO" + vcsUrl = "https://github.com/CleverPumpkin/Proguard-Dictionaries-Generator" + website = "https://github.com/CleverPumpkin/Proguard-Dictionaries-Generator" description = "This is an Android gradle plugin that allows you to generate " + - "dictionary files for proguard" + "randomized dictionaries for proguard" tags = listOf("android", "proguard", "generator", "dictionary", "obfuscation", "minification") } // Create plugin itself. gradlePlugin { plugins { - create("dictgenPlugin") { - id = Plugins.dictgen - version = Versions.projectVersion - displayName = "Proguard Dictionaries Generator " - implementationClass = "ru.cleverpumpkin.dictgen.ProguardDictionaryGeneratorPlugin" + create("plugin") { + version = Versions.projectVer + id = Plugins.proguardDictionaries + displayName = "Proguard Dictionaries Generator Plugin" + implementationClass = "ru.cleverpumpkin.plugin.ProguardDictionaryGeneratorPlugin" } } } diff --git a/plugin/src/main/java/ru/cleverpumpkin/dictgen/ProguardDictionaryGeneratorPlugin.kt b/plugin/src/main/java/ru/cleverpumpkin/plugin/ProguardDictionaryGeneratorPlugin.kt similarity index 98% rename from plugin/src/main/java/ru/cleverpumpkin/dictgen/ProguardDictionaryGeneratorPlugin.kt rename to plugin/src/main/java/ru/cleverpumpkin/plugin/ProguardDictionaryGeneratorPlugin.kt index 1698dee..354806e 100644 --- a/plugin/src/main/java/ru/cleverpumpkin/dictgen/ProguardDictionaryGeneratorPlugin.kt +++ b/plugin/src/main/java/ru/cleverpumpkin/plugin/ProguardDictionaryGeneratorPlugin.kt @@ -1,4 +1,4 @@ -package ru.cleverpumpkin.dictgen +package ru.cleverpumpkin.plugin import org.gradle.api.Plugin import org.gradle.api.Project diff --git a/plugin/src/main/java/ru/cleverpumpkin/dictgen/ProguardDictionaryGeneratorTask.kt b/plugin/src/main/java/ru/cleverpumpkin/plugin/ProguardDictionaryGeneratorTask.kt similarity index 98% rename from plugin/src/main/java/ru/cleverpumpkin/dictgen/ProguardDictionaryGeneratorTask.kt rename to plugin/src/main/java/ru/cleverpumpkin/plugin/ProguardDictionaryGeneratorTask.kt index 02ed59b..edd8c8a 100644 --- a/plugin/src/main/java/ru/cleverpumpkin/dictgen/ProguardDictionaryGeneratorTask.kt +++ b/plugin/src/main/java/ru/cleverpumpkin/plugin/ProguardDictionaryGeneratorTask.kt @@ -1,4 +1,4 @@ -package ru.cleverpumpkin.dictgen +package ru.cleverpumpkin.plugin import org.gradle.api.DefaultTask import org.gradle.api.tasks.TaskAction diff --git a/plugin/src/main/java/ru/cleverpumpkin/dictgen/ProguardDictionaryPluginExtension.kt b/plugin/src/main/java/ru/cleverpumpkin/plugin/ProguardDictionaryPluginExtension.kt similarity index 61% rename from plugin/src/main/java/ru/cleverpumpkin/dictgen/ProguardDictionaryPluginExtension.kt rename to plugin/src/main/java/ru/cleverpumpkin/plugin/ProguardDictionaryPluginExtension.kt index f1be8aa..217477d 100644 --- a/plugin/src/main/java/ru/cleverpumpkin/dictgen/ProguardDictionaryPluginExtension.kt +++ b/plugin/src/main/java/ru/cleverpumpkin/plugin/ProguardDictionaryPluginExtension.kt @@ -1,4 +1,4 @@ -package ru.cleverpumpkin.dictgen +package ru.cleverpumpkin.plugin /** * @author Sergey Chuprin @@ -14,8 +14,11 @@ open class ProguardDictionaryPluginExtension { } var dictionaryNames = listOf() - 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 } \ No newline at end of file