Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to switch between versions of the SDK #428

Merged
merged 2 commits into from
Jun 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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) }
"snapshot" -> version { strictly(Dependencies.Versions.jellyfinSdkSnapshot) }
"unstable-snapshot" -> version { strictly(Dependencies.Versions.jellyfinSdkSnapshotUnstable) }
}
}
implementation(Dependencies.Network.okHttp)
Expand Down
8 changes: 7 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ 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")
includeVersionByRegex(Dependencies.Groups.jellyfin, ".*", Dependencies.Versions.jellyfinSdkSnapshot)
includeVersionByRegex(Dependencies.Groups.jellyfin, ".*", Dependencies.Versions.jellyfinSdkSnapshotUnstable)
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ object Dependencies {

// Network
const val jellyfinSdk = "1.0.0-beta.8"
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"

Expand Down
8 changes: 6 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@ android.enableJetifier=true
kotlin.code.style=official
# Kotlin version for this project
kotlinVersion=1.5.10
# Use snapshot release of Jellyfin SDK
useSdkSnapshot=false
# Allow using snapshot releases of Jellyfin SDK. Possible values are:
# - "default"
# - "local" (local Maven repository)
# - "snapshot" (SDK master)
# - "unstable-snapshot" (SDK with unstable Jellyfin API)
sdk.version=default