Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
Dependency and general updates (#122)
Browse files Browse the repository at this point in the history
* Update many dependencies

Compile sdk to 31
AGP to 7.0.3
Kotlin to 1.5.31
AndroidX Core to 1.7.0
...and others

* Update actions to use burrunan/gradle-cache-action

* Remove checksum.sh

* Make lint happy
  • Loading branch information
chrisbanes authored Nov 12, 2021
1 parent c5cf221 commit edda640
Show file tree
Hide file tree
Showing 14 changed files with 72 additions and 112 deletions.
84 changes: 41 additions & 43 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,17 @@ jobs:
env:
ENCRYPT_KEY: ${{ secrets.ENCRYPT_KEY }}

- name: Generate cache key
run: ./checksum.sh checksum.txt

- uses: actions/cache@v2
- uses: burrunan/gradle-cache-action@v1
name: Build
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: gradle-${{ hashFiles('checksum.txt') }}

- name: Build
run: ./gradlew spotlessCheck assemble lintDebug --scan
job-id: linux
gradle-dependencies-cache-key: |
buildSrc/src/main/java/dev/chrisbanes/insetter/buildsrc/dependencies.kt
arguments: |
spotlessCheck
apiCheck
assemble
lintDebug
- name: Clean secrets
if: always()
Expand All @@ -60,7 +58,7 @@ jobs:
needs: build
strategy:
matrix:
api-level: [21, 23, 26, 29]
api-level: [ 21, 23, 26, 29 ]
env:
TERM: dumb

Expand All @@ -80,39 +78,45 @@ jobs:
env:
ENCRYPT_KEY: ${{ secrets.ENCRYPT_KEY }}

- name: Generate cache key
run: ./checksum.sh checksum.txt

- uses: actions/cache@v2
- uses: burrunan/gradle-cache-action@v1
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: gradle-${{ hashFiles('checksum.txt') }}
job-id: mac
gradle-dependencies-cache-key: |
buildSrc/src/main/java/dev/chrisbanes/insetter/buildsrc/dependencies.kt
# Determine what emulator image to use. We run all API 29+ emulators using
# the google_apis image
- name: Determine emulator target
id: determine-target
env:
API_LEVEL: ${{ matrix.api-level }}
run: |
TARGET="default"
if [ "$API_LEVEL" -ge "29" ]; then
TARGET="google_apis"
fi
echo "::set-output name=TARGET::$TARGET"
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ steps.determine-target.outputs.TARGET }}
profile: Galaxy Nexus
script: ./gradlew connectedCheck

- name: Clean secrets
if: always()
run: release/signing-cleanup.sh

- name: Copy test results
if: always()
run: |
mkdir -p junit
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} junit/ \;
- name: Upload test results
if: always()
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
with:
name: junit-results
path: junit
name: test-results-${{ matrix.api-level }}-${{ steps.determine-target.outputs.TARGET }}
path: |
**/build/reports/*
**/build/outputs/*/connected/*
deploy:
if: github.ref == 'refs/heads/main'
Expand All @@ -138,19 +142,13 @@ jobs:
env:
ENCRYPT_KEY: ${{ secrets.ENCRYPT_KEY }}

- name: Generate cache key
run: ./checksum.sh checksum.txt

- uses: actions/cache@v2
- uses: burrunan/gradle-cache-action@v1
name: Publish
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: gradle-${{ hashFiles('checksum.txt') }}

- name: Deploy to Sonatype
run: ./gradlew publish --no-parallel
job-id: linux
gradle-dependencies-cache-key: |
buildSrc/src/main/java/dev/chrisbanes/insetter/buildsrc/dependencies.kt
arguments: publish --no-parallel
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,13 @@ jobs:
with:
java-version: 11

- name: Generate cache key
run: ./checksum.sh checksum.txt

- uses: actions/cache@v2
- uses: burrunan/gradle-cache-action@v1
name: Build API docs
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: gradle-${{ hashFiles('checksum.txt') }}
job-id: linux
gradle-dependencies-cache-key: |
buildSrc/src/main/java/dev/chrisbanes/insetter/buildsrc/dependencies.kt
arguments: dokkaHtmlMultiModule

- name: Setup Python
uses: actions/setup-python@v2
Expand Down
1 change: 1 addition & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions .idea/runConfigurations.xml

This file was deleted.

6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ buildscript {
}

plugins {
id "com.diffplug.spotless" version "5.12.5"
id "com.diffplug.spotless" version "6.0.0"
}

apply plugin: 'binary-compatibility-validator'
Expand Down Expand Up @@ -74,8 +74,8 @@ subprojects {
// Treat all Kotlin warnings as errors
allWarningsAsErrors = true

// Set JVM target to 1.8
jvmTarget = "1.8"
// Set JVM target to 11
jvmTarget = "11"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,49 +17,49 @@
package dev.chrisbanes.insetter.buildsrc

object Versions {
const val ktlint = "0.41.0"
const val ktlint = "0.43.0"
}

object Libs {
// We need to use a stable version of AGP since that controls which data-binding version
// we use in dbx
const val androidGradlePluginVersion = "4.2.1"
const val androidGradlePluginVersion = "7.0.3"
const val androidGradlePlugin = "com.android.tools.build:gradle:$androidGradlePluginVersion"

const val gradleMavenPublishPlugin = "com.vanniktech:gradle-maven-publish-plugin:0.15.1"
const val gradleMavenPublishPlugin = "com.vanniktech:gradle-maven-publish-plugin:0.18.0"

const val junit = "junit:junit:4.12"

object Kotlin {
private const val version = "1.4.32"
private const val version = "1.5.31"
const val stdlib = "org.jetbrains.kotlin:kotlin-stdlib:$version"
const val gradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$version"

const val binaryCompatibility = "org.jetbrains.kotlinx:binary-compatibility-validator:0.2.3"
const val binaryCompatibility = "org.jetbrains.kotlinx:binary-compatibility-validator:0.8.0"
}

object Dokka {
private const val version = "1.4.32"
private const val version = "1.5.31"
const val gradlePlugin = "org.jetbrains.dokka:dokka-gradle-plugin:$version"
}

object AndroidX {
object Test {
private const val version = "1.2.0"
private const val version = "1.4.0"
const val core = "androidx.test:core:$version"
const val runner = "androidx.test:runner:$version"
const val rules = "androidx.test:rules:$version"

const val ext = "androidx.test.ext:junit:1.1.1"
const val ext = "androidx.test.ext:junit:1.1.3"

const val espressoCore = "androidx.test.espresso:espresso-core:3.2.0"
const val espressoCore = "androidx.test.espresso:espresso-core:3.4.0"
}

const val core = "androidx.core:core:1.5.0"
const val coreKtx = "androidx.core:core-ktx:1.5.0"
const val core = "androidx.core:core:1.7.0"
const val coreKtx = "androidx.core:core-ktx:1.7.0"
}

const val constraintLayout = "androidx.constraintlayout:constraintlayout:2.0.4"

const val mdc = "com.google.android.material:material:1.2.1"
const val mdc = "com.google.android.material:material:1.4.0"
}
23 changes: 0 additions & 23 deletions checksum.sh

This file was deleted.

2 changes: 1 addition & 1 deletion dbx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ plugins {
}

android {
compileSdkVersion 30
compileSdkVersion 31

defaultConfig {
minSdkVersion 15
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ kotlin {
}

android {
compileSdkVersion 30
compileSdkVersion 31

compileOptions {
kotlinOptions {
Expand Down
2 changes: 1 addition & 1 deletion library/src/main/java/dev/chrisbanes/insetter/Sides.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package dev.chrisbanes.insetter

import androidx.annotation.IntDef

@IntDef(flag = true, value = [Side.LEFT, Side.TOP, Side.RIGHT, Side.BOTTOM, Side.ALL])
@IntDef(flag = true, value = [Side.NONE, Side.LEFT, Side.TOP, Side.RIGHT, Side.BOTTOM, Side.ALL])
@Retention(AnnotationRetention.SOURCE)
@Target(
AnnotationTarget.VALUE_PARAMETER,
Expand Down
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ plugins {
}

android {
compileSdkVersion 30
compileSdkVersion 31

defaultConfig {
applicationId "dev.chrisbanes.insetter.sample"
Expand Down
4 changes: 2 additions & 2 deletions test-dbx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 30
compileSdkVersion 31

defaultConfig {
minSdkVersion 15
Expand Down Expand Up @@ -52,7 +52,7 @@ dependencies {
kaptAndroidTest "androidx.databinding:databinding-compiler:${Libs.androidGradlePluginVersion}"
// We need to explicitly depend on LiveData for data-binding to work. Not sure why this
// doesn't transitively resolve
androidTestImplementation "androidx.lifecycle:lifecycle-livedata:2.1.0"
androidTestImplementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.0"

androidTestImplementation project(':test-utils')
androidTestImplementation Libs.Kotlin.stdlib
Expand Down
4 changes: 2 additions & 2 deletions test-utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ plugins {
}

android {
compileSdkVersion 30
compileSdkVersion 31

defaultConfig {
minSdkVersion 15
Expand All @@ -35,7 +35,7 @@ android {

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "11"
}
}

Expand Down

0 comments on commit edda640

Please sign in to comment.