Skip to content

Commit

Permalink
Use palace LCP artifacts.
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed Oct 25, 2024
1 parent e8ee010 commit 31d4968
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 31 deletions.
37 changes: 7 additions & 30 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ dependencyResolutionManagement {
val credentialsPath =
propertyOptional("org.thepalaceproject.app.credentials.palace")

if (lcpDRMEnabled && !s3RepositoryEnabled) {
throw GradleException(
"If the org.thepalaceproject.lcp.enabled property is set to true, " +
"the org.thepalaceproject.s3.depend property must also be set to true."
)
}

/*
* The set of repositories used to resolve library dependencies. The order is significant!
*/
Expand Down Expand Up @@ -184,36 +191,6 @@ dependencyResolutionManagement {
}
}

/*
* Enable access to various credentials-gated elements.
*/

if (lcpDRMEnabled) {
val filePath: String =
when (val lcpProfile = property("org.thepalaceproject.lcp.profile")) {
"prod", "test" -> {
"${credentialsPath}/LCP/Android/build_lcp_${lcpProfile}.properties"
}
else -> {
throw GradleException("Unrecognized LCP profile: $lcpProfile")
}
}

val lcpProperties = Properties()
lcpProperties.load(File(filePath).inputStream())

ivy {
name = "LCP"
url = uri(lcpProperties.getProperty("org.thepalaceproject.lcp.repositoryURI"))
patternLayout {
artifact(lcpProperties.getProperty("org.thepalaceproject.lcp.repositoryLayout"))
}
metadataSources {
artifact()
}
}
}

/*
* Obsolete dependencies.
*/
Expand Down
2 changes: 1 addition & 1 deletion simplified-app-palace/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ dependencies {
*/

if (lcpDRM) {
implementation(libs.readium.lcp) {
implementation(libs.palace.liblcp) {
artifact {
type = "aar"
}
Expand Down

0 comments on commit 31d4968

Please sign in to comment.