From 88bd2ded15bd5e13860887829caaff1e33cfc795 Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Thu, 17 Sep 2020 17:59:05 +0200 Subject: [PATCH 1/6] feat: add proguard initial step into Flank configuration (#1078) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added proguard with default setup * Added proguard config options for succesful build * Update test_runner/proguard/config.pro Co-authored-by: Jan Góral <60390247+jan-gogo@users.noreply.github.com> * added minimization Co-authored-by: Jan Góral <60390247+jan-gogo@users.noreply.github.com> --- buildSrc/src/main/kotlin/Deps.kt | 6 +++ test_runner/build.gradle.kts | 40 ++++++++++++++++++ test_runner/proguard/config.pro | 70 ++++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 test_runner/proguard/config.pro diff --git a/buildSrc/src/main/kotlin/Deps.kt b/buildSrc/src/main/kotlin/Deps.kt index ac61f20904..43c7a09353 100644 --- a/buildSrc/src/main/kotlin/Deps.kt +++ b/buildSrc/src/main/kotlin/Deps.kt @@ -1,4 +1,8 @@ object Versions { + + // https://github.com/Guardsquare/proguard + const val PROGUARD = "7.0.0" + // https://github.com/bugsnag/bugsnag-java/releases const val BUGSNAG = "3.6.1" @@ -126,6 +130,8 @@ object Libs { const val JANSI = "org.fusesource.jansi:jansi:${Versions.JANSI}" + const val PROGUARD = "com.guardsquare:proguard-gradle:${Versions.PROGUARD}" + //region Plugins const val DETEKT_FORMATTING = "io.gitlab.arturbosch.detekt:detekt-formatting:${Versions.DETEKT}" //endregion diff --git a/test_runner/build.gradle.kts b/test_runner/build.gradle.kts index fefb7b898b..0db472d676 100644 --- a/test_runner/build.gradle.kts +++ b/test_runner/build.gradle.kts @@ -43,6 +43,7 @@ shadowJar.apply { exclude(dependency(Libs.TRUTH)) exclude(dependency(Libs.MOCKK)) exclude(dependency(Libs.JUNIT)) + exclude(dependency(Libs.PROGUARD)) exclude(dependency(Libs.DETEKT_FORMATTING)) } } @@ -251,6 +252,28 @@ dependencies { implementation(Libs.JANSI) } +// Fix Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.hash.Hashing.crc32c()Lcom/google/common/hash/HashFunction; +// https://stackoverflow.com/a/45286710 +configurations.all { + resolutionStrategy { + force("com.google.guava:guava:25.1-jre") + force(Libs.KOTLIN_REFLECT) + exclude(group = "com.google.guava", module = "guava-jdk5") + } +} + +buildscript { + repositories { + mavenLocal() + jcenter() + google() + } + dependencies { + classpath(Libs.PROGUARD) + } +} + + tasks.withType { kotlinOptions.jvmTarget = "1.8" } @@ -264,6 +287,23 @@ tasks.create("updateFlank", Exec::class.java) { commandLine = listOf("./bash/update_flank.sh") } +tasks.create("applyProguard", proguard.gradle.ProGuardTask::class.java) { + dependsOn("updateFlank") + description = "Apply proguard to flank and create a minimized jar" + dontwarn() + injars("./build/libs/flank.jar") + outjars("./build/libs/flank-proguard.jar") + libraryjars("${System.getProperty("java.home")}/lib/rt.jar") + libraryjars("./build/libs/flank-sources.jar") + configuration("./proguard/config.pro") + doLast { + copy { + from(file("$buildDir/libs/flank-proguard.jar")) + into(file("./bash/")) + } + } +} + // begin --- ASCII doc generation --- val generateCliAsciiDoc by tasks.registering(JavaExec::class) { dependsOn(tasks.classes) diff --git a/test_runner/proguard/config.pro b/test_runner/proguard/config.pro new file mode 100644 index 0000000000..28d8ae7896 --- /dev/null +++ b/test_runner/proguard/config.pro @@ -0,0 +1,70 @@ +-dontobfuscate +-allowaccessmodification +-keepattributes SourceFile, LineNumberTable +-dontwarn +-verbose +-dontoptimize +-dontnote kotlin.** +-dontnote kotlinx.** +-dontnote com.google.gson.** +-dontnote proguard.configuration.ConfigurationLogger + +-keep class ftl.Main { + public static void main(java.lang.String[]); +} + +#Kotlin +-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {} +-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {} +-keepnames class kotlinx.coroutines.android.AndroidExceptionPreHandler {} +-keepnames class kotlinx.coroutines.android.AndroidDispatcherFactory {} + +-keep class kotlinx.coroutines.internal.MainDispatcherFactory {} +-keep class kotlinx.coroutines.CoroutineExceptionHandler {} +-keep class kotlinx.coroutines.android.AndroidExceptionPreHandler {} +-keep class kotlinx.coroutines.android.AndroidDispatcherFactory {} + +# Most of volatile fields are updated with AFU and should not be mangled +-keepclassmembernames class kotlinx.** { + volatile ; +} + +# Proguard configuration for Jackson 2.x +-keep class com.fasterxml.jackson.databind.ObjectMapper { + public ; + protected ; +} +-keep class com.fasterxml.jackson.databind.ObjectWriter { + public ** writeValueAsString(**); +} +-keepnames class com.fasterxml.jackson.** { *; } +-keep class kotlin.Metadata { *; } +-keep class kotlin.reflect.** { *; } + +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +-keep class com.bugsnag.android.NativeInterface { *; } +-keep class com.bugsnag.android.Breadcrumb { *; } +-keep class com.bugsnag.android.Breadcrumbs { *; } +-keep class com.bugsnag.android.Breadcrumbs$Breadcrumb { *; } +-keep class com.bugsnag.android.BreadcrumbType { *; } +-keep class com.bugsnag.android.Severity { *; } +-keep class com.bugsnag.android.ndk.BugsnagObserver { *; } +# Picocli +-keep class picocli.** { *; } +-keep interface picocli.** { *; } + +#ftl +-keep class ftl.** { *; } +-keep interface ftl.** { *; } + +#google auth +-keep class com.google.auth.** { *; } +-keep interface com.google.auth.** { *; } + +#ctc wstx +-keep class com.ctc.wstx.** { *; } +-keep interface com.ctc.wstx.** { *; } From dc6cc54f320a039bad159f210b6a18982d37760b Mon Sep 17 00:00:00 2001 From: Pawel Pasterz Date: Thu, 17 Sep 2020 10:29:20 +0200 Subject: [PATCH 2/6] Add sub projects and handle gradle warnings --- build.gradle.kts | 9 +++++++++ flank-scripts/build.gradle.kts | 2 +- integration_tests/build.gradle.kts | 6 ++---- samples/gradle-export-api/build.gradle.kts | 2 +- settings.gradle.kts | 4 +++- test_runner/build.gradle.kts | 14 ++++++++++++-- 6 files changed, 28 insertions(+), 9 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8da4b43342..80efbe0e3a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,3 +9,12 @@ configurations.all { exclude(group = "com.google.guava", module = "guava-jdk5") } } + +plugins { + kotlin(Kotlin.PLUGIN_JVM) version Versions.KOTLIN +} + +repositories { + jcenter() + mavenCentral() +} diff --git a/flank-scripts/build.gradle.kts b/flank-scripts/build.gradle.kts index 60ad2d01ee..314385eae1 100644 --- a/flank-scripts/build.gradle.kts +++ b/flank-scripts/build.gradle.kts @@ -2,7 +2,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { application - kotlin(Kotlin.PLUGIN_JVM) version Versions.KOTLIN + 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 diff --git a/integration_tests/build.gradle.kts b/integration_tests/build.gradle.kts index b6dfa0ad38..87ee34641d 100644 --- a/integration_tests/build.gradle.kts +++ b/integration_tests/build.gradle.kts @@ -1,9 +1,7 @@ -import org.jetbrains.kotlin.backend.common.onlyIf - plugins { java - kotlin("jvm") version Versions.KOTLIN - id("io.gitlab.arturbosch.detekt") version Versions.DETEKT + kotlin("jvm") + id(Libs.DETEKT_PLUGIN) version Versions.DETEKT } group = "org.flank" diff --git a/samples/gradle-export-api/build.gradle.kts b/samples/gradle-export-api/build.gradle.kts index f2b43ccda7..331fb22260 100644 --- a/samples/gradle-export-api/build.gradle.kts +++ b/samples/gradle-export-api/build.gradle.kts @@ -1,6 +1,6 @@ plugins { application - kotlin("jvm") version "1.3.72" + kotlin(Kotlin.PLUGIN_JVM) } group = "ftl.sample" diff --git a/settings.gradle.kts b/settings.gradle.kts index 6001f6acf8..1bf1e0bb4d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,5 +4,7 @@ include( ":test_runner", ":firebase_apis:test_api", ":flank-scripts", - ":integration_tests" + ":integration_tests", + "samples:gradle-export-api", + "test_projects:android" ) diff --git a/test_runner/build.gradle.kts b/test_runner/build.gradle.kts index 0db472d676..02ee11e965 100644 --- a/test_runner/build.gradle.kts +++ b/test_runner/build.gradle.kts @@ -11,7 +11,7 @@ import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask plugins { application jacoco - kotlin("jvm") version Versions.KOTLIN + kotlin("jvm") id("io.gitlab.arturbosch.detekt") version Versions.DETEKT id("com.jfrog.bintray") version Versions.BINTRAY @@ -282,11 +282,21 @@ tasks.withType { // https://github.com/codecov/example-gradle/blob/master/build.gradle#L25 tasks["check"].dependsOn(tasks["jacocoTestReport"], tasks["detekt"]) -tasks.create("updateFlank", Exec::class.java) { +val updateFlank by tasks.registering(Exec::class) { + group = "Build" description = "Update flank jar" commandLine = listOf("./bash/update_flank.sh") } +val flankFullRun by tasks.registering(Exec::class) { + dependsOn(tasks["clean"], tasks["check"]) + // currently IT run only on CI, implement support to enable local run + dependsOn( ":integration_tests:test") + group = "Build" + description = "Perform full test_runner run" + commandLine = listOf("./bash/update_flank.sh") +} + tasks.create("applyProguard", proguard.gradle.ProGuardTask::class.java) { dependsOn("updateFlank") description = "Apply proguard to flank and create a minimized jar" From 07bc866a2074f828a52632246f4cdefc9ee2a1dd Mon Sep 17 00:00:00 2001 From: Piotr Adamczyk Date: Thu, 17 Sep 2020 15:10:09 +0200 Subject: [PATCH 3/6] split dependencies, for plugins and versions --- build.gradle.kts | 4 +- .../main/kotlin/{Deps.kt => Dependencies.kt} | 107 +----------------- buildSrc/src/main/kotlin/Plugins.kt | 12 ++ buildSrc/src/main/kotlin/Versions.kt | 94 +++++++++++++++ flank-scripts/build.gradle.kts | 28 ++--- integration_tests/build.gradle.kts | 8 +- samples/gradle-export-api/build.gradle.kts | 2 +- test_runner/build.gradle.kts | 98 ++++++++-------- 8 files changed, 178 insertions(+), 175 deletions(-) rename buildSrc/src/main/kotlin/{Deps.kt => Dependencies.kt} (51%) create mode 100644 buildSrc/src/main/kotlin/Plugins.kt create mode 100644 buildSrc/src/main/kotlin/Versions.kt diff --git a/build.gradle.kts b/build.gradle.kts index 80efbe0e3a..73199d28c3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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 { diff --git a/buildSrc/src/main/kotlin/Deps.kt b/buildSrc/src/main/kotlin/Dependencies.kt similarity index 51% rename from buildSrc/src/main/kotlin/Deps.kt rename to buildSrc/src/main/kotlin/Dependencies.kt index 43c7a09353..2e9ffb06ea 100644 --- a/buildSrc/src/main/kotlin/Deps.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -1,101 +1,4 @@ -object Versions { - - // https://github.com/Guardsquare/proguard - const val PROGUARD = "7.0.0" - - // 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}" @@ -151,20 +54,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" -} diff --git a/buildSrc/src/main/kotlin/Plugins.kt b/buildSrc/src/main/kotlin/Plugins.kt new file mode 100644 index 0000000000..2672811ac2 --- /dev/null +++ b/buildSrc/src/main/kotlin/Plugins.kt @@ -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" + } +} diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt new file mode 100644 index 0000000000..652fde3fa4 --- /dev/null +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -0,0 +1,94 @@ +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" + + // https://github.com/Guardsquare/proguard + const val PROGUARD = "7.0.0" + + // ============== flank-scripts ============== + const val KOTLINX_SERIALIZATION = "1.0.0-RC" + const val FUEL = "2.2.3" + const val CLIKT = "2.8.0" +} diff --git a/flank-scripts/build.gradle.kts b/flank-scripts/build.gradle.kts index 314385eae1..bdd7aabc02 100644 --- a/flank-scripts/build.gradle.kts +++ b/flank-scripts/build.gradle.kts @@ -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" @@ -52,16 +52,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) } diff --git a/integration_tests/build.gradle.kts b/integration_tests/build.gradle.kts index 87ee34641d..692ea438c4 100644 --- a/integration_tests/build.gradle.kts +++ b/integration_tests/build.gradle.kts @@ -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" @@ -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 { diff --git a/samples/gradle-export-api/build.gradle.kts b/samples/gradle-export-api/build.gradle.kts index 331fb22260..559e2fbd97 100644 --- a/samples/gradle-export-api/build.gradle.kts +++ b/samples/gradle-export-api/build.gradle.kts @@ -1,6 +1,6 @@ plugins { application - kotlin(Kotlin.PLUGIN_JVM) + kotlin(Plugins.Kotlin.PLUGIN_JVM) } group = "ftl.sample" diff --git a/test_runner/build.gradle.kts b/test_runner/build.gradle.kts index 02ee11e965..c2b9bd140d 100644 --- a/test_runner/build.gradle.kts +++ b/test_runner/build.gradle.kts @@ -11,13 +11,12 @@ import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask plugins { application jacoco - kotlin("jvm") - - id("io.gitlab.arturbosch.detekt") version Versions.DETEKT - id("com.jfrog.bintray") version Versions.BINTRAY - id("maven-publish") - id("com.github.johnrengelman.shadow") version Versions.SHADOW - id("com.github.ben-manes.versions") version Versions.BEN_MANES + kotlin(Plugins.Kotlin.PLUGIN_JVM) + id(Plugins.DETEKT_PLUGIN) version Versions.DETEKT + id(Plugins.JFROG_BINTRAY) version Versions.BINTRAY + id(Plugins.MAVEN_PUBLISH) + id(Plugins.PLUGIN_SHADOW_JAR) version Versions.SHADOW + id(Plugins.BEN_MANES_PLUGIN) version Versions.BEN_MANES } val artifactID = "flank" @@ -28,23 +27,24 @@ shadowJar.apply { archiveBaseName.set(artifactID) mergeServiceFiles() minimize { - exclude(dependency(Libs.KOTLIN_REFLECT)) - exclude(dependency(Libs.JACKSON_XML)) - exclude(dependency(Libs.JACKSON_DATABIND)) - exclude(dependency(Libs.JACKSON_KOTLIN)) - exclude(dependency(Libs.JACKSON_YAML)) - exclude(dependency(Libs.GSON)) + exclude(dependency(Dependencies.KOTLIN_REFLECT)) + exclude(dependency(Dependencies.JACKSON_XML)) + exclude(dependency(Dependencies.JACKSON_DATABIND)) + exclude(dependency(Dependencies.JACKSON_KOTLIN)) + exclude(dependency(Dependencies.JACKSON_YAML)) + exclude(dependency(Dependencies.GSON)) } @Suppress("UnstableApiUsage") manifest { attributes(mapOf("Main-Class" to "ftl.Main")) } dependencies { - exclude(dependency(Libs.TRUTH)) - exclude(dependency(Libs.MOCKK)) - exclude(dependency(Libs.JUNIT)) - exclude(dependency(Libs.PROGUARD)) - exclude(dependency(Libs.DETEKT_FORMATTING)) + exclude(dependency(Dependencies.TRUTH)) + exclude(dependency(Dependencies.MOCKK)) + exclude(dependency(Dependencies.JUNIT)) + + exclude(dependency(Dependencies.PROGUARD)) + exclude(dependency(Dependencies.DETEKT_FORMATTING)) } } @@ -199,57 +199,57 @@ tasks.withType { } dependencies { - implementation(Libs.BUGSNAG) + implementation(Dependencies.BUGSNAG) - implementation(Libs.DD_PLIST) - implementation(Libs.DEX_TEST_PARSER) + implementation(Dependencies.DD_PLIST) + implementation(Dependencies.DEX_TEST_PARSER) - implementation(Libs.GSON) + implementation(Dependencies.GSON) - implementation(Libs.JACKSON_DATABIND) - implementation(Libs.JACKSON_KOTLIN) - implementation(Libs.JACKSON_YAML) - implementation(Libs.JACKSON_XML) + implementation(Dependencies.JACKSON_DATABIND) + implementation(Dependencies.JACKSON_KOTLIN) + implementation(Dependencies.JACKSON_YAML) + implementation(Dependencies.JACKSON_XML) - implementation(Libs.GOOGLE_NIO) - implementation(Libs.GOOGLE_AUTH) - implementation(Libs.GOOGLE_STORAGE) - implementation(Libs.GOOGLE_TOOLRESULTS) + implementation(Dependencies.GOOGLE_NIO) + implementation(Dependencies.GOOGLE_AUTH) + implementation(Dependencies.GOOGLE_STORAGE) + implementation(Dependencies.GOOGLE_TOOLRESULTS) - implementation(Libs.KTOR_SERVER_CORE) - implementation(Libs.KTOR_SERVER_NETTY) - implementation(Libs.KTOR_GSON) + implementation(Dependencies.KTOR_SERVER_CORE) + implementation(Dependencies.KTOR_SERVER_NETTY) + implementation(Dependencies.KTOR_GSON) - implementation(Libs.KOTLIN_STD_LIB) - implementation(Libs.KOTLIN_COROUTINES_CORE) + implementation(Dependencies.KOTLIN_STD_LIB) + implementation(Dependencies.KOTLIN_COROUTINES_CORE) - implementation(Libs.LOGBACK) + implementation(Dependencies.LOGBACK) - implementation(Libs.PICOCLI) - annotationProcessor(Libs.PICOCLI_CODEGEN) + implementation(Dependencies.PICOCLI) + annotationProcessor(Dependencies.PICOCLI_CODEGEN) - implementation(Libs.WOODSTOX) + implementation(Dependencies.WOODSTOX) - implementation(Libs.KOTLIN_LOGGING) + implementation(Dependencies.KOTLIN_LOGGING) // NOTE: iOS support isn't in the public artifact. Use testing jar generated from the private gcloud CLI json // https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.google.apis%22%20AND%20a%3A%22google-api-services-testing%22 // compile("com.google.apis:google-api-services-testing:v1-rev30-1.23.0") implementation(project(":firebase_apis:test_api")) - implementation(Libs.JSOUP) - implementation(Libs.OKHTTP) + implementation(Dependencies.JSOUP) + implementation(Dependencies.OKHTTP) - detektPlugins(Libs.DETEKT_FORMATTING) + detektPlugins(Dependencies.DETEKT_FORMATTING) - testImplementation(Libs.JUNIT) - implementation(Libs.SYSTEM_RULES) - testImplementation(Libs.TRUTH) - testImplementation(Libs.MOCKK) + testImplementation(Dependencies.JUNIT) + implementation(Dependencies.SYSTEM_RULES) + testImplementation(Dependencies.TRUTH) + testImplementation(Dependencies.MOCKK) - implementation(Libs.COMMON_TEXT) + implementation(Dependencies.COMMON_TEXT) - implementation(Libs.JANSI) + implementation(Dependencies.JANSI) } // Fix Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.hash.Hashing.crc32c()Lcom/google/common/hash/HashFunction; From f4130db760c6793d720a040aa06fdf3e7e5e7089 Mon Sep 17 00:00:00 2001 From: Pawel Pasterz Date: Thu, 17 Sep 2020 21:54:08 +0200 Subject: [PATCH 4/6] Fix dependencies --- test_runner/build.gradle.kts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/test_runner/build.gradle.kts b/test_runner/build.gradle.kts index c2b9bd140d..f1aba8a953 100644 --- a/test_runner/build.gradle.kts +++ b/test_runner/build.gradle.kts @@ -252,16 +252,6 @@ dependencies { implementation(Dependencies.JANSI) } -// Fix Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.hash.Hashing.crc32c()Lcom/google/common/hash/HashFunction; -// https://stackoverflow.com/a/45286710 -configurations.all { - resolutionStrategy { - force("com.google.guava:guava:25.1-jre") - force(Libs.KOTLIN_REFLECT) - exclude(group = "com.google.guava", module = "guava-jdk5") - } -} - buildscript { repositories { mavenLocal() @@ -269,7 +259,7 @@ buildscript { google() } dependencies { - classpath(Libs.PROGUARD) + classpath(Dependencies.PROGUARD) } } From e4a31a719f5da9371fbc4934480b012e561d2742 Mon Sep 17 00:00:00 2001 From: pawelpasterz <32893017+pawelpasterz@users.noreply.github.com> Date: Fri, 18 Sep 2020 09:53:30 +0200 Subject: [PATCH 5/6] Disable IT for iOS (#1129) --- integration_tests/src/test/kotlin/IntegrationTests.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integration_tests/src/test/kotlin/IntegrationTests.kt b/integration_tests/src/test/kotlin/IntegrationTests.kt index 45d9ed9d60..21ede14160 100644 --- a/integration_tests/src/test/kotlin/IntegrationTests.kt +++ b/integration_tests/src/test/kotlin/IntegrationTests.kt @@ -1,5 +1,6 @@ import org.junit.Assert.assertEquals import org.junit.Assert.assertTrue +import org.junit.Ignore import org.junit.Test import utils.toStringMap @@ -25,6 +26,7 @@ class IntegrationTests { ) } + @Ignore("iOS has only physical devices, whit current configuration flank's project hits quota limit extremely fast") @Test fun shouldMatchIosSuccessExitCodeAndPattern() { val testParameters = System.getProperties().toStringMap().toIosParameters() From 11a542d415e5a80ef0c307ba513f2f7636bbc908 Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Fri, 18 Sep 2020 15:05:55 +0200 Subject: [PATCH 6/6] fix: Bump action versioning --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1517fb7b33..411e200694 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -108,7 +108,7 @@ jobs: arguments: "test_runner:publish -PGITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" - name: Post Message of Flank Release - uses: Flank/flank@V1.1-action + uses: Flank/flank@V1.2-action if: startsWith(github.ref, 'refs/tags/v') with: xoxctoken: ${{ secrets.SLACK_XOXCTOKEN }}