diff --git a/.ci b/.ci index 6f5cc7da9..e8a4c8f43 160000 --- a/.ci +++ b/.ci @@ -1 +1 @@ -Subproject commit 6f5cc7da9dec1dfda656893f827ba71ced946636 +Subproject commit e8a4c8f43974112581c2da0519074e8abae7d5fa diff --git a/README-CHANGES.xml b/README-CHANGES.xml index 065727614..cade7c391 100644 --- a/README-CHANGES.xml +++ b/README-CHANGES.xml @@ -298,7 +298,7 @@ - + @@ -329,7 +329,7 @@ - + diff --git a/build.gradle.kts b/build.gradle.kts index c7bd9de89..b44be027a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,6 +15,8 @@ if (gradleVersionRequired != gradleVersionReceived) { } plugins { + signing + id("org.jetbrains.kotlin.jvm") .version("1.9.0") .apply(false) @@ -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, @@ -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. @@ -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. @@ -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") { + create("_${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("info@thepalaceproject.org") + organization.set("The Palace Project") + organizationUrl.set("https://thepalaceproject.org/") + } + } } artifact(taskJavadocEmpty) @@ -244,6 +287,17 @@ fun configurePublishingFor(project: Project) { task.dependsOn.add(taskSourcesEmpty) } } + + /* + * Configure signing. + */ + + if (enableSigning) { + signing { + useGpgCmd() + sign(project.publishing.publications) + } + } } /* @@ -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" } /* diff --git a/gradle.properties b/gradle.properties index c7425d858..db8f21e07 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,7 @@ POM_SCM_CONNECTION=scm:git:git://github.com/ThePalaceProject/android-core POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/ThePalaceProject/android-core POM_SCM_URL=http://github.com/ThePalaceProject/android-core POM_URL=http://github.com/ThePalaceProject/android-core -VERSION_NAME=1.6.0-SNAPSHOT +VERSION_NAME=1.7.0-SNAPSHOT VERSION_CODE_BASE=70000 android.useAndroidX=true diff --git a/org.thepalaceproject.android.platform b/org.thepalaceproject.android.platform index 0ea1a8683..114105745 160000 --- a/org.thepalaceproject.android.platform +++ b/org.thepalaceproject.android.platform @@ -1 +1 @@ -Subproject commit 0ea1a8683a764926dd3e7d7081d8f36b59830d58 +Subproject commit 1141057459d944b4c2e3e3d8a4a9b5a1b629685b