diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index 6a4314647..3464cdc88 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -127,7 +127,7 @@ jobs: run: | ./run libs native v2ray: - name: Native Build (V2ray) + name: Native Build ( V2ray ) runs-on: ubuntu-latest steps: - name: Checkout @@ -157,7 +157,7 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: ./run libs v2ray shadowsocks: - name: Native Build (Shadowsocks) + name: Native Build ( Shadowsocks ) runs-on: ubuntu-latest steps: - name: Checkout @@ -187,7 +187,7 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: ./run libs shadowsocks shadowsocksr: - name: Native Build (ShadowsocksR) + name: Native Build ( ShadowsocksR ) runs-on: ubuntu-latest steps: - name: Checkout @@ -213,8 +213,8 @@ jobs: - name: Native Build if: steps.cache.outputs.cache-hit != 'true' run: ./run libs ssr - debug: - name: Debug Build + build: + name: Gradle Build runs-on: ubuntu-latest needs: - native diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index 16c554114..b1fd8b814 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -40,6 +40,45 @@ configurations { compile.exclude module: 'support-v4' } + +def keystorePwd = null +def alias = null +def pwd = null + +Properties properties +def base64 = System.getenv("LOCAL_PROPERTIES") +if (base64 != null && !base64.isBlank()) { + properties = new Properties() + properties.load(new ByteArrayInputStream(Base64.decoder.decode(base64))) +} else if (project.rootProject.file('local.properties').exists()) { + properties = new Properties() + properties.load(project.rootProject.file('local.properties').newDataInputStream()) +} + +if (properties != null) { + keystorePwd = properties.getProperty("KEYSTORE_PASS") + alias = properties.getProperty("ALIAS_NAME") + pwd = properties.getProperty("ALIAS_PASS") +} + +keystorePwd = keystorePwd ?: System.getenv("KEYSTORE_PASS") +alias = alias ?: System.getenv("ALIAS_NAME") +pwd = pwd ?: System.getenv("ALIAS_PASS") + +def targetAbi = "" +if (!gradle.startParameter.taskNames.isEmpty()) { + if (gradle.startParameter.taskNames.size == 1) { + def targetTask = gradle.startParameter.taskNames[0].toLowerCase() + if (targetTask.contains("arm64")) { + targetAbi = "arm64" + } else if (targetTask.contains("arm")) { + targetAbi = "arm" + } + } else { + targetAbi = "~" + } +} + def okHttpVersion = '5.0.0-alpha.2' def fcmVersion = '21.0.1' def crashlyticsVersion = '17.3.1' @@ -101,44 +140,11 @@ dependencies { coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.1' -} - -def keystorePwd = null -def alias = null -def pwd = null - -Properties properties -def base64 = System.getenv("LOCAL_PROPERTIES") -if (base64 != null && !base64.isBlank()) { - properties = new Properties() - properties.load(new ByteArrayInputStream(Base64.decoder.decode(base64))) -} else if (project.rootProject.file('local.properties').exists()) { - properties = new Properties() - properties.load(project.rootProject.file('local.properties').newDataInputStream()) -} - -if (properties != null) { - keystorePwd = properties.getProperty("KEYSTORE_PASS") - alias = properties.getProperty("ALIAS_NAME") - pwd = properties.getProperty("ALIAS_PASS") -} - -keystorePwd = keystorePwd ?: System.getenv("KEYSTORE_PASS") -alias = alias ?: System.getenv("ALIAS_NAME") -pwd = pwd ?: System.getenv("ALIAS_PASS") - -def targetAbi = "" -if (!gradle.startParameter.taskNames.isEmpty()) { - if (gradle.startParameter.taskNames.size == 1) { - def targetTask = gradle.startParameter.taskNames[0].toLowerCase() - if (targetTask.contains("arm64")) { - targetAbi = "arm64" - } else if (targetTask.contains("arm")) { - targetAbi = "arm" - } - } else { - targetAbi = "~" + if (!targetAbi.isBlank()) { + implementation project(":ss-rust") + implementation project(":ssr-libev") } + } android { diff --git a/bin/libs/native.sh b/bin/libs/native.sh index 1d7eaceda..4ddf2646e 100755 --- a/bin/libs/native.sh +++ b/bin/libs/native.sh @@ -2,9 +2,7 @@ source "bin/init/env.sh" -[ -f gradlew ] && CMD="./gradlew" || CMD="gradle" - -$CMD TMessagesProj:stripFullFossReleaseDebugSymbols || exit 1 +./gradlew TMessagesProj:stripFullFossDebugSymbols || exit 1 OUT=TMessagesProj/build/intermediates/stripped_native_libs/fullFossRelease/out/lib DIR=TMessagesProj/src/main/libs diff --git a/bin/libs/shadowsocks.sh b/bin/libs/shadowsocks.sh index 5d13468d7..5c9d65c78 100755 --- a/bin/libs/shadowsocks.sh +++ b/bin/libs/shadowsocks.sh @@ -2,8 +2,6 @@ source "bin/init/env.sh" -[ -f gradlew ] && CMD="./gradlew" || CMD="gradle" - git submodule update --init ss-rust/src/main/rust/shadowsocks-rust -$CMD ss-rust:assembleRelease || exit 1 -cp ss-rust/build/outputs/aar/* TMessagesProj/libs \ No newline at end of file +./gradlew ss-rust:assembleRelease || exit 1 +cp ss-rust/build/outputs/aar/* TMessagesProj/libs diff --git a/ss-rust/build.gradle.kts b/ss-rust/build.gradle.kts index 6f53ccf65..0e1ba7ed1 100644 --- a/ss-rust/build.gradle.kts +++ b/ss-rust/build.gradle.kts @@ -38,6 +38,13 @@ android { }) } + productFlavors { + flavorDimensions.add("abi") + + create("arm") + create("arm64") + } + } cargo {