Add snapshot repository for Jellyfin SDK (#374)

* Add snapshot repository for Jellyfin SDK

* Use maven repo shorthand
This commit is contained in:
Max Rumpf
2021-05-10 20:22:01 +00:00
committed by GitHub
parent f94f0804d8
commit bc8aa354b8
5 changed files with 22 additions and 25 deletions
+9 -1
View File
@@ -1,3 +1,4 @@
import com.android.build.gradle.options.parseBoolean
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import com.github.benmanes.gradle.versions.updates.gradle.GradleReleaseChannel
import io.gitlab.arturbosch.detekt.Detekt
@@ -126,7 +127,14 @@ dependencies {
kapt(Dependencies.Room.compiler)
// Network
implementation(Dependencies.Network.jellyfinSdk)
val useSdkSnapshot: String by project
implementation(Dependencies.Network.jellyfinSdk) {
version {
if (parseBoolean("useSdkSnapshot", useSdkSnapshot)) {
strictly(Dependencies.Versions.jellyfinSdkSnapshot)
}
}
}
implementation(Dependencies.Network.okHttp)
implementation(Dependencies.Network.coil)
implementation(Dependencies.Network.exoPlayerHLS)
+5
View File
@@ -17,6 +17,11 @@ allprojects {
repositories {
mavenCentral()
google()
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") {
content {
includeGroup(Dependencies.Groups.jellyfin)
}
}
}
}
+6 -1
View File
@@ -29,6 +29,7 @@ object Dependencies {
// Network
const val jellyfinSdk = "1.0.0-beta.4"
const val jellyfinSdkSnapshot = "latest-SNAPSHOT"
const val okHttp = "4.9.1"
const val coil = "1.1.1"
@@ -51,6 +52,10 @@ object Dependencies {
const val androidDesugarLibs = "1.1.5"
}
object Groups {
const val jellyfin = "org.jellyfin.sdk"
}
object Kotlin {
val coroutinesCore = kotlinx("coroutines-core", Versions.coroutines)
val coroutinesAndroid = kotlinx("coroutines-android", Versions.coroutines)
@@ -89,7 +94,7 @@ object Dependencies {
}
object Network {
const val jellyfinSdk = "org.jellyfin.sdk:jellyfin-platform-android:${Versions.jellyfinSdk}"
const val jellyfinSdk = "${Groups.jellyfin}:jellyfin-platform-android:${Versions.jellyfinSdk}"
const val okHttp = "com.squareup.okhttp3:okhttp:${Versions.okHttp}"
const val coil = "io.coil-kt:coil-base:${Versions.coil}"
val exoPlayerHLS = exoPlayer("hls")
+2
View File
@@ -20,3 +20,5 @@ android.enableJetifier=true
kotlin.code.style=official
# Kotlin version for this project
kotlinVersion=1.5.0
# Use snapshot release of Jellyfin SDK
useSdkSnapshot=false
-23
View File
@@ -1,5 +1,3 @@
import java.util.*
include(":app")
pluginManagement {
@@ -11,24 +9,3 @@ pluginManagement {
}
}
}
// Load properties from local.properties
val properties = Properties().apply {
val propFile = File("local.properties")
if (propFile.exists()) {
load(propFile.inputStream())
}
}
// Check if dependency substitution is enabled
val enableDependencySubstitution = properties.getProperty("enable.dependency.substitution", "true").equals("true", true)
// Replace SDK dependency with local version
val sdkLocation = "../jellyfin-sdk-kotlin"
if (File(sdkLocation).exists() && enableDependencySubstitution) {
includeBuild(sdkLocation) {
dependencySubstitution {
substitute(module("org.jellyfin.sdk:jellyfin-platform-android")).with(project(":jellyfin-platform-android"))
}
}
}