From 3a4da4da5c6349e5811f92184cac83abede44c3d Mon Sep 17 00:00:00 2001 From: Mark Raynsford Date: Wed, 11 Oct 2023 15:43:11 +0000 Subject: [PATCH 1/3] Copy android-http build script. --- build.gradle.kts | 64 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 57 insertions(+), 7 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index c7bd9de..b44be02 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" } /* From 9d096181279e26a884e60738de1108dd4b1d3c3f Mon Sep 17 00:00:00 2001 From: Mark Raynsford Date: Wed, 11 Oct 2023 15:46:05 +0000 Subject: [PATCH 2/3] Update CI scripts. --- .ci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci b/.ci index 6f5cc7d..e8a4c8f 160000 --- a/.ci +++ b/.ci @@ -1 +1 @@ -Subproject commit 6f5cc7da9dec1dfda656893f827ba71ced946636 +Subproject commit e8a4c8f43974112581c2da0519074e8abae7d5fa From ad30c64acbacc04b4759a3339fc5805305a643b3 Mon Sep 17 00:00:00 2001 From: Mark Raynsford Date: Wed, 11 Oct 2023 15:59:15 +0000 Subject: [PATCH 3/3] Close changelog --- README-CHANGES.xml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README-CHANGES.xml b/README-CHANGES.xml index d569906..a354b45 100644 --- a/README-CHANGES.xml +++ b/README-CHANGES.xml @@ -4,17 +4,10 @@ - - - - - - + - - - - + + @@ -23,16 +16,23 @@ - + - - + - + - + + + + + + + + +