Skip to content

Commit

Permalink
Updated dependencies & migrated to version catalogs (#812)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianwernick authored Dec 15, 2024
1 parent ad8500e commit 9fcb37a
Show file tree
Hide file tree
Showing 16 changed files with 343 additions and 195 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
bin/
gen/
.idea/
.kotlin/
*.iml
*.ipr
*.iws
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ fun onPrepared() {

License
-------
Copyright 2015-2023 ExoMedia Contributors
Copyright 2015-2024 ExoMedia Contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
15 changes: 7 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
buildscript {
ext.kotlinVersion = '1.9.20'
repositories {
mavenCentral()
google()
}

dependencies {
classpath 'com.android.tools.build:gradle:8.1.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath libs.android.gradle
classpath libs.kotlin.gradle
}
}

plugins {
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
alias libs.plugins.android.application apply false
alias libs.plugins.android.library apply false
alias libs.plugins.compose.compiler apply false
alias libs.plugins.kotlin.android apply false
alias libs.plugins.nexus.publish
}

apply from: './gradle/util/testOutput.gradle'

ext {
media3Version = "1.2.0"
}

allprojects {
repositories {
mavenCentral()
Expand Down
69 changes: 35 additions & 34 deletions demo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,55 +1,54 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

ext {
composeVersion = "1.5.4"
composeCompilerVersion = "1.5.4"
plugins {
alias libs.plugins.android.application
alias libs.plugins.kotlin.android
alias libs.plugins.compose.compiler
}

dependencies {
implementation project(':library')

// ExoPlayer
implementation "androidx.media3:media3-ui:$rootProject.ext.media3Version" // Subtitles
implementation "androidx.media3:media3-datasource-okhttp:$rootProject.ext.media3Version" // Custom HTTP
implementation libs.media3.ui // Subtitles
implementation libs.media3.datasource.okhttp // Custom HTTP

// Misc
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.media:media:1.7.0'
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
implementation libs.core.ktx
implementation libs.appcompat
implementation libs.media
implementation libs.constraintlayout

// Jetpack Compose UI
implementation "androidx.compose.ui:ui:$composeVersion"
implementation "androidx.compose.ui:ui-tooling:$composeVersion"
implementation "androidx.compose.ui:ui-tooling-preview:$composeVersion"
implementation "androidx.compose.material:material:$composeVersion"
implementation "androidx.compose.material:material-icons-core:$composeVersion"
implementation "androidx.compose.material:material-icons-extended:$composeVersion"
implementation 'androidx.activity:activity-compose:1.8.1'
implementation "androidx.navigation:navigation-compose:2.7.5"
implementation "com.google.accompanist:accompanist-navigation-animation:0.32.0"
implementation libs.ui
implementation libs.ui.tooling
implementation libs.ui.tooling.preview
implementation libs.material
implementation libs.material.icons.core
implementation libs.material.icons.extended
implementation libs.activity.compose
implementation libs.navigation.compose


// Image Loading
implementation 'com.github.bumptech.glide:glide:4.16.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
implementation libs.glide
annotationProcessor libs.compiler

// Playlist support
implementation 'com.devbrackets.android:playlistcore:2.1.0'
implementation libs.playlistcore

// Memory Leak diagnostics
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
// debugImplementation libs.leakcanary.android
}

android {
namespace 'com.devbrackets.android.exomediademo'
compileSdk 34
compileSdk 35

defaultConfig {
applicationId "com.devbrackets.android.exomediademo"
minSdkVersion 21
targetSdkVersion 34
targetSdkVersion 35
versionCode 1
versionName "1.0.0"
}
Expand All @@ -58,25 +57,27 @@ android {
main.java.srcDirs += "src/main/kotlin"
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}

buildFeatures {
compose true
viewBinding true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

composeOptions {
kotlinCompilerExtensionVersion composeCompilerVersion
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11
}

lint {
abortOnError false
}
}

kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.navigation.NavType
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import androidx.navigation.navArgument
import com.devbrackets.android.exomediademo.R
import com.devbrackets.android.exomediademo.data.Samples
Expand All @@ -18,8 +20,6 @@ import com.devbrackets.android.exomediademo.ui.media.AudioPlayerActivity
import com.devbrackets.android.exomediademo.ui.media.VideoPlayerActivity
import com.devbrackets.android.exomediademo.ui.support.DemoNavHost
import com.devbrackets.android.exomediademo.util.getEnumArg
import com.google.accompanist.navigation.animation.composable
import com.google.accompanist.navigation.animation.rememberAnimatedNavController

@ExperimentalAnimationApi
class SelectionActivity : AppCompatActivity() {
Expand All @@ -32,7 +32,7 @@ class SelectionActivity : AppCompatActivity() {

@Composable
fun Content() {
val navController = rememberAnimatedNavController()
val navController = rememberNavController()

DemoNavHost(
navController = navController,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.devbrackets.android.exomediademo.ui.support

import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.animation.core.FastOutSlowInEasing
import androidx.compose.animation.core.tween
import androidx.compose.animation.slideInHorizontally
Expand All @@ -9,7 +8,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
import com.google.accompanist.navigation.animation.AnimatedNavHost
import androidx.navigation.compose.NavHost

private const val ANIMATION_DURATION = 300

Expand Down Expand Up @@ -46,15 +45,14 @@ private val popExitTransition = slideOutHorizontally(
)

@Composable
@OptIn(ExperimentalAnimationApi::class)
fun DemoNavHost(
navController: NavHostController,
startDestination: String,
modifier: Modifier = Modifier,
route: String? = null,
builder: NavGraphBuilder.() -> Unit
) {
AnimatedNavHost(
NavHost(
navController = navController,
startDestination = startDestination,
modifier = modifier,
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false
android.nonTransitiveRClass=false
android.useAndroidX=true
Expand Down
56 changes: 56 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[versions]
activityCompose = "1.9.3"
androidGradlePlugin = "8.7.3"
appcompat = "1.7.0"
compiler = "4.12.0"
constraintlayout = "2.2.0"
coreKtx = "1.15.0"
glide = "4.16.0"
junit = "4.13.2"
kotlin = "2.0.20"
leakcanaryAndroid = "2.7"
material = "1.7.6"
media = "1.7.0"
media3Exoplayer = "1.5.0"
navigationCompose = "2.8.5"
nexusPublish = "1.1.0"
playlistcore = "2.1.0"
robolectric = "4.13"
composeUi = "1.7.6"

[libraries]
activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activityCompose" }
android-gradle = { module = "com.android.tools.build:gradle", version.ref = "androidGradlePlugin" }
appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
compiler = { module = "com.github.bumptech.glide:compiler", version.ref = "compiler" }
constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" }
glide = { module = "com.github.bumptech.glide:glide", version.ref = "glide" }
junit = { module = "junit:junit", version.ref = "junit" }
kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-stdlib-jdk7 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk7", version.ref = "kotlin" }
leakcanary-android = { module = "com.squareup.leakcanary:leakcanary-android", version.ref = "leakcanaryAndroid" }
material = { module = "androidx.compose.material:material", version.ref = "material" }
material-icons-core = { module = "androidx.compose.material:material-icons-core", version.ref = "material" }
material-icons-extended = { module = "androidx.compose.material:material-icons-extended", version.ref = "material" }
media = { module = "androidx.media:media", version.ref = "media" }
media3-datasource-okhttp = { module = "androidx.media3:media3-datasource-okhttp", version.ref = "media3Exoplayer" }
media3-exoplayer = { module = "androidx.media3:media3-exoplayer", version.ref = "media3Exoplayer" }
media3-exoplayer-dash = { module = "androidx.media3:media3-exoplayer-dash", version.ref = "media3Exoplayer" }
media3-exoplayer-hls = { module = "androidx.media3:media3-exoplayer-hls", version.ref = "media3Exoplayer" }
media3-exoplayer-smoothstreaming = { module = "androidx.media3:media3-exoplayer-smoothstreaming", version.ref = "media3Exoplayer" }
media3-ui = { module = "androidx.media3:media3-ui", version.ref = "media3Exoplayer" }
navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigationCompose" }
playlistcore = { module = "com.devbrackets.android:playlistcore", version.ref = "playlistcore" }
robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" }
ui = { module = "androidx.compose.ui:ui", version.ref = "composeUi" }
ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "composeUi" }
ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "composeUi" }

[plugins]
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
nexus-publish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexusPublish" }

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 9fcb37a

Please sign in to comment.