Skip to content

Commit

Permalink
Misc build updates (#39)
Browse files Browse the repository at this point in the history
* Suppress sha256 for metadata

this is what broke our releases in 6.4 and this works around it for now

See gradle/gradle#11308

* Bump AGP version on CI to 3.6.3

* Kotlin 1.3.72

* Zipflinger 3.6.3

* Update more misc deps

* More AGP

* Shade in newer zipfligner version

Resolves #38

* Update sample okio libraries

* Clarify comment and exlude guava too
  • Loading branch information
ZacSweers committed May 11, 2020
1 parent 2694f9c commit 08fb1e0
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
matrix:
ci_java_version: [1.8]
ci_agp_version: [3.6.1]
ci_agp_version: [3.6.3]
job: [instrumentation, plugin]
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -26,7 +26,7 @@ buildscript {
String defaultAgpVersion = "3.6.1"
String agpVersion = findProperty("keeperTest.agpVersion")?.toString() ?: defaultAgpVersion
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.71"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"
classpath "com.android.tools.build:gradle:$agpVersion"
classpath "com.slack.keeper:keeper"
}
Expand Down
48 changes: 41 additions & 7 deletions keeper-gradle-plugin/build.gradle.kts
Expand Up @@ -13,13 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation

plugins {
`kotlin-dsl`
`java-gradle-plugin`
kotlin("jvm") version "1.3.71"
kotlin("kapt") version "1.3.71"
kotlin("jvm") version "1.3.72"
kotlin("kapt") version "1.3.72"
id("com.vanniktech.maven.publish") version "0.11.1"
id("com.github.johnrengelman.shadow") version "5.2.0"
}

buildscript {
Expand Down Expand Up @@ -73,16 +75,28 @@ mavenPublish {
}
}

val defaultAgpVersion = "3.6.1"
val defaultAgpVersion = "3.6.3"
val agpVersion = findProperty("keeperTest.agpVersion")?.toString() ?: defaultAgpVersion

// See https://github.com/slackhq/keeper/pull/11#issuecomment-579544375 for context
val releaseMode = hasProperty("keeper.releaseMode")
val shade: Configuration = configurations.maybeCreate("compileShaded")
configurations.getByName("compileOnly").extendsFrom(shade)
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.3.71")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.3.71")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.71")
implementation("com.android:zipflinger:3.6.1")
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.3.72")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.3.72")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72")

// We want a newer version of ZipFlinger for Zip64 support but don't want to incur that cost on
// consumers, so we shade it.
shade("com.android:zipflinger:4.1.0-alpha09") {
// ZipFlinger depends on com.android.tools:common and guava, but neither are actually used
// com.android.tools:annotations are used, but we can exclude them too since they're just
// annotations and not needed at runtime.
exclude(group = "com.android.tools")
exclude(group = "com.google.guava")
}

if (releaseMode) {
compileOnly("com.android.tools.build:gradle:$defaultAgpVersion")
} else {
Expand All @@ -97,3 +111,23 @@ dependencies {
testImplementation("com.google.truth:truth:1.0.1")
testImplementation("junit:junit:4.13")
}

tasks.jar.configure { enabled = false }

tasks.register<ConfigureShadowRelocation>("relocateShadowJar") {
target = tasks.shadowJar.get()
}

val shadowJar = tasks.shadowJar.apply {
configure {
dependsOn(tasks.getByName("relocateShadowJar"))
minimize()
archiveClassifier.set("")
configurations = listOf(shade)
relocate("com.android.zipflinger", "com.slack.keeper.internal.zipflinger")
}
}
artifacts {
runtime(shadowJar)
archives(shadowJar)
}
2 changes: 2 additions & 0 deletions keeper-gradle-plugin/gradle.properties
Expand Up @@ -15,6 +15,8 @@
#

kapt.includeCompileClasspath=false
# Due to https://github.com/gradle/gradle/issues/11308
systemProp.org.gradle.internal.publish.checksums.insecure=true

POM_NAME=Keeper
POM_ARTIFACT_ID=keeper
Expand Down
Expand Up @@ -264,7 +264,7 @@ private fun buildGradleFile(
dependencies {
// Note: this version doesn't really matter, the plugin's version will override it in the test
classpath "com.android.tools.build:gradle:3.6.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.71"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"
}
}
Expand Down Expand Up @@ -339,7 +339,7 @@ private fun buildGradleFile(
dependencies {
//noinspection DifferentStdlibGradleVersion
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.71"
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.72"
}
""".trimIndent()

Expand Down
2 changes: 1 addition & 1 deletion sample-libraries/a/build.gradle
Expand Up @@ -33,6 +33,6 @@ android {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.71"
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.72"
implementation project(":sample-libraries:b")
}
4 changes: 2 additions & 2 deletions sample-libraries/b/build.gradle
Expand Up @@ -33,7 +33,7 @@ android {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.71"
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.72"
implementation project(":sample-libraries:c")
implementation "com.squareup.okio:okio:2.5.0"
implementation "com.squareup.okio:okio:2.6.0"
}
4 changes: 2 additions & 2 deletions sample-libraries/c/build.gradle
Expand Up @@ -24,6 +24,6 @@ sourceSets {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.71"
implementation "com.squareup.okio:okio:2.5.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.72"
implementation "com.squareup.okio:okio:2.6.0"
}
12 changes: 6 additions & 6 deletions sample/build.gradle
Expand Up @@ -102,16 +102,16 @@ repositories {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.71"
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.72"
implementation project(":sample-libraries:a")

androidTestImplementation project(":sample-libraries:c")
androidTestImplementation "com.squareup.okio:okio:2.5.0"
androidTestImplementation "com.squareup.okio:okio:2.6.0"
androidTestImplementation "androidx.annotation:annotation:1.1.0"
androidTestImplementation "androidx.test:rules:1.3.0-alpha05"
androidTestImplementation "androidx.test:runner:1.3.0-alpha05"
androidTestImplementation "androidx.test:orchestrator:1.3.0-alpha05"
androidTestImplementation "androidx.test.ext:junit:1.1.2-alpha05"
androidTestImplementation "androidx.test:rules:1.3.0-beta01"
androidTestImplementation "androidx.test:runner:1.3.0-beta01"
androidTestImplementation "androidx.test:orchestrator:1.3.0-beta01"
androidTestImplementation "androidx.test.ext:junit:1.1.2-beta01"
androidTestImplementation "junit:junit:4.13"
androidTestImplementation "com.google.truth:truth:1.0.1"
}

0 comments on commit 08fb1e0

Please sign in to comment.