diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c2ca1bfa5..4c2c44a29 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,10 +4,6 @@ before_script: - export GRADLE_USER_HOME=`pwd`/.gradle - export VERSION_NAME=$(grep -E "versionName " buildSrc/src/main/kotlin/ProtonMail.kt | awk '{print $5}' | sed s/\"//g) - export VERSION_CODE=$(grep -E "versionCode " buildSrc/src/main/kotlin/ProtonMail.kt | awk '{print $5}' | sed s/\"//g) - - !reference [.checkout-core-submodule, before_script] # included from checkout-core.gitlab-ci.yml - -variables: - ORG_GRADLE_PROJECT_useCoreGitSubmodule: "true" # see included checkout-core.gitlab-ci.yml for usage context image: ${CI_REGISTRY}/android/shared/docker-android:v1.0.0 @@ -31,7 +27,6 @@ stages: detekt analysis: stage: analyze - extends: .checkout_core_submodule_job tags: - large except: @@ -47,7 +42,6 @@ detekt analysis: build debug: stage: build - extends: .checkout_core_submodule_job tags: - xlarge-k8s script: @@ -60,7 +54,6 @@ build debug: build uiAutomation: stage: build - extends: .checkout_core_submodule_job tags: - xlarge-k8s script: @@ -73,7 +66,6 @@ build uiAutomation: build alpha: stage: build - extends: .checkout_core_submodule_job when: 'manual' only: - develop @@ -89,7 +81,6 @@ build alpha: build release: stage: build - extends: .checkout_core_submodule_job except: - schedules only: @@ -108,7 +99,6 @@ build release: unit tests: stage: test - extends: .checkout_core_submodule_job tags: - xlarge-k8s script: @@ -232,11 +222,6 @@ include: ref: main file: '/ci/templates-shared/appetize-integration.yml' - - project: 'proton/mobile/android/proton-libs' - ref: main - file: '/ci/templates/checkout-core.gitlab-ci.yml' - - startReview: before_script: - export VERSION_NAME=$(grep -E "versionName " buildSrc/src/main/kotlin/ProtonMail.kt | awk '{print $5}' | sed s/\"//g) diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 72af31f5f..000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "proton-libs"] - path = proton-libs - url = ../../../proton/mobile/android/proton-libs diff --git a/app/old.build.gradle b/app/old.build.gradle index 855a6cb93..74384d5f4 100644 --- a/app/old.build.gradle +++ b/app/old.build.gradle @@ -21,7 +21,7 @@ dependencies { // region libs implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation project(':gopenpgp') + implementation(files("../../proton-libs/gopenpgp/gopenpgp.aar")) implementation files('libs/commons-email-1.3.jar') implementation files('libs/mail.jar') implementation files('libs/mail-additional.jar') diff --git a/gopenpgp/build-config.json b/gopenpgp/build-config.json deleted file mode 100644 index f0407cf05..000000000 --- a/gopenpgp/build-config.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "go_version":"1.17.8", - "build_dir":"build", - "out_dir":"out", - "go_mobile_dir":"mobile", - "go_mobile_flags": [ - "-x", - "-ldflags=\"-s -w \"" - ], - "build_name":"gopenpgp", - "commit_message": "Build for gopenpgp v2.4.6 and go-srp v0.0.3", - "upload_branch": "update-2.4.6+0.0.3", - "java_pkg":"com.proton.gopenpgp", - "targets":["android"], - "requirements": [ - { - "module": - { - "path":"github.com/ProtonMail/gopenpgp/v2", - "version":"v2.4.6" - }, - "packages": ["crypto", "armor", "constants", "models", "subtle", "helper"] - }, - { - "module":{ - "path":"github.com/ProtonMail/go-srp", - "version": "v0.0.3" - } - } - ] -} diff --git a/gopenpgp/build.gradle b/gopenpgp/build.gradle deleted file mode 100644 index c8c333263..000000000 --- a/gopenpgp/build.gradle +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Proton AG - * - * This file is part of Proton Mail. - * - * Proton Mail is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Proton Mail is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Proton Mail. If not, see https://www.gnu.org/licenses/. - */ - -configurations.maybeCreate("default") -artifacts.add("default", file('gopenpgp.aar')) diff --git a/gopenpgp/gopenpgp-sources.jar b/gopenpgp/gopenpgp-sources.jar deleted file mode 100644 index 3b24b70f7..000000000 Binary files a/gopenpgp/gopenpgp-sources.jar and /dev/null differ diff --git a/gopenpgp/gopenpgp.aar b/gopenpgp/gopenpgp.aar deleted file mode 100644 index 46ed40c2d..000000000 Binary files a/gopenpgp/gopenpgp.aar and /dev/null differ diff --git a/gradle.properties b/gradle.properties index a5928dc82..9f2a3a638 100644 --- a/gradle.properties +++ b/gradle.properties @@ -49,5 +49,7 @@ org.aspectj.weaver.Dump.exception=false # https://github.com/bcgit/bc-java/issues/762 android.jetifier.ignorelist=bcprov-jdk15on -# By default use core libs from Git Submodule. -useCoreGitSubmodule=false +# IncludeGit Gradle Plugin: override include with local. +#auto.include.git.dirs=../ +#local.git.proton-libs=../proton-libs + diff --git a/proton-libs b/proton-libs deleted file mode 160000 index f09138ec2..000000000 --- a/proton-libs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f09138ec2e95655d31072369d4319142be948b82 diff --git a/settings.gradle.kts b/settings.gradle.kts index 152cc34c1..badeae1cb 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -19,28 +19,6 @@ rootProject.name = "ProtonMail" - -val (projects, modules) = rootDir.projectsAndModules() - -println("Projects: ${projects.sorted().joinToString()}") -println("Modules: ${modules.sorted().joinToString()}") - -for (p in projects) includeBuild(p) -for (m in modules) include(m) - -// Use core libs from maven artifacts or from git submodule using Gradle's included build: -// - to enable/disable locally: gradle.properties > useCoreGitSubmodule -// - to enable/disable on CI: .gitlab-ci.yml > ORG_GRADLE_PROJECT_useCoreGitSubmodule -val coreSubmoduleDir = rootDir.resolve("proton-libs") -extra.set("coreSubmoduleDir", coreSubmoduleDir) -val includeCoreLibsHelper = File(coreSubmoduleDir, "gradle/include-core-libs.gradle.kts") -if (includeCoreLibsHelper.exists()) { - apply(from = "${coreSubmoduleDir.path}/gradle/include-core-libs.gradle.kts") -} else if (extensions.extraProperties["useCoreGitSubmodule"].toString().toBoolean()) { - includeBuild("proton-libs") - println("Core libs from git submodule `$coreSubmoduleDir`") -} - pluginManagement { repositories { mavenCentral() @@ -50,6 +28,22 @@ pluginManagement { } } +plugins { + id("me.proton.core.gradle-plugins.include-core-build") version "1.1.1" +} + +includeCoreBuild { + branch.set("main") + includeBuild("gopenpgp") +} + +val (projects, modules) = rootDir.projectsAndModules() + +println("Projects: ${projects.sorted().joinToString()}") +println("Modules: ${modules.sorted().joinToString()}") + +for (p in projects) includeBuild(p) +for (m in modules) include(m) fun File.projectsAndModules() : Pair, Set> { val blacklist = setOf(