diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 1d609c6d9d..68ee5037ac 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,4 +1,3 @@ -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 @@ -139,12 +138,13 @@ dependencies { kapt(Dependencies.Room.compiler) // Network - val useSdkSnapshot: String by project + val sdkVersion = findProperty("sdk.version")?.toString() implementation(Dependencies.Network.jellyfinSdk) { - version { - if (parseBoolean("useSdkSnapshot", useSdkSnapshot)) { - strictly(Dependencies.Versions.jellyfinSdkSnapshot) - } + // Change version if desired + when (sdkVersion) { + "local" -> version { strictly(Dependencies.Versions.jellyfinSdkLocal) } + "unstable-snapshot" -> version { strictly(Dependencies.Versions.jellyfinSdkSnapshotUnstable) } + "snapshot" -> version { strictly(Dependencies.Versions.jellyfinSdkSnapshot) } } } implementation(Dependencies.Network.okHttp) diff --git a/build.gradle.kts b/build.gradle.kts index df5cc28e35..614ac4526f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,6 +17,11 @@ allprojects { repositories { mavenCentral() google() + mavenLocal { + content { + includeVersionByRegex(Dependencies.Groups.jellyfin, ".*", Dependencies.Versions.jellyfinSdkLocal) + } + } maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") { content { includeVersionByRegex(Dependencies.Groups.jellyfin, ".*", ".*-SNAPSHOT") diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 68a607be3f..01dce777fc 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -29,7 +29,9 @@ object Dependencies { // Network const val jellyfinSdk = "1.0.0-beta.7" + const val jellyfinSdkLocal = "latest-SNAPSHOT" const val jellyfinSdkSnapshot = "master-SNAPSHOT" + const val jellyfinSdkSnapshotUnstable = "openapi-unstable-SNAPSHOT" const val okHttp = "4.9.1" const val coil = "1.1.1" diff --git a/gradle.properties b/gradle.properties index 9ec4c71cb3..4b51372874 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,4 +21,5 @@ kotlin.code.style=official # Kotlin version for this project kotlinVersion=1.5.10 # Use snapshot release of Jellyfin SDK -useSdkSnapshot=false +# Possible values "default", "snapshot" (master), "unstable-snapshot" (unstable api) or "local" (MavenLocal) +sdk.version=default