Skip to content

Commit

Permalink
Migrate to version catalogues, refreshVersions, and update dependenci…
Browse files Browse the repository at this point in the history
…es (#2285)

It has been a very long time since I've updated dependencies around the project. This revamps the dependency infra to use refreshVersions and updates a handful of libraries.
  • Loading branch information
gpeal committed May 7, 2023
1 parent bb777e8 commit 486930a
Show file tree
Hide file tree
Showing 45 changed files with 1,493 additions and 475 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/validate.yml
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11
java-version: 17
cache: 'gradle'
- name: Run Lint
run: ./gradlew lintDebug --no-daemon
Expand All @@ -43,7 +43,7 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11
java-version: 17
cache: 'gradle'
- name: Run Unit Tests
run: ./gradlew testDebugUnitTest --no-daemon
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11
java-version: 17
cache: 'gradle'
- name: Build app
run: ./gradlew snapshot-tests:assembleDebug snapshot-tests:assembleDebugAndroidTest --no-daemon
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11
java-version: 17
cache: 'gradle'
- name: "Deploy Snapshot"
env:
Expand Down
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

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

36 changes: 8 additions & 28 deletions build.gradle
@@ -1,42 +1,22 @@
import org.ajoberstar.grgit.Grgit

buildscript {
ext {
coroutinesVersion = '1.6.2'
coreVersion = '1.6.0'
appcompatVersion = '1.3.1'
activityVersion = '1.3.1'
lifecycleVersion = '2.3.1'
composeVersion = '1.1.1'
kotlinVersion = '1.6.10'
daggerVersion = '2.38.1'
awsVersion = '2.8.3'
mockitoVersion = '3.12.4'
robolectricVersion = '4.6.1'
retrofitVersion = '2.9.0'
materialVersion = '1.4.0'
epoxyVersion = '4.6.4'
junitVersion = '4.13.2'
extJunitVersion = '1.1.3'
espressoVersion = '3.3.0'
startupVersion = '1.2.0-alpha01'
}

repositories {
google()
mavenCentral()
}
dependencies {
classpath 'org.ajoberstar.grgit:grgit-gradle:4.1.1'
classpath 'com.android.tools.build:gradle:7.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.24.0'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.5.30'
classpath libs.grgit.plugin
classpath libs.android.gradle.plugin
classpath libs.kotlin.gradle.plugin
classpath libs.gradle.maven.publish.plugin
classpath libs.dokka.gradle.plugin
}
}

plugins {
id 'net.ltgt.errorprone' version '3.0.1' apply false
id 'net.ltgt.errorprone' apply false
id "com.google.devtools.ksp" apply false
}

allprojects {
Expand All @@ -53,6 +33,6 @@ ext {
gitBranch = git.branch.current().name
}

task clean(type: Delete) {
tasks.register('clean', Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -15,7 +15,7 @@ POM_DEVELOPER_EMAIL=lottie@airbnb.com
POM_INCEPTION_YEAR=2017

android.useAndroidX=true
android.enableJetifier=true
android.enableJetifier=false
org.gradle.caching=true
org.gradle.jvmargs=-Xmx4g -XX:+UseParallelGC -Dfile.encoding=UTF-8
org.gradle.daemon=true
Expand Down
74 changes: 74 additions & 0 deletions gradle/libs.versions.toml
@@ -0,0 +1,74 @@
[libraries]
android-gradle-plugin = "com.android.tools.build:gradle:_"
androidx-activity-compose = "androidx.activity:activity-compose:_"
androidx-appcompat = "androidx.appcompat:appcompat:_"
androidx-browser = "androidx.browser:browser:_"
androidx-cardview = "androidx.cardview:cardview:_"
androidx-collection-ktx = "androidx.collection:collection:_"
androidx-constraintlayout = "androidx.constraintlayout:constraintlayout:_"
androidx-core-ktx = "androidx.core:core-ktx:_"
androidx-fragment-testing = "androidx.fragment:fragment-testing:_"
androidx-multidex = "androidx.multidex:multidex:_"
androidx-navigation-compose = "androidx.navigation:navigation-compose:_"
androidx-navigation-ui = "androidx.navigation:navigation-ui-ktx:_"
androidx-paging-runtime-ktx = "androidx.paging:paging-runtime-ktx:_"
androidx-recyclerview = "androidx.recyclerview:recyclerview:_"
androidx-test-core = "androidx.test:core:_"
androidx-test-espresso = "androidx.test.espresso:espresso-core:_"
androidx-test-espresso-idling = "androidx.test.espresso:espresso-idling-resource:_"
androidx-test-junit = "androidx.test.ext:junit:_"
androidx-test-rules = "androidx.test:rules:_"
androidx-viewmodel-ktx = "androidx.lifecycle:lifecycle-viewmodel-ktx:_"
aws-android-sdk-auth-userpools = "com.amazonaws:aws-android-sdk-auth-userpools:_"
aws-android-sdk-mobile-client = "com.amazonaws:aws-android-sdk-mobile-client:_"
aws-android-sdk-s3 = "com.amazonaws:aws-android-sdk-s3:_"
coil-compose = "io.coil-kt:coil-compose:_"
compose-bom = "androidx.compose:compose-bom:_"
# Compose deps need the group/name structure without version because version is pulled from the bom.
compose-foundation = { group = "androidx.compose.foundation", name = "foundation" }
compose-material = { group = "androidx.compose.material", name = "material" }
compose-material-icons-extended = { group = "androidx.compose.material", name = "material-icons-extended" }
compose-ui = { group = "androidx.compose.ui", name = "ui" }
compose-ui-test-junit = "androidx.compose.ui:ui-test-junit4:_"
compose-ui-test-manifest = "androidx.compose.ui:ui-test-manifest:_"
compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
dagger = "com.google.dagger:dagger:_"
dagger-compiler = "com.google.dagger:dagger-compiler:_"
dokka-gradle-plugin = "org.jetbrains.dokka:dokka-gradle-plugin:_"
epoxy = "com.airbnb.android:epoxy:_"
epoxy-processor = "com.airbnb.android:epoxy-processor:_"
errorprone-core = "com.google.errorprone:error_prone_core:_"
errorprone-javac = "com.google.errorprone:javac:_"
glide = "com.github.bumptech.glide:glide:_"
google-material = "com.google.android.material:material:_"
gradle-maven-publish-plugin = "com.vanniktech:gradle-maven-publish-plugin:_"
grgit-plugin = "org.ajoberstar.grgit:grgit-gradle:_"
gson = "com.google.code.gson:gson:_"
javac = "com.google.errorprone:javac:_"
jjwt = "io.jsonwebtoken:jjwt:_"
junit4 = "junit:junit:_"
kotlin-annotation-processing-gradle = "org.jetbrains.kotlin:kotlin-annotation-processing-gradle:_"
kotlin-gradle-plugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:_"
kotlin-parcelize-compiler = "org.jetbrains.kotlin:kotlin-parcelize-compiler:_"
kotlin-parcelize-runtime = "org.jetbrains.kotlin:kotlin-parcelize-runtime:_"
kotlinx-coroutines-android = "org.jetbrains.kotlinx:kotlinx-coroutines-android:_"
kotlinx-coroutines-test = "org.jetbrains.kotlinx:kotlinx-coroutines-test:_"
mavericks = "com.airbnb.android:mavericks:_"
mavericks-compose = "com.airbnb.android:mavericks-compose:_"
mockito-android = "com.nhaarman.mockitokotlin2:mockito-kotlin:_"
mockito-core = "org.mockito:mockito-core:_"
mockito-kotlin = "org.mockito:mockito-android:_"
mpandroidchart = "com.github.PhilJay:MPAndroidChart:_"
mvrx = "com.airbnb.android:mvrx:_"
nullaway = "com.uber.nullaway:nullaway:_"
okhttp = "com.squareup.okhttp3:okhttp:_"
okio = "com.squareup.okio:okio:_"
org-jacoco-ant = "org.jacoco:org.jacoco.ant:_"
profileinstaller = "androidx.profileinstaller:profileinstaller:_"
qrcodereaderview = "com.dlazaro66.qrcodereaderview:qrcodereaderview:_"
retrofit = "com.squareup.retrofit2:retrofit:_"
retrofit-gson = "com.squareup.retrofit2:converter-gson:_"
retrofit-moshi = "com.squareup.retrofit2:converter-moshi:_"
retrofit-rxjava = "com.squareup.retrofit2:adapter-rxjava2:_"
robolectric = "org.robolectric:robolectric:_"
viewbinding = "androidx.databinding:viewbinding:_"
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
28 changes: 16 additions & 12 deletions issue-repro-compose/build.gradle
@@ -1,38 +1,42 @@
import static de.fayard.refreshVersions.core.Versions.versionFor

plugins {
id 'com.android.application'
id "kotlin-android"
}

android {
compileSdk 31
namespace 'com.airbnb.lottie.issues.compose'
compileSdk 33
defaultConfig {
applicationId "com.airbnb.lottie.issues.compose"
minSdk 21
targetSdk 30
targetSdk 33
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
jvmTarget = JavaVersion.VERSION_17.toString()
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion composeVersion
kotlinCompilerExtensionVersion = versionFor(project, AndroidX.compose.compiler)
}
}

dependencies {
implementation project(':lottie-compose')
implementation "androidx.appcompat:appcompat:$appcompatVersion"
implementation "androidx.activity:activity-compose:$activityVersion"
implementation "androidx.compose.ui:ui:$composeVersion"
implementation "androidx.compose.material:material:$composeVersion"
implementation "androidx.compose.material:material-icons-extended:$composeVersion"
implementation "androidx.compose.ui:ui-tooling:$composeVersion"
implementation libs.androidx.appcompat
implementation libs.androidx.activity.compose
implementation platform(libs.compose.bom)
implementation libs.compose.ui
implementation libs.compose.material
implementation libs.compose.material.icons.extended
implementation libs.compose.ui.tooling
}
4 changes: 3 additions & 1 deletion issue-repro-compose/src/main/AndroidManifest.xml
Expand Up @@ -6,7 +6,9 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<activity android:name=".ComposeIssueReproActivity">
<activity
android:name=".ComposeIssueReproActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
11 changes: 6 additions & 5 deletions issue-repro/build.gradle
Expand Up @@ -4,17 +4,18 @@ plugins {
}

android {
compileSdk 31
namespace 'com.airbnb.lottie.issues'
compileSdk 33
defaultConfig {
applicationId "com.airbnb.lottie.issues"
minSdk 16
targetSdk 30
targetSdk 33
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
buildFeatures {
viewBinding true
Expand All @@ -23,5 +24,5 @@ android {

dependencies {
implementation project(':lottie')
implementation "androidx.appcompat:appcompat:$appcompatVersion"
implementation libs.androidx.appcompat
}
7 changes: 4 additions & 3 deletions issue-repro/src/main/AndroidManifest.xml
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.airbnb.lottie.issues">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<activity android:name=".IssueReproActivity">
<activity
android:name=".IssueReproActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
20 changes: 20 additions & 0 deletions lint.xml
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Generated by `./gradlew refreshVersions` to avoid errors when using _ as a version. -->
<issue id="GradlePluginVersion" severity="ignore" />
<issue id="GradleDependency" severity="ignore" />
<!-- There are no plans to 18n this app right now -->
<issue id="RtlSymmetry" severity="ignore" />
<issue id="RtlHardcoded" severity="ignore" />
<issue id="HardcodedText" severity="ignore" />
<issue id="LabelFor" severity="ignore" />
<issue id="ContentDescription" severity="ignore" />
<issue id="Autofill" severity="ignore" />
<issue id="NotificationPermission">
<!-- https://github.com/bumptech/glide/issues/4940 -->
<ignore regexp="com.bumptech.glide.request.target.NotificationTarget" />
</issue>
<issue id="MonochromeLauncherIcon" severity="ignore" />
<issue id="VectorPath" severity="ignore" />
<issue id="Overdraw" severity="ignore" />
</lint>

0 comments on commit 486930a

Please sign in to comment.