Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Commit

Permalink
Update python and bash build scripts to reflect changes done to gradl…
Browse files Browse the repository at this point in the history
…e scripts
  • Loading branch information
adamszewe committed Dec 28, 2023
1 parent bb17eaa commit c9913ab
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 111 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ android {

signingConfigs {
create("release") {
storeFile = file(System.getenv("SYNCTHING_RELEASE_STORE_FILE") ?: "release.keystore")
storeFile = file(System.getenv("SYNCTHING_RELEASE_STORE_FILE"))
storePassword = System.getenv("SIGNING_PASSWORD")
keyAlias = System.getenv("SYNCTHING_RELEASE_KEY_ALIAS")
keyPassword = System.getenv("SIGNING_PASSWORD")
Expand Down
101 changes: 0 additions & 101 deletions app/build.gradle.xyz

This file was deleted.

12 changes: 6 additions & 6 deletions scripts/bump-version.bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if ! git diff-index --exit-code --quiet HEAD; then
fi

NEW_VERSION_NAME=$1
OLD_VERSION_NAME=$(grep "versionName" "app/build.gradle" | awk '{print $2}')
OLD_VERSION_NAME=$(grep "versionName" "app/build.gradle.kts" | awk '{print $3}')
if [[ -z ${NEW_VERSION_NAME} ]]
then
echo "New version name is empty. Please set a new version. Current version: $OLD_VERSION_NAME"
Expand Down Expand Up @@ -45,13 +45,13 @@ echo "
Updating Version
-----------------------------
"
OLD_VERSION_CODE=$(grep "versionCode" "app/build.gradle" -m 1 | awk '{print $2}')
OLD_VERSION_CODE=$(grep "versionCode" "app/build.gradle.kts" -m 1 | awk '{print $3}')
NEW_VERSION_CODE=$(($OLD_VERSION_CODE + 1))
sed -i -e "s/versionCode $OLD_VERSION_CODE/versionCode $NEW_VERSION_CODE/" "app/build.gradle"
sed -i -e "s/versionCode = $OLD_VERSION_CODE/versionCode = $NEW_VERSION_CODE/" "app/build.gradle.kts"

OLD_VERSION_NAME=$(grep "versionName" "app/build.gradle" | awk '{print $2}')
sed -i -e "s/$OLD_VERSION_NAME/\"$1\"/" "app/build.gradle"
git add "app/build.gradle" $CHANGELOG
OLD_VERSION_NAME=$(grep "versionName" "app/build.gradle.kts" | awk '{print $3}')
sed -i -e "s/$OLD_VERSION_NAME/\"$1\"/" "app/build.gradle.kts"
git add "app/build.gradle.kts" $CHANGELOG
git commit -m "Bumped version to $NEW_VERSION_NAME"
git tag -a ${NEW_VERSION_NAME} -m "
$NEW_VERSION_NAME
Expand Down
6 changes: 3 additions & 3 deletions syncthing/build-syncthing.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ def fail(message, *args, **kwargs):


def get_min_sdk(project_dir):
with open(os.path.join(project_dir, 'app', 'build.gradle')) as file_handle:
with open(os.path.join(project_dir, 'app', 'build.gradle.kts')) as file_handle:
for line in file_handle:
tokens = list(filter(None, line.split()))
if len(tokens) == 2 and tokens[0] == 'minSdkVersion':
return int(tokens[1])
if len(tokens) == 3 and tokens[0] == 'minSdk':
return int(tokens[2])

fail('Failed to find minSdkVersion')

Expand Down

0 comments on commit c9913ab

Please sign in to comment.