Split application metadata to properties

This commit is contained in:
世界
2021-05-09 10:15:58 +08:00
parent f65b0a26f4
commit 5fdbefc3e7
4 changed files with 89 additions and 5 deletions

View File

@@ -28,6 +28,12 @@ jobs:
path: |
app/libs/core-release.aar
key: ${{ hashFiles('core_status') }}
- name: Gradle cache
uses: actions/cache@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ~/.gradle
key: native-${{ hashFiles('**/*.gradle') }}
- name: Native Build
if: steps.cache.outputs.cache-hit != 'true'
run: |
@@ -54,6 +60,12 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
with:
go-version: 1.16
- name: Gradle cache
uses: actions/cache@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ~/.gradle
key: native-${{ hashFiles('**/*.gradle') }}
- name: Native Build
if: steps.cache.outputs.cache-hit != 'true'
run: |
@@ -80,6 +92,12 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
with:
go-version: 1.16
- name: Gradle cache
uses: actions/cache@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ~/.gradle
key: native-${{ hashFiles('**/*.gradle') }}
- name: Native Build
if: steps.cache.outputs.cache-hit != 'true'
run: |
@@ -107,6 +125,12 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
with:
go-version: 1.16
- name: Gradle cache
uses: actions/cache@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ~/.gradle
key: native-${{ hashFiles('**/*.gradle') }}
- name: Native Build
if: steps.cache.outputs.cache-hit != 'true'
run: |
@@ -132,6 +156,12 @@ jobs:
- name: Install Rust
if: steps.cache.outputs.cache-hit != 'true'
run: ./run init action shadowsocks
- name: Gradle cache
uses: actions/cache@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ~/.gradle
key: native-${{ hashFiles('**/*.gradle') }}
- name: Native Build
if: steps.cache.outputs.cache-hit != 'true'
run: |
@@ -153,6 +183,12 @@ jobs:
path: |
app/libs/shadowsocksr-release.aar
key: ${{ hashFiles('shadowsocksr_status') }}
- name: Gradle cache
uses: actions/cache@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ~/.gradle
key: native-${{ hashFiles('**/*.gradle') }}
- name: Native Build
if: steps.cache.outputs.cache-hit != 'true'
run: |

View File

@@ -38,6 +38,12 @@ jobs:
path: |
app/libs/core-release.aar
key: ${{ hashFiles('core_status') }}
- name: Gradle cache
uses: actions/cache@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ~/.gradle
key: native-${{ hashFiles('**/*.gradle') }}
- name: Native Build
if: steps.cache.outputs.cache-hit != 'true'
run: |
@@ -65,6 +71,12 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
with:
go-version: 1.16
- name: Gradle cache
uses: actions/cache@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ~/.gradle
key: native-${{ hashFiles('**/*.gradle') }}
- name: Native Build
if: steps.cache.outputs.cache-hit != 'true'
run: |
@@ -90,6 +102,12 @@ jobs:
- name: Install Rust
if: steps.cache.outputs.cache-hit != 'true'
run: ./run init action shadowsocks
- name: Gradle cache
uses: actions/cache@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ~/.gradle
key: native-${{ hashFiles('**/*.gradle') }}
- name: Native Build
if: steps.cache.outputs.cache-hit != 'true'
run: |
@@ -112,6 +130,12 @@ jobs:
path: |
app/libs/shadowsocksr-release.aar
key: ${{ hashFiles('shadowsocksr_status') }}
- name: Gradle cache
uses: actions/cache@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ~/.gradle
key: native-${{ hashFiles('**/*.gradle') }}
- name: Native Build
if: steps.cache.outputs.cache-hit != 'true'
run: |

View File

@@ -6,13 +6,16 @@ plugins {
id "com.mikepenz.aboutlibraries.plugin"
}
def verCode = 27
def verName = "0.1-beta26"
def metadata = new Properties()
metadata.load(project.rootProject.file("sager.properties").newDataInputStream())
def verCode = metadata.getProperty("VERSION_CODE").toInteger()
def verName = metadata.getProperty("VERSION_NAME")
def packageName = metadata.getProperty("PACKAGE_NAME")
def keystorePwd = null
def alias = null
def pwd = null
def packageName = null
Properties properties
def base64 = System.getenv("LOCAL_PROPERTIES")
@@ -28,7 +31,6 @@ if (properties != null) {
keystorePwd = properties.getProperty("KEYSTORE_PASS")
alias = properties.getProperty("ALIAS_NAME")
pwd = properties.getProperty("ALIAS_PASS")
packageName = properties.getProperty("PACKAGE_NAME")
}
keystorePwd = keystorePwd ?: System.getenv("KEYSTORE_PASS")
@@ -62,7 +64,7 @@ android {
buildToolsVersion "30.0.3"
defaultConfig {
applicationId packageName == null ? "io.nekohasekai.sagernet" : packageName
applicationId packageName
minSdkVersion 21
targetSdkVersion 30
versionCode verCode

22
sager.properties Normal file
View File

@@ -0,0 +1,22 @@
#
#
# Copyright (C) 2021 by nekohasekai <sekai@neko.services>
# Copyright (C) 2021 by Max Lv <max.c.lv@gmail.com>
# Copyright (C) 2021 by Mygod Studio <contact-shadowsocks-android@mygod.be>
#
# This program 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.
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
#
PACKAGE_NAME=io.nekohasekai.sagernet
VERSION_NAME=0.1-beta26
VERSION_CODE=27