From 64c66c7da227b99dc60cbb179ed4a13d85f26484 Mon Sep 17 00:00:00 2001 From: Talha Ali Date: Wed, 6 Jul 2022 08:45:49 +0700 Subject: [PATCH 1/7] Moved publishing task back into Sign's build.gradle --- signSDK/sign/build.gradle.kts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/signSDK/sign/build.gradle.kts b/signSDK/sign/build.gradle.kts index a8960b0e5c..c6a62cc294 100644 --- a/signSDK/sign/build.gradle.kts +++ b/signSDK/sign/build.gradle.kts @@ -11,12 +11,18 @@ tasks.withType { } android { + namespace = "com.walletconnect.sign" compileSdk = 32 defaultConfig { minSdk = MIN_SDK targetSdk = 32 + aarMetadata { + minCompileSdk = MIN_SDK + targetSdk = 32 + } + testInstrumentationRunner = "com.walletconnect.sign.WCTestRunner" testInstrumentationRunnerArguments += mutableMapOf("runnerBuilder" to "de.mannodermaus.junit5.AndroidJUnit5Builder") } @@ -56,6 +62,25 @@ android { } } +afterEvaluate { + publishing { + publications { + register("Release") { + groupId = "com.walletconnect" + artifactId = "sign" + } + // Creates a Maven publication called "release". +// create("release", MavenPublication::class) { +// // Applies the component for the release build variant. +// from(components.getByName("release")) +// groupId = "com.walletconnect" +// artifactId = "sign" +//// version = Config.libraryVersion +// } + } + } +} + dependencies { okhttp() bouncyCastle() From 1e279f437504ac378ab8bc80a1fccfb4de9d829e Mon Sep 17 00:00:00 2001 From: Talha Ali Date: Wed, 6 Jul 2022 23:30:42 +0700 Subject: [PATCH 2/7] added version --- signSDK/sign/build.gradle.kts | 40 ++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/signSDK/sign/build.gradle.kts b/signSDK/sign/build.gradle.kts index c6a62cc294..14c4a72e9c 100644 --- a/signSDK/sign/build.gradle.kts +++ b/signSDK/sign/build.gradle.kts @@ -1,3 +1,5 @@ +import org.apache.commons.io.output.ByteArrayOutputStream + plugins { id("com.android.library") kotlin("android") @@ -62,12 +64,48 @@ android { } } +fun getVersionName(): String { + return try { + val code = ByteArrayOutputStream() + + exec { + commandLine("git", "tag", "--list") + standardOutput = code + } + + code.toString().split("\n").run { + get(this.size - 3) + } + } catch(e: Exception) { + "default" + } +} + +//def getVersionCode = { -> +// try { +// def code = new ByteArrayOutputStream() +// exec { +// commandLine 'git', 'tag', '--list' +// standardOutput = code +// } +// return code.toString().split("\n").size() +// } +// catch (ignored) { +// return -1; +// } +//} + afterEvaluate { publishing { publications { - register("Release") { + register("release") { groupId = "com.walletconnect" artifactId = "sign" + version = "1"//getVersionName() + + afterEvaluate { + from(components["release"]) + } } // Creates a Maven publication called "release". // create("release", MavenPublication::class) { From a0c6d841c5835661085f5bb0abe5dd06dfe648f0 Mon Sep 17 00:00:00 2001 From: Talha Ali Date: Wed, 6 Jul 2022 23:41:46 +0700 Subject: [PATCH 3/7] removed commented code --- signSDK/sign/build.gradle.kts | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/signSDK/sign/build.gradle.kts b/signSDK/sign/build.gradle.kts index 14c4a72e9c..f7cc3fb903 100644 --- a/signSDK/sign/build.gradle.kts +++ b/signSDK/sign/build.gradle.kts @@ -81,40 +81,18 @@ fun getVersionName(): String { } } -//def getVersionCode = { -> -// try { -// def code = new ByteArrayOutputStream() -// exec { -// commandLine 'git', 'tag', '--list' -// standardOutput = code -// } -// return code.toString().split("\n").size() -// } -// catch (ignored) { -// return -1; -// } -//} - afterEvaluate { publishing { publications { register("release") { groupId = "com.walletconnect" artifactId = "sign" - version = "1"//getVersionName() + version = getVersionName() afterEvaluate { from(components["release"]) } } - // Creates a Maven publication called "release". -// create("release", MavenPublication::class) { -// // Applies the component for the release build variant. -// from(components.getByName("release")) -// groupId = "com.walletconnect" -// artifactId = "sign" -//// version = Config.libraryVersion -// } } } } From badfb406588e30fc3e2a424739a06fb86d81416c Mon Sep 17 00:00:00 2001 From: Talha Ali Date: Wed, 6 Jul 2022 23:54:01 +0700 Subject: [PATCH 4/7] removed properties not used --- signSDK/sign/build.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/signSDK/sign/build.gradle.kts b/signSDK/sign/build.gradle.kts index f7cc3fb903..0a63500984 100644 --- a/signSDK/sign/build.gradle.kts +++ b/signSDK/sign/build.gradle.kts @@ -85,9 +85,9 @@ afterEvaluate { publishing { publications { register("release") { - groupId = "com.walletconnect" - artifactId = "sign" - version = getVersionName() +// groupId = "com.walletconnect" +// artifactId = "sign" +// version = getVersionName() afterEvaluate { from(components["release"]) From fd1812fdde4f54f4625b16444ba9426e567d8566 Mon Sep 17 00:00:00 2001 From: Talha Ali Date: Thu, 7 Jul 2022 00:03:18 +0700 Subject: [PATCH 5/7] removed properties not used --- signSDK/sign/build.gradle.kts | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/signSDK/sign/build.gradle.kts b/signSDK/sign/build.gradle.kts index 0a63500984..f2ed25398e 100644 --- a/signSDK/sign/build.gradle.kts +++ b/signSDK/sign/build.gradle.kts @@ -64,31 +64,10 @@ android { } } -fun getVersionName(): String { - return try { - val code = ByteArrayOutputStream() - - exec { - commandLine("git", "tag", "--list") - standardOutput = code - } - - code.toString().split("\n").run { - get(this.size - 3) - } - } catch(e: Exception) { - "default" - } -} - afterEvaluate { publishing { publications { register("release") { -// groupId = "com.walletconnect" -// artifactId = "sign" -// version = getVersionName() - afterEvaluate { from(components["release"]) } From 3ee354ee3aff272955ea30d9ca855d7e5c3a075a Mon Sep 17 00:00:00 2001 From: Talha Ali Date: Thu, 7 Jul 2022 09:29:11 +0700 Subject: [PATCH 6/7] testing artifact id --- signSDK/sign/build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/signSDK/sign/build.gradle.kts b/signSDK/sign/build.gradle.kts index f2ed25398e..26227f2e6f 100644 --- a/signSDK/sign/build.gradle.kts +++ b/signSDK/sign/build.gradle.kts @@ -68,6 +68,7 @@ afterEvaluate { publishing { publications { register("release") { + this.artifactId = "sign" afterEvaluate { from(components["release"]) } From 4e1d880b684ac4758bb28db0b74bf183d8b0abc7 Mon Sep 17 00:00:00 2001 From: Talha Ali Date: Thu, 7 Jul 2022 11:41:45 +0700 Subject: [PATCH 7/7] reverted change of adding artifact to publishing script --- signSDK/sign/build.gradle.kts | 1 - 1 file changed, 1 deletion(-) diff --git a/signSDK/sign/build.gradle.kts b/signSDK/sign/build.gradle.kts index 26227f2e6f..f2ed25398e 100644 --- a/signSDK/sign/build.gradle.kts +++ b/signSDK/sign/build.gradle.kts @@ -68,7 +68,6 @@ afterEvaluate { publishing { publications { register("release") { - this.artifactId = "sign" afterEvaluate { from(components["release"]) }