From 0d6b7f1842a90bfefbe6f47725871a7d70ba31fb Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 8 Oct 2020 12:36:11 +0530 Subject: autofill-parser: flesh out generated POM file (#1140) Signed-off-by: Harsh Shandilya --- autofill-parser/build.gradle.kts | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'autofill-parser/build.gradle.kts') diff --git a/autofill-parser/build.gradle.kts b/autofill-parser/build.gradle.kts index e668a1f3..7f2a6467 100644 --- a/autofill-parser/build.gradle.kts +++ b/autofill-parser/build.gradle.kts @@ -39,10 +39,37 @@ afterEvaluate { } publications { create("apsMaven") { + fun getKey(propertyName: String): String { + return findProperty(propertyName)?.toString() ?: error("Failed to find property for $propertyName") + } + from(components.getByName("release")) - groupId = findProperty("GROUP").toString() - artifactId = findProperty("POM_ARTIFACT_ID").toString() - version = findProperty("VERSION_NAME").toString() + groupId = getKey("GROUP") + artifactId = getKey("POM_ARTIFACT_ID") + version = getKey("VERSION_NAME") + pom { + name.set(getKey("POM_ARTIFACT_ID")) + description.set(getKey("POM_ARTIFACT_DESCRIPTION")) + url.set(getKey("POM_URL")) + licenses { + license { + name.set(getKey("POM_LICENSE_NAME")) + url.set(getKey("POM_LICENSE_URL")) + } + } + developers { + developer { + id.set(getKey("POM_DEVELOPER_ID")) + name.set(getKey("POM_DEVELOPER_NAME")) + email.set(getKey("POM_DEVELOPER_EMAIL")) + } + } + scm { + connection.set(getKey("POM_SCM_CONNECTION")) + developerConnection.set(getKey("POM_SCM_DEV_CONNECTION")) + url.set(getKey("POM_SCM_URL")) + } + } } } } -- cgit v1.2.3