mirror of
https://github.com/Catfriend1/syncthing-android.git
synced 2025-09-11 21:43:23 +08:00
Fix install_minimum_android_sdk_prerequisites.py (#1513)
This commit is contained in:
@ -147,7 +147,7 @@ if platform.system() not in SUPPORTED_PYTHON_PLATFORMS:
|
||||
fail('Unsupported python platform %s. Supported platforms: %s', platform.system(),
|
||||
', '.join(SUPPORTED_PYTHON_PLATFORMS))
|
||||
|
||||
prerequisite_tools_dir = os.path.dirname(os.path.realpath(__file__)) + os.path.sep + ".." + os.path.sep + "syncthing-android-prereq"
|
||||
prerequisite_tools_dir = os.path.dirname(os.path.realpath(__file__)) + os.path.sep + ".." + os.path.sep + ".." + os.path.sep + "syncthing-android-prereq"
|
||||
|
||||
# Check if "sdk-manager" of sdk-tools package is available.
|
||||
sdk_manager_bin = which("sdkmanager")
|
||||
|
@ -14,20 +14,39 @@ apt-get -y install gcc git openjdk-17-jdk python3 unzip
|
||||
# Clone repository.
|
||||
mkdir -p ~/git && cd ~/git
|
||||
git clone https://github.com/Catfriend1/syncthing-android.git --recursive
|
||||
## git stash && git pull origin Catfriend1-patch-1 && git checkout Catfriend1-patch-1
|
||||
#
|
||||
# Build
|
||||
# Install prerequisites.
|
||||
cd ~/git/syncthing-android
|
||||
## git stash && git pull origin Catfriend1-patch-1 && git checkout Catfriend1-patch-1
|
||||
python3 scripts/install_minimum_android_sdk_prerequisites.py
|
||||
./gradlew buildNative
|
||||
#
|
||||
# Build.
|
||||
export ANDROID_HOME=~/git/syncthing-android-prereq
|
||||
./gradlew buildNative
|
||||
#
|
||||
# Flavor: debug
|
||||
./gradlew lintDebug
|
||||
./gradlew assembleDebug
|
||||
```
|
||||
|
||||
To clean up all files generated during build, use the following commands:
|
||||
|
||||
```bash
|
||||
#
|
||||
# Flavor: release
|
||||
## Remember to setup signing first
|
||||
## or remove the section "signingConfigs" from "app/build.gradle.kts" for an unsigned build.
|
||||
### sed -i -e '/signingConfig/,+2d' "app/build.gradle.kts"
|
||||
./gradlew lintRelease
|
||||
./gradlew assembleRelease
|
||||
#
|
||||
# Artifacts: Grab output APK.
|
||||
## Flavor: debug
|
||||
cp "app/build/outputs/apk/debug/app-debug.apk" "/mnt/x/app-debug.apk"
|
||||
##
|
||||
## Flavor: release
|
||||
cp "app/build/outputs/apk/release/app-release.apk" "/mnt/x/app-release.apk"
|
||||
##
|
||||
## Flavor: release-unsigned
|
||||
cp "app/build/outputs/apk/release/app-release-unsigned.apk" "/mnt/x/app-release-unsigned.apk"
|
||||
#
|
||||
# Cleanup.
|
||||
## To clean up all files generated during build, use the following commands.
|
||||
./gradlew cleanNative
|
||||
./gradlew clean
|
||||
```
|
||||
@ -55,8 +74,8 @@ git clone https://github.com/Catfriend1/syncthing-android.git --recursive
|
||||
::
|
||||
:: Build
|
||||
cd /d "YOUR_CLONED_GIT_ROOT"
|
||||
SyncthingNative_update_and_build
|
||||
App_build_and_release
|
||||
scripts\SyncthingNative_update_and_build
|
||||
scripts\App_build_and_release
|
||||
```
|
||||
|
||||
## Development Notes
|
||||
|
Reference in New Issue
Block a user