Add dependency substitution for the apiclient

Add "enable.dependency.substitution=true" to local.properties to enable
This commit is contained in:
Niels van Velzen
2020-09-12 09:48:42 +02:00
parent 927f201ec4
commit 63d141d0eb
+20
View File
@@ -9,3 +9,23 @@ pluginManagement {
}
}
}
// Load properties from local.properties
val properties = java.util.Properties().apply {
val location = file("local.properties")
if (location.exists())
load(location.inputStream())
}
// Get value for dependency substitution
val enableDependencySubstitution = properties.getProperty("enable.dependency.substitution", "true").equals("true", true)
// Replace apiclient dependency with local version
val apiclientLocation = "../jellyfin-apiclient-java"
if (File(apiclientLocation).exists() && enableDependencySubstitution) {
includeBuild(apiclientLocation) {
dependencySubstitution {
substitute(module("org.jellyfin.apiclient:android")).with(project(":android"))
}
}
}