Split shadowsocks build

This commit is contained in:
世界 2021-02-28 22:37:30 +08:00
parent 5a2184d411
commit b3ede707b5
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
5 changed files with 58 additions and 49 deletions

View File

@ -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

View File

@ -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 {

View File

@ -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

View File

@ -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
./gradlew ss-rust:assembleRelease || exit 1
cp ss-rust/build/outputs/aar/* TMessagesProj/libs

View File

@ -38,6 +38,13 @@ android {
})
}
productFlavors {
flavorDimensions.add("abi")
create("arm")
create("arm64")
}
}
cargo {