From 63d141d0ebd0a2b0a8388297a657267d9e01847d Mon Sep 17 00:00:00 2001 From: Niels van Velzen Date: Sat, 12 Sep 2020 09:48:42 +0200 Subject: [PATCH] Add dependency substitution for the apiclient Add "enable.dependency.substitution=true" to local.properties to enable --- settings.gradle.kts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/settings.gradle.kts b/settings.gradle.kts index 8129c838..0abb01d3 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -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")) + } + } +}