Skip to content

Commit

Permalink
split dependencies, for plugins and versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Adamczyk committed Sep 17, 2020
1 parent a81fefa commit f2cff86
Show file tree
Hide file tree
Showing 8 changed files with 184 additions and 170 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
configurations.all {
resolutionStrategy {
force("com.google.guava:guava:25.1-jre")
force(Libs.KOTLIN_REFLECT)
force(Dependencies.KOTLIN_REFLECT)
exclude(group = "com.google.guava", module = "guava-jdk5")
}
}

plugins {
kotlin(Kotlin.PLUGIN_JVM) version Versions.KOTLIN
kotlin(Plugins.Kotlin.PLUGIN_JVM) version Versions.KOTLIN
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,97 +1,4 @@
object Versions {
// https://github.com/bugsnag/bugsnag-java/releases
const val BUGSNAG = "3.6.1"

// https://github.com/3breadt/dd-plist/releases
const val DD_PLIST = "1.23"

// https://github.com/detekt/detekt
const val DETEKT = "1.11.0"

// https://github.com/bintray/gradle-bintray-plugin/releases
const val BINTRAY = "1.8.5"

// https://github.com/johnrengelman/shadow/releases
const val SHADOW = "6.0.0"

// https://github.com/linkedin/dex-test-parser/releases
const val DEX_TEST_PARSER = "2.2.1"

// match to Tools -> Kotlin -> Configure Kotlin Plugin Updates -> Update Channel: Stable
const val KOTLIN = "1.4.0"

// https://github.com/Kotlin/kotlinx.coroutines/releases
const val KOTLIN_COROUTINES = "1.3.9"

// https://github.com/remkop/picocli/releases
const val PICOCLI = "4.4.0"

// https://search.maven.org/search?q=a:google-api-services-toolresults%20g:com.google.apis
const val GOOGLE_API_TOOLRESULTS = "v1beta3-rev20200803-1.30.10"

// https://github.com/googleapis/google-auth-library-java/releases
// NOTE: https://github.com/googleapis/google-oauth-java-client is End of Life and replaced by google-auth-library-java
// https://github.com/googleapis/google-oauth-java-client/issues/251#issuecomment-504565533
const val GOOGLE_AUTH = "0.18.0"

// https://search.maven.org/search?q=a:google-cloud-nio%20g:com.google.cloud
const val GOOGLE_NIO = "0.114.0-alpha"

// https://search.maven.org/search?q=a:google-cloud-storage%20g:com.google.cloud
const val GOOGLE_STORAGE = "1.96.0"

// https://github.com/google/gson/releases
const val GSON = "2.8.6"

// https://github.com/FasterXML/jackson-core/releases
// https://github.com/FasterXML/jackson-dataformat-xml/releases
const val JACKSON = "2.11.0"

const val JUNIT = "4.13"

// https://github.com/jhy/jsoup/releases
const val JSOUP = "1.13.1"

// https://github.com/ktorio/ktor/releases
const val KTOR = "1.4.0"

// https://github.com/qos-ch/logback/releases
const val LOGBACK = "1.2.3"

// https://github.com/square/okhttp/releases
const val OKHTTP = "4.7.2"

// https://github.com/stefanbirkner/system-rules/releases
const val SYSTEM_RULES = "1.19.0"

// https://github.com/google/truth/releases
const val TRUTH = "1.0"

// https://github.com/FasterXML/woodstox/releases
const val WOODSTOX = "6.2.1"

const val KOTLIN_LOGGING = "1.8.0.1"

// https://github.com/mockk/mockk
const val MOCKK = "1.10.0"

// https://commons.apache.org/proper/commons-text/
const val COMMON_TEXT = "1.8"

// https://github.com/fusesource/jansi/releases
const val JANSI = "1.18"

// https://github.com/ben-manes/gradle-versions-plugin/releases
const val BEN_MANES = "0.28.0"


// ============== flank-scripts ==============
const val KOTLINX_SERIALIZATION = "1.0.0-RC"
const val FUEL = "2.2.3"
const val CLIKT = "2.8.0"
}

object Libs {
object Dependencies {
const val BUGSNAG = "com.bugsnag:bugsnag:${Versions.BUGSNAG}"

const val DD_PLIST = "com.googlecode.plist:dd-plist:${Versions.DD_PLIST}"
Expand Down Expand Up @@ -145,20 +52,14 @@ object Libs {
const val KOTLIN_SERIALIZATION = "org.jetbrains.kotlinx:kotlinx-serialization-core:${Versions.KOTLINX_SERIALIZATION}"

//region flank-scripts
const val PLUGIN_SHADOW_JAR = "com.github.johnrengelman.shadow"
const val CLIKT = "com.github.ajalt:clikt:${Versions.CLIKT}"
const val DETEKT_PLUGIN = "io.gitlab.arturbosch.detekt"
//endregion

object Fuel {
const val CORE = "com.github.kittinunf.fuel:fuel:${Versions.FUEL}"
const val COROUTINES = "com.github.kittinunf.fuel:fuel-coroutines:${Versions.FUEL}"
const val KOTLINX_SERIALIZATION = "com.github.kittinunf.fuel:fuel-kotlinx-serialization:${Versions.FUEL}"
}
//endregion
}

object Kotlin {
const val PLUGIN_JVM = "jvm"
const val PLUGIN_SERIALIZATION = "plugin.serialization"
}

12 changes: 12 additions & 0 deletions buildSrc/src/main/kotlin/Plugins.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
object Plugins {

const val PLUGIN_SHADOW_JAR = "com.github.johnrengelman.shadow"
const val DETEKT_PLUGIN = "io.gitlab.arturbosch.detekt"
const val JFROG_BINTRAY = "com.jfrog.bintray"
const val MAVEN_PUBLISH = "maven-publish"
const val BEN_MANES_PLUGIN = "com.github.ben-manes.versions"
object Kotlin {
const val PLUGIN_JVM = "jvm"
const val PLUGIN_SERIALIZATION = "plugin.serialization"
}
}
92 changes: 92 additions & 0 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
object Versions {
// https://github.com/bugsnag/bugsnag-java/releases
const val BUGSNAG = "3.6.1"

// https://github.com/3breadt/dd-plist/releases
const val DD_PLIST = "1.23"

// https://github.com/detekt/detekt
const val DETEKT = "1.11.0"

// https://github.com/bintray/gradle-bintray-plugin/releases
const val BINTRAY = "1.8.5"

// https://github.com/johnrengelman/shadow/releases
const val SHADOW = "6.0.0"

// https://github.com/linkedin/dex-test-parser/releases
const val DEX_TEST_PARSER = "2.2.1"

// match to Tools -> Kotlin -> Configure Kotlin Plugin Updates -> Update Channel: Stable
const val KOTLIN = "1.4.0"

// https://github.com/Kotlin/kotlinx.coroutines/releases
const val KOTLIN_COROUTINES = "1.3.9"

// https://github.com/remkop/picocli/releases
const val PICOCLI = "4.4.0"

// https://search.maven.org/search?q=a:google-api-services-toolresults%20g:com.google.apis
const val GOOGLE_API_TOOLRESULTS = "v1beta3-rev20200803-1.30.10"

// https://github.com/googleapis/google-auth-library-java/releases
// NOTE: https://github.com/googleapis/google-oauth-java-client is End of Life and replaced by google-auth-library-java
// https://github.com/googleapis/google-oauth-java-client/issues/251#issuecomment-504565533
const val GOOGLE_AUTH = "0.18.0"

// https://search.maven.org/search?q=a:google-cloud-nio%20g:com.google.cloud
const val GOOGLE_NIO = "0.114.0-alpha"

// https://search.maven.org/search?q=a:google-cloud-storage%20g:com.google.cloud
const val GOOGLE_STORAGE = "1.96.0"

// https://github.com/google/gson/releases
const val GSON = "2.8.6"

// https://github.com/FasterXML/jackson-core/releases
// https://github.com/FasterXML/jackson-dataformat-xml/releases
const val JACKSON = "2.11.0"

const val JUNIT = "4.13"

// https://github.com/jhy/jsoup/releases
const val JSOUP = "1.13.1"

// https://github.com/ktorio/ktor/releases
const val KTOR = "1.4.0"

// https://github.com/qos-ch/logback/releases
const val LOGBACK = "1.2.3"

// https://github.com/square/okhttp/releases
const val OKHTTP = "4.7.2"

// https://github.com/stefanbirkner/system-rules/releases
const val SYSTEM_RULES = "1.19.0"

// https://github.com/google/truth/releases
const val TRUTH = "1.0"

// https://github.com/FasterXML/woodstox/releases
const val WOODSTOX = "6.2.1"

const val KOTLIN_LOGGING = "1.8.0.1"

// https://github.com/mockk/mockk
const val MOCKK = "1.10.0"

// https://commons.apache.org/proper/commons-text/
const val COMMON_TEXT = "1.8"

// https://github.com/fusesource/jansi/releases
const val JANSI = "1.18"

// https://github.com/ben-manes/gradle-versions-plugin/releases
const val BEN_MANES = "0.28.0"


// ============== flank-scripts ==============
const val KOTLINX_SERIALIZATION = "1.0.0-RC"
const val FUEL = "2.2.3"
const val CLIKT = "2.8.0"
}
38 changes: 24 additions & 14 deletions flank-scripts/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
application
kotlin(Kotlin.PLUGIN_JVM)
kotlin(Kotlin.PLUGIN_SERIALIZATION) version Versions.KOTLIN
id(Libs.PLUGIN_SHADOW_JAR) version Versions.SHADOW
id(Libs.DETEKT_PLUGIN) version Versions.DETEKT
kotlin(Plugins.Kotlin.PLUGIN_JVM)
kotlin(Plugins.Kotlin.PLUGIN_SERIALIZATION) version Versions.KOTLIN
id(Plugins.PLUGIN_SHADOW_JAR) version Versions.SHADOW
id(Plugins.DETEKT_PLUGIN) version Versions.DETEKT
}

val artifactID = "flankScripts"
Expand All @@ -29,6 +29,16 @@ application {
mainClassName = "flank.scripts.MainKt"
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}


tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "11"
}

repositories {
jcenter()
mavenCentral()
Expand All @@ -52,16 +62,16 @@ tasks["check"].dependsOn(tasks["detekt"])

dependencies {
implementation(kotlin("stdlib", org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION)) // or "stdlib-jdk8"
implementation(Libs.KOTLIN_SERIALIZATION)
implementation(Libs.Fuel.CORE)
implementation(Libs.Fuel.KOTLINX_SERIALIZATION)
implementation(Libs.Fuel.COROUTINES)
implementation(Libs.CLIKT)
implementation(Dependencies.KOTLIN_SERIALIZATION)
implementation(Dependencies.Fuel.CORE)
implementation(Dependencies.Fuel.KOTLINX_SERIALIZATION)
implementation(Dependencies.Fuel.COROUTINES)
implementation(Dependencies.CLIKT)

detektPlugins(Libs.DETEKT_FORMATTING)
detektPlugins(Dependencies.DETEKT_FORMATTING)

testImplementation(Libs.JUNIT)
testImplementation(Libs.MOCKK)
testImplementation(Libs.TRUTH)
testImplementation(Libs.SYSTEM_RULES)
testImplementation(Dependencies.JUNIT)
testImplementation(Dependencies.MOCKK)
testImplementation(Dependencies.TRUTH)
testImplementation(Dependencies.SYSTEM_RULES)
}
8 changes: 4 additions & 4 deletions integration_tests/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
java
kotlin("jvm")
id(Libs.DETEKT_PLUGIN) version Versions.DETEKT
kotlin(Plugins.Kotlin.PLUGIN_JVM)
id(Plugins.DETEKT_PLUGIN) version Versions.DETEKT
}

group = "org.flank"
Expand Down Expand Up @@ -29,8 +29,8 @@ detekt {

dependencies {
implementation(kotlin("stdlib"))
testImplementation(Libs.JUNIT)
detektPlugins(Libs.DETEKT_FORMATTING)
testImplementation(Dependencies.JUNIT)
detektPlugins(Dependencies.DETEKT_FORMATTING)
}

tasks.test {
Expand Down
2 changes: 1 addition & 1 deletion samples/gradle-export-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
application
kotlin(Kotlin.PLUGIN_JVM)
kotlin(Plugins.Kotlin.PLUGIN_JVM)
}

group = "ftl.sample"
Expand Down
Loading

0 comments on commit f2cff86

Please sign in to comment.