From 8842931e9d6ac0d8d04c396dc3f6f8a31d0f970a Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Mon, 28 Sep 2020 17:37:13 +0530 Subject: [PATCH 01/10] Add gradle configuration to publish package in maven repository Change-Id: Ib8732e0122821410afe127aa8c0783563911b477 --- .gitlab-ci.yml | 8 +++++++- build.gradle | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 build.gradle diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2c7db0f1..a9afcefb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ stages: - update-from-upstream - build-sdk + - publish include: - project: 'e/priv/os/build' @@ -18,4 +19,9 @@ build-sdk: - ./buildSdk.sh artifacts: paths: - - e-ui-sdk.jar \ No newline at end of file + - e-ui-sdk.jar + +publish: + stage: publish + script: + - 'gradle publish' diff --git a/build.gradle b/build.gradle new file mode 100644 index 00000000..db69a801 --- /dev/null +++ b/build.gradle @@ -0,0 +1,47 @@ +plugins { + id 'maven-publish' +} + +group = 'lineageos.platform' +version = '1.0' + +publishing { + publications { + mavenJava(MavenPublication) { + artifactId = 'e-ui-sdk' + artifact ("e-ui-sdk.jar") + pom { + name = '/e/ UI SDK Library' + description = 'A design library to be used specifically for /e/ OS to have common themes across the apps.' + url = 'https://gitlab.e.foundation/e/os/android_lineage-sdk' + licenses { + license { + name = 'The Apache License, Version 2.0' + url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' + } + } + developers { + developer { + id = 'amitkumar' + name = 'Amit Kumar' + email = 'amitkma@e.email' + } + } + } + } + } + + repositories { + maven { + url "https://gitlab.e.foundation/api/v4/projects/185/packages/maven" + name "GitLab" + credentials(HttpHeaderCredentials) { + name = 'Job-Token' + value = System.getenv("CI_JOB_TOKEN") + } + authentication { + header(HttpHeaderAuthentication) + } + } + } +} \ No newline at end of file -- GitLab From 5e9dd7a31a820d31edfa493481178b85a6039bfb Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Mon, 28 Sep 2020 12:16:02 +0000 Subject: [PATCH 02/10] Fix path for build.gradle --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index db69a801..93beea3f 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ publishing { publications { mavenJava(MavenPublication) { artifactId = 'e-ui-sdk' - artifact ("e-ui-sdk.jar") + artifact ("/e-ui-sdk.jar") pom { name = '/e/ UI SDK Library' description = 'A design library to be used specifically for /e/ OS to have common themes across the apps.' -- GitLab From 5f1e0232ef0c1325909c30429c9e5220e3d03a1d Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Mon, 28 Sep 2020 12:19:38 +0000 Subject: [PATCH 03/10] Revert file path for build.gradle --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 93beea3f..4d12aa4d 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ publishing { publications { mavenJava(MavenPublication) { artifactId = 'e-ui-sdk' - artifact ("/e-ui-sdk.jar") + artifact ("e-ui-sdk.jar") pom { name = '/e/ UI SDK Library' description = 'A design library to be used specifically for /e/ OS to have common themes across the apps.' @@ -44,4 +44,4 @@ publishing { } } } -} \ No newline at end of file +} -- GitLab From 73b84411f50482b9aa4b35dd3f594c4f2de75352 Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Mon, 28 Sep 2020 12:46:38 +0000 Subject: [PATCH 04/10] Use maven instead of mavenJava --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 4d12aa4d..05042591 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ version = '1.0' publishing { publications { - mavenJava(MavenPublication) { + maven(MavenPublication) { artifactId = 'e-ui-sdk' artifact ("e-ui-sdk.jar") pom { -- GitLab From 1e59fce7ed8cb5f677e3d2a3866c60b1645778dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnau=20V=C3=A0zquez?= Date: Fri, 2 Oct 2020 10:27:54 +0000 Subject: [PATCH 05/10] Test groupId --- build.gradle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 05042591..5c346790 100644 --- a/build.gradle +++ b/build.gradle @@ -2,13 +2,15 @@ plugins { id 'maven-publish' } -group = 'lineageos.platform' +groupId = 'foundation.e' version = '1.0' publishing { publications { maven(MavenPublication) { + groupId = 'foundation.e' artifactId = 'e-ui-sdk' + version = '1.0' artifact ("e-ui-sdk.jar") pom { name = '/e/ UI SDK Library' -- GitLab From accda17755ac26e24827407798c8dfdc75420870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnau=20V=C3=A0zquez?= Date: Fri, 2 Oct 2020 10:34:02 +0000 Subject: [PATCH 06/10] global group property --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 5c346790..bb9503ed 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ plugins { id 'maven-publish' } -groupId = 'foundation.e' +group = 'lineageos.platform' version = '1.0' publishing { -- GitLab From 19b50d891c27757782330060d5cc22e65c86b17e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnau=20V=C3=A0zquez?= Date: Fri, 2 Oct 2020 10:34:25 +0000 Subject: [PATCH 07/10] debug flag --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a9afcefb..732f698e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,4 +24,4 @@ build-sdk: publish: stage: publish script: - - 'gradle publish' + - 'gradle publish --debug' -- GitLab From a716dfb91528cb96ff8132fb01469fe66e7aa114 Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Mon, 16 Nov 2020 13:58:38 +0530 Subject: [PATCH 08/10] Add android version in /e/ SDK name Change-Id: Idd012d245e13b6a2cdec9ad5bac74171fb8cf084 --- .gitlab-ci.yml | 2 +- build.gradle | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 732f698e..a9afcefb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,4 +24,4 @@ build-sdk: publish: stage: publish script: - - 'gradle publish --debug' + - 'gradle publish' diff --git a/build.gradle b/build.gradle index bb9503ed..549464ee 100644 --- a/build.gradle +++ b/build.gradle @@ -2,15 +2,12 @@ plugins { id 'maven-publish' } -group = 'lineageos.platform' -version = '1.0' - publishing { publications { maven(MavenPublication) { groupId = 'foundation.e' artifactId = 'e-ui-sdk' - version = '1.0' + version = '1.0-pie' artifact ("e-ui-sdk.jar") pom { name = '/e/ UI SDK Library' -- GitLab From bf51dced9af5510ddb6ed3f88fbcaa9ccb81dc87 Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Tue, 17 Nov 2020 08:16:27 +0000 Subject: [PATCH 09/10] Update buildSdk.sh to use latest build-tool version --- buildSdk.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/buildSdk.sh b/buildSdk.sh index ae264069..d7f6fb3d 100755 --- a/buildSdk.sh +++ b/buildSdk.sh @@ -8,10 +8,27 @@ if [[ -z "${ANDROID_HOME}" ]]; then echo "{ANDROID_HOME} path variable is not set. Set it to point Android SDK." exit 1 else - build_tools_dir=$ANDROID_HOME/build-tools/29.0.2/ + build_tools_dir=$ANDROID_HOME/build-tools/ + declare -a build_tools + for f in $build_tools_dir*; + do + if [ -d "$f" ]; then + build_tools+=($(basename $f)) + fi + done + if [ ${#build_tools[@]} -eq 0 ]; then + echo "No build-tools found at $build_tools_dir. Make sure you've atleast one build tools downloaded." + exit 1 + else + sorted_build_tools=($(for l in ${build_tools[@]}; do echo $l; done | sort)) + echo "Available build-tools are ${sorted_build_tools[@]}" + latest_build_tool=${sorted_build_tools[${#sorted_build_tools[@]}-1]} + echo "Using latest build tool available: $latest_build_tool" + fi fi -aapt2="${build_tools_dir}/aapt2" +latest_build_tool_dir="$build_tools_dir$latest_build_tool" +aapt2="${latest_build_tool_dir}/aapt2" echo "Compiling resources" $aapt2 compile --dir lineage/res/res -o intermediates/resources.zip @@ -43,4 +60,4 @@ jar cvf e-ui-sdk.jar -C obj . -C intermediates resources.arsc echo "Clearing intermediate sources" rm -rf intermediates rm -rf obj -echo "e-ui-sdk.jar generated successully." \ No newline at end of file +echo "e-ui-sdk.jar generated successully." -- GitLab From 5ae40a1b82840da92365da9d9f56776dc1972aa4 Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Tue, 17 Nov 2020 18:18:39 +0000 Subject: [PATCH 10/10] Restrict artifact publishing to v1-pie only --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a9afcefb..ee0b9bb7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,6 +22,8 @@ build-sdk: - e-ui-sdk.jar publish: + only: + - v1-pie stage: publish script: - 'gradle publish' -- GitLab