Skip to content

Commit

Permalink
Merge branch 'main' into feature/material-theme
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed Oct 12, 2023
2 parents 5f2584c + ad30c64 commit 34f05df
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .ci
30 changes: 15 additions & 15 deletions README-CHANGES.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,10 @@
<c:release date="2022-03-09T00:00:00+00:00" is-open="false" ticket-system="org.nypl.jira" version="1.0.1">
<c:changes/>
</c:release>
<c:release date="2022-08-13T00:00:00+00:00" is-open="false" ticket-system="org.nypl.jira" version="1.0.2">
<c:changes>
<c:change date="2022-05-03T00:00:00+00:00" summary="Update R2 libraries version"/>
</c:changes>
</c:release>
<c:release date="2022-12-08T00:00:00+00:00" is-open="false" ticket-system="org.nypl.jira" version="1.0.3">
<c:release date="2023-08-18T00:00:00+00:00" is-open="false" ticket-system="org.nypl.jira" version="2.0.0">
<c:changes>
<c:change date="2022-10-05T00:00:00+00:00" summary="Added content description to back button on reader screen"/>
<c:change date="2022-10-20T00:00:00+00:00" summary="Changed target version to Android 12."/>
<c:change date="2022-10-27T00:00:00+00:00" summary="Added back button to TOC screen."/>
<c:change date="2022-10-27T00:00:00+00:00" summary="Changed target version to Android 13."/>
<c:change date="2023-06-22T00:00:00+00:00" summary="Added message on bookmarks screen when there are no bookmarks."/>
<c:change date="2023-07-03T00:00:00+00:00" summary="Fixed bug of bookmark not being deleted right after being added."/>
</c:changes>
</c:release>
<c:release date="2023-03-14T00:00:00+00:00" is-open="false" ticket-system="org.nypl.jira" version="1.0.4">
Expand All @@ -23,16 +16,23 @@
<c:change date="2023-02-13T00:00:00+00:00" summary="Added support for book previews."/>
</c:changes>
</c:release>
<c:release date="2023-08-18T00:00:00+00:00" is-open="false" ticket-system="org.nypl.jira" version="2.0.0">
<c:release date="2022-08-13T00:00:00+00:00" is-open="false" ticket-system="org.nypl.jira" version="1.0.2">
<c:changes>
<c:change date="2023-06-22T00:00:00+00:00" summary="Added message on bookmarks screen when there are no bookmarks."/>
<c:change date="2023-07-03T00:00:00+00:00" summary="Fixed bug of bookmark not being deleted right after being added."/>
<c:change date="2022-05-03T00:00:00+00:00" summary="Update R2 libraries version"/>
</c:changes>
</c:release>
<c:release date="2023-10-06T09:12:42+00:00" is-open="true" ticket-system="org.nypl.jira" version="2.0.1">
<c:release date="2023-10-11T15:58:46+00:00" is-open="true" ticket-system="org.nypl.jira" version="2.1.0">
<c:changes>
<c:change date="2023-09-21T00:00:00+00:00" summary="Implemented searching feature on EPUBs."/>
<c:change date="2023-10-06T09:12:42+00:00" summary="Added highlighting feature to searching terms on EPUB pages."/>
<c:change date="2023-10-06T00:00:00+00:00" summary="Added highlighting feature to searching terms on EPUB pages."/>
</c:changes>
</c:release>
<c:release date="2022-12-08T00:00:00+00:00" is-open="false" ticket-system="org.nypl.jira" version="1.0.3">
<c:changes>
<c:change date="2022-10-05T00:00:00+00:00" summary="Added content description to back button on reader screen"/>
<c:change date="2022-10-20T00:00:00+00:00" summary="Changed target version to Android 12."/>
<c:change date="2022-10-27T00:00:00+00:00" summary="Added back button to TOC screen."/>
<c:change date="2022-10-27T00:00:00+00:00" summary="Changed target version to Android 13."/>
</c:changes>
</c:release>
</c:releases>
Expand Down
64 changes: 57 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ if (gradleVersionRequired != gradleVersionReceived) {
}

plugins {
signing

id("org.jetbrains.kotlin.jvm")
.version("1.9.0")
.apply(false)
Expand Down Expand Up @@ -104,6 +106,14 @@ fun property(
return project.extra[name] as String
}

fun propertyOptional(project: Project, name: String): String? {
val map = project.extra
if (map.has(name)) {
return map[name] as String?
}
return null
}

fun propertyInt(
project: Project,
name: String,
Expand All @@ -120,6 +130,15 @@ fun propertyBoolean(
return text.toBooleanStrict()
}

fun propertyBooleanOptional(
project: Project,
name: String,
defaultValue: Boolean,
): Boolean {
val value = propertyOptional(project, name) ?: return defaultValue
return value.toBooleanStrict()
}

/**
* Configure Maven publishing. Artifacts are published to a local directory
* so that they can be pushed to Maven Central in one step using brooklime.
Expand All @@ -138,6 +157,8 @@ fun configurePublishingFor(project: Project) {

val publishSources =
propertyBoolean(project, "org.thepalaceproject.build.publishSources")
val enableSigning =
propertyBooleanOptional(project, "org.thepalaceproject.build.enableSigning", true)

/*
* Create an empty JavaDoc jar. Required for Maven Central deployments.
Expand All @@ -148,28 +169,50 @@ fun configurePublishingFor(project: Project) {
this.archiveClassifier = "javadoc"
}

/*
* Create a publication. Note that the name of the publication must be unique across all
* modules, because the broken Gradle signing plugin will create a signing task for each
* one that, in the case of a name conflict, will silently overwrite the previous signing
* task.
*/

project.publishing {
publications {
create<MavenPublication>("MavenPublication") {
create<MavenPublication>("_${project.name}_MavenPublication") {
groupId = property(project, "GROUP")
artifactId = property(project, "POM_ARTIFACT_ID")
version = versionName

/*
* https://central.sonatype.org/publish/requirements/#sufficient-metadata
*/

pom {
name.set(property(project, "POM_NAME"))
description.set(property(project, "POM_DESCRIPTION"))
url.set(property(project, "POM_URL"))

scm {
connection.set(property(project, "POM_SCM_CONNECTION"))
developerConnection.set(property(project, "POM_SCM_DEV_CONNECTION"))
url.set(property(project, "POM_SCM_URL"))
}

licenses {
license {
name.set(property(project, "POM_LICENCE_NAME"))
url.set(property(project, "POM_LICENCE_URL"))
}
}

developers {
developer {
name.set("The Palace Project")
email.set("[email protected]")
organization.set("The Palace Project")
organizationUrl.set("https://thepalaceproject.org/")
}
}
}

artifact(taskJavadocEmpty)
Expand Down Expand Up @@ -244,6 +287,17 @@ fun configurePublishingFor(project: Project) {
task.dependsOn.add(taskSourcesEmpty)
}
}

/*
* Configure signing.
*/

if (enableSigning) {
signing {
useGpgCmd()
sign(project.publishing.publications)
}
}
}

/*
Expand Down Expand Up @@ -511,16 +565,12 @@ allprojects {
propertyInt(this, "org.thepalaceproject.build.androidSDKCompile")

android.defaultConfig {
versionName =
property(this@allprojects, "VERSION_NAME")
multiDexEnabled =
true
multiDexEnabled = true
targetSdk =
propertyInt(this@allprojects, "org.thepalaceproject.build.androidSDKTarget")
minSdk =
propertyInt(this@allprojects, "org.thepalaceproject.build.androidSDKMinimum")
testInstrumentationRunner =
"androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

/*
Expand Down

0 comments on commit 34f05df

Please sign in to comment.