summaryrefslogtreecommitdiff
path: root/autofill-parser
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2020-11-25 00:19:11 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2020-11-29 17:18:34 +0530
commitfa2a93769f5cec8397064337fd53659147ba1877 (patch)
treee7fc5b80e70189311e3ce38af795ecfeaa49284e /autofill-parser
parent0b9d3dc5c23e372ae7b4e7df266ac0172701c307 (diff)
build: move publishing config to buildSrc for re-use
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'autofill-parser')
-rw-r--r--autofill-parser/build.gradle.kts64
1 files changed, 0 insertions, 64 deletions
diff --git a/autofill-parser/build.gradle.kts b/autofill-parser/build.gradle.kts
index 35169989..9a4d423a 100644
--- a/autofill-parser/build.gradle.kts
+++ b/autofill-parser/build.gradle.kts
@@ -5,20 +5,6 @@ plugins {
`aps-plugin`
}
-// Type safety can sometimes suck
-fun getCredential(type: String): String {
- return when (type) {
- // Attempt to find credentials passed by -Pmaven.$type=
- "user", "password" -> (findProperty("maven.$type")
- // Fall back to MAVEN_$type from env
- ?: System.getenv("MAVEN_${type.toUpperCase()}"))?.toString()
- // Finally fallthrough to an empty string to let task configuration complete
- // even if actual publishing is going to fail
- ?: ""
- else -> throw IllegalArgumentException("Invalid credential type: $type")
- }
-}
-
android {
defaultConfig {
versionCode = 2
@@ -37,56 +23,6 @@ android {
}
}
-afterEvaluate {
- publishing {
- repositories {
- maven {
- name = "aps"
- url = uri("https://maven.msfjarvis.dev/android-password-store/${findProperty("POM_ARTIFACT_ID")}")
- credentials {
- username = getCredential("user")
- password = getCredential("password")
- }
- }
- }
- publications {
- create<MavenPublication>("apsMaven") {
- fun getKey(propertyName: String): String {
- return findProperty(propertyName)?.toString() ?: error("Failed to find property for $propertyName")
- }
-
- from(components.getByName("release"))
- 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"))
- }
- }
- }
- }
- }
-}
-
dependencies {
compileOnly(Dependencies.AndroidX.annotation)
implementation(Dependencies.AndroidX.autofill)