Skip to content

Commit

Permalink
Migrate from dependencies file to version catalog (livekit#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidliu authored Feb 26, 2024
1 parent 105d39f commit 760c536
Show file tree
Hide file tree
Showing 10 changed files with 138 additions and 127 deletions.
56 changes: 0 additions & 56 deletions deps.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,63 +10,7 @@ ext {
targetVersion : 34,
minVersion : 21,
]
versions = [
androidx_core : "1.10.1",
androidx_lifecycle: "2.5.1",
autoService : '1.0.1',
coroutines : "1.6.0",
dagger : "2.46",
groupie : "2.9.0",
junit : "4.13.2",
junitJupiter : "5.5.0",
lint : "30.0.1",
serialization : "1.5.0",
protobuf : "3.22.0",
]
generated = [
protoSrc: "$projectDir/protocol",
]
deps = [
androidx : [
'annotation' : 'androidx.annotation:annotation:1.6.0',
'activity_compose' : 'androidx.activity:activity-compose:1.7.1',
'constraintlayout_compose': "androidx.constraintlayout:constraintlayout-compose:1.0.1",
],
auto : [
'service' : "com.google.auto.service:auto-service:${versions.autoService}",
'serviceAnnotations': "com.google.auto.service:auto-service-annotations:${versions.autoService}",
],
coroutines : [
"lib" : "org.jetbrains.kotlinx:kotlinx-coroutines-android:${versions.coroutines}",
"test": "org.jetbrains.kotlinx:kotlinx-coroutines-test: ${versions.coroutines}",
],
compose : [
"bom": "androidx.compose:compose-bom:2023.04.01",
],
timber : "com.github.ajalt:timberkt:1.5.1",

// lint
lint : "com.android.tools.lint:lint:${versions.lint}",
lintApi : "com.android.tools.lint:lint-api:${versions.lint}",
lintChecks : "com.android.tools.lint:lint-checks:${versions.lint}",
lintTests : "com.android.tools.lint:lint-tests:${versions.lint}",

// tests
androidx_test : [
"core" : 'androidx.test:core:1.5.0',
"junit": "androidx.test.ext:junit:1.1.5",
],
espresso : 'androidx.test.espresso:espresso-core:3.5.1',
junit : "junit:junit:${versions.junit}",
junitJupiterApi : "org.junit.jupiter:junit-jupiter-api:${versions.junitJupiter}",
junitJupiterEngine: "org.junit.jupiter:junit-jupiter-engine:${versions.junitJupiter}",
mockito : [
"core" : 'org.mockito:mockito-core:4.0.0',
"kotlin": "org.mockito.kotlin:mockito-kotlin:4.0.0",
],
robolectric : 'org.robolectric:robolectric:4.10.2',
turbine : 'app.cash.turbine:turbine:1.0.0',
]
annotations = [
]
}
10 changes: 5 additions & 5 deletions examples/selfie-segmentation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ dependencies {

api project(":livekit-android-sdk")

api "androidx.core:core-ktx:${versions.androidx_core}"
api "androidx.core:core-ktx:${libs.versions.androidx.core.get()}"
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.11.0'
api deps.coroutines.lib
api "androidx.lifecycle:lifecycle-runtime-ktx:${versions.androidx_lifecycle}"
api "androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.androidx_lifecycle}"
api "androidx.lifecycle:lifecycle-common-java8:${versions.androidx_lifecycle}"
api libs.coroutines.lib
api "androidx.lifecycle:lifecycle-runtime-ktx:${libs.versions.androidx.lifecycle.get()}"
api "androidx.lifecycle:lifecycle-viewmodel-ktx:${libs.versions.androidx.lifecycle.get()}"
api "androidx.lifecycle:lifecycle-common-java8:${libs.versions.androidx.lifecycle.get()}"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
Expand Down
67 changes: 67 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[versions]
webrtc = "114.5735.07"

androidJainSipRi = "1.3.0-91"
androidx-core = "1.10.1"
androidx-lifecycle = "2.5.1"
audioswitch = "89582c47c9a04c62f90aa5e57251af4800a62c9a"
autoService = '1.0.1'
coroutines = "1.6.0"
dagger = "2.46"
groupie = "2.9.0"
junit-lib = "4.13.2"
junit-jupiter = "5.5.0"
kotlinx-serialization = "1.5.0"
lint = "30.0.1"
okhttp = "4.12.0"
protobuf = "3.22.0"
protobufJavalite = "3.22.0"
semver4j = "3.1.0"

[libraries]
android-jain-sip-ri = { module = "javax.sip:android-jain-sip-ri", version.ref = "androidJainSipRi" }
androidx-core = { module = "androidx.core:core", version.ref = "androidx-core" }
audioswitch = { module = "com.github.davidliu:audioswitch", version.ref = "audioswitch" }
dagger-lib = { module = "com.google.dagger:dagger", version.ref = "dagger" }
dagger-compiler = { module = "com.google.dagger:dagger-compiler", version.ref = "dagger" }
groupie = { module = "com.github.lisawray.groupie:groupie", version.ref = "groupie" }
groupie-viewbinding = { module = "com.github.lisawray.groupie:groupie-viewbinding", version.ref = "groupie" }
androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidx-lifecycle" }
androidx-lifecycle-common-java8 = { module = "androidx.lifecycle:lifecycle-common-java8", version.ref = "androidx-lifecycle" }
androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
protobuf-javalite = { module = "com.google.protobuf:protobuf-javalite", version.ref = "protobufJavalite" }
semver4j = { module = "com.vdurmont:semver4j", version.ref = "semver4j" }
webrtc = { module = "io.github.webrtc-sdk:android-prefixed", version.ref = "webrtc" }

androidx-annotation = { module = "androidx.annotation:annotation", version = "1.6.0" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version = "1.7.1" }
androidx-constraintlayout-compose = { module = "androidx.constraintlayout:constraintlayout-compose", version = "1.0.1" }
auto-service-compiler = { module = "com.google.auto.service:auto-service", version.ref = "autoService" }
auto-service-annotations = { module = "com.google.auto.service:auto-service-annotations", version.ref = "autoService" }
coroutines-lib = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" }
coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
compose-bom = "androidx.compose:compose-bom:2023.04.01"
timber = { module = "com.github.ajalt:timberkt", version = "1.5.1" }

# Lint
lint-lib = { module = "com.android.tools.lint:lint", version.ref = "lint" }
lint-api = { module = "com.android.tools.lint:lint-api", version.ref = "lint" }
lint-checks = { module = "com.android.tools.lint:lint-checks", version.ref = "lint" }
lint-tests = { module = "com.android.tools.lint:lint-tests", version.ref = "lint" }

# Test libs
androidx-test-core = { module = "androidx.test:core", version = "1.5.0" }
androidx-test-junit = { module = "androidx.test.ext:junit", version = "1.1.5" }
espresso = { module = "androidx.test.espresso:espresso-core", version = "3.5.1" }
junit = { module = "junit:junit", version.ref = "junit-lib" }
junitJupiterApi = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit-jupiter" }
junitJupiterEngine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit-jupiter" }
mockito-core = { module = "org.mockito:mockito-core", version = "4.0.0" }
mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version = "4.0.0" }
robolectric = { module = "org.robolectric:robolectric", version = "4.10.2" }
turbine = { module = "app.cash.turbine:turbine", version = "1.0.0" }

[plugins]

48 changes: 24 additions & 24 deletions livekit-android-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ protobuf {
protoc {
// for apple m1, please add protoc_platform=osx-x86_64 in $HOME/.gradle/gradle.properties
if (project.hasProperty('protoc_platform')) {
artifact = "com.google.protobuf:protoc:${versions.protobuf}:${protoc_platform}"
artifact = "com.google.protobuf:protoc:${libs.versions.protobuf.get()}:${protoc_platform}"
} else {
artifact = "com.google.protobuf:protoc:${versions.protobuf}"
artifact = "com.google.protobuf:protoc:${libs.versions.protobuf.get()}"
}
}

Expand Down Expand Up @@ -141,35 +141,35 @@ dokkaHtml {
dependencies {
//api fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation deps.coroutines.lib
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:${versions.serialization}"
api 'io.github.webrtc-sdk:android-prefixed:114.5735.07'
api "com.squareup.okhttp3:okhttp:4.12.0"
api 'com.github.davidliu:audioswitch:89582c47c9a04c62f90aa5e57251af4800a62c9a'
implementation deps.androidx.annotation
implementation "androidx.core:core:${versions.androidx_core}"
implementation "com.google.protobuf:protobuf-javalite:${versions.protobuf}"
implementation libs.coroutines.lib
implementation libs.kotlinx.serialization.json
api libs.webrtc
api libs.okhttp
api libs.audioswitch
implementation libs.androidx.annotation
implementation libs.androidx.core
implementation libs.protobuf.javalite

implementation 'javax.sip:android-jain-sip-ri:1.3.0-91'
implementation libs.android.jain.sip.ri

implementation "com.google.dagger:dagger:${versions.dagger}"
kapt "com.google.dagger:dagger-compiler:${versions.dagger}"
implementation libs.dagger.lib
kapt libs.dagger.compiler

implementation deps.timber
implementation 'com.vdurmont:semver4j:3.1.0'
implementation libs.timber
implementation libs.semver4j

lintChecks project(':livekit-lint')
lintPublish project(':livekit-lint')

testImplementation deps.junit
testImplementation deps.robolectric
testImplementation deps.mockito.core
testImplementation deps.mockito.kotlin
testImplementation deps.androidx_test.core
testImplementation deps.coroutines.test
kaptTest "com.google.dagger:dagger-compiler:${versions.dagger}"
androidTestImplementation deps.androidx_test.junit
androidTestImplementation deps.espresso
testImplementation libs.junit
testImplementation libs.robolectric
testImplementation libs.mockito.core
testImplementation libs.mockito.kotlin
testImplementation libs.androidx.test.core
testImplementation libs.coroutines.test
kaptTest libs.dagger.compiler
androidTestImplementation libs.androidx.test.junit
androidTestImplementation libs.espresso
}

apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
Expand Down
20 changes: 10 additions & 10 deletions livekit-lint/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ dependencies {

compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// used for lint rules
compileOnly deps.lintApi
compileOnly deps.lintChecks
compileOnly deps.lintTests
compileOnly libs.lint.api
compileOnly libs.lint.checks
compileOnly libs.lint.tests

// Handle creating manifests for lint checker
compileOnly deps.auto.serviceAnnotations
kapt deps.auto.service
compileOnly libs.auto.service.annotations
kapt libs.auto.service.compiler

// test lint
testImplementation deps.lint
testImplementation deps.lintTests
testImplementation libs.lint.lib
testImplementation libs.lint.tests

compileOnly "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
// test runners
testImplementation deps.junit
testImplementation deps.junitJupiterApi
testRuntimeOnly deps.junitJupiterEngine
testImplementation libs.junit
testImplementation libs.junitJupiterApi
testRuntimeOnly libs.junitJupiterEngine
}
test {
environment "LINT_TEST_KOTLINC", ""
Expand Down
8 changes: 4 additions & 4 deletions sample-app-basic/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ dependencies {
// implementation "io.livekit:livekit-android:<version>"
implementation project(":livekit-android-sdk")

implementation "androidx.core:core-ktx:${versions.androidx_core}"
implementation "androidx.core:core-ktx:1.10.1"
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation "androidx.activity:activity-ktx:1.5.1"
implementation 'androidx.fragment:fragment-ktx:1.5.1'
implementation "androidx.viewpager2:viewpager2:1.0.0"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:${versions.androidx_lifecycle}"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.androidx_lifecycle}"
implementation "androidx.lifecycle:lifecycle-common-java8:${versions.androidx_lifecycle}"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.5.1"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
implementation "androidx.lifecycle:lifecycle-common-java8:2.5.1"
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

Expand Down
14 changes: 7 additions & 7 deletions sample-app-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ dependencies {
// api "io.livekit:livekit-android:<version>"
api project(":livekit-android-sdk")

api "androidx.core:core-ktx:${versions.androidx_core}"
api "androidx.core:core-ktx:${libs.versions.androidx.core.get()}"
api 'androidx.appcompat:appcompat:1.4.0'
api 'com.google.android.material:material:1.4.0'
api deps.coroutines.lib
api deps.timber
api "androidx.lifecycle:lifecycle-runtime-ktx:${versions.androidx_lifecycle}"
api "androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.androidx_lifecycle}"
api "androidx.lifecycle:lifecycle-common-java8:${versions.androidx_lifecycle}"
api "com.google.protobuf:protobuf-javalite:${versions.protobuf}"
api libs.coroutines.lib
api libs.timber
api "androidx.lifecycle:lifecycle-runtime-ktx:${libs.versions.androidx.lifecycle.get()}"
api "androidx.lifecycle:lifecycle-viewmodel-ktx:${libs.versions.androidx.lifecycle.get()}"
api "androidx.lifecycle:lifecycle-common-java8:${libs.versions.androidx.lifecycle.get()}"
api libs.protobuf.javalite
api 'androidx.preference:preference-ktx:1.1.1'
// debugImplementation because LeakCanary should only run in debug builds.
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1'
Expand Down
14 changes: 7 additions & 7 deletions sample-app-compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,22 @@ dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation deps.coroutines.lib
implementation "androidx.core:core-ktx:${versions.androidx_core}"
implementation libs.coroutines.lib
implementation libs.androidx.core
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.0-rc01"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:${versions.androidx_lifecycle}"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.androidx_lifecycle}"
implementation "androidx.lifecycle:lifecycle-common-java8:${versions.androidx_lifecycle}"
implementation 'androidx.activity:activity-compose:1.3.1'
implementation "androidx.lifecycle:lifecycle-runtime-ktx:${libs.versions.androidx.lifecycle.get()}"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${libs.versions.androidx.lifecycle.get()}"
implementation "androidx.lifecycle:lifecycle-common-java8:${libs.versions.androidx.lifecycle.get()}"
implementation libs.androidx.activity.compose
implementation 'com.google.accompanist:accompanist-pager:0.19.0'
implementation 'com.google.accompanist:accompanist-pager-indicators:0.19.0'
implementation deps.timber
implementation libs.timber
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
Expand Down
16 changes: 8 additions & 8 deletions sample-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation deps.coroutines.lib
implementation libs.coroutines.lib
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation "androidx.core:core-ktx:${versions.androidx_core}"
implementation libs.androidx.core
implementation "androidx.activity:activity-ktx:1.5.1"
implementation 'androidx.fragment:fragment-ktx:1.5.1'
implementation "androidx.viewpager2:viewpager2:1.0.0"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:${versions.androidx_lifecycle}"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.androidx_lifecycle}"
implementation "androidx.lifecycle:lifecycle-common-java8:${versions.androidx_lifecycle}"
implementation libs.androidx.lifecycle.runtime.ktx
implementation libs.androidx.lifecycle.viewmodel.ktx
implementation libs.androidx.lifecycle.common.java8
implementation 'com.google.android.material:material:1.6.1'
implementation "com.github.lisawray.groupie:groupie:${versions.groupie}"
implementation "com.github.lisawray.groupie:groupie-viewbinding:${versions.groupie}"
implementation deps.timber
implementation libs.groupie
implementation libs.groupie.viewbinding
implementation libs.timber
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
Expand Down
12 changes: 6 additions & 6 deletions video-encode-decode-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,22 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation deps.coroutines.lib
implementation "androidx.core:core-ktx:${versions.androidx_core}"
implementation libs.coroutines.lib
implementation "androidx.core:core-ktx:${libs.versions.androidx.core.get()}"
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.0-rc01"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:${versions.androidx_lifecycle}"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.androidx_lifecycle}"
implementation "androidx.lifecycle:lifecycle-common-java8:${versions.androidx_lifecycle}"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:${libs.versions.androidx.lifecycle.get()}"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${libs.versions.androidx.lifecycle.get()}"
implementation "androidx.lifecycle:lifecycle-common-java8:${libs.versions.androidx.lifecycle.get()}"
implementation 'androidx.activity:activity-compose:1.3.1'
implementation 'com.google.accompanist:accompanist-pager:0.19.0'
implementation 'com.google.accompanist:accompanist-pager-indicators:0.19.0'
implementation deps.timber
implementation libs.timber
implementation project(":sample-app-common")
implementation project(":livekit-android-sdk")
testImplementation 'junit:junit:4.+'
Expand Down

0 comments on commit 760c536

Please sign in to comment.