Skip to content

Commit

Permalink
Update to use new Android version format files
Browse files Browse the repository at this point in the history
  • Loading branch information
kl committed Dec 9, 2024
1 parent 6fbe6cb commit 413b9a5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions mullvad-version/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::{
/// in dev builds.
const GIT_HASH_DEV_SUFFIX_LEN: usize = 6;

const ANDROID_VERSION_FILE_PATH: &str = "../dist-assets/android-product-version.txt";
const ANDROID_VERSION_FILE_PATH: &str = "../dist-assets/android-version-name.txt";
const DESKTOP_VERSION_FILE_PATH: &str = "../dist-assets/desktop-product-version.txt";

#[derive(Debug, Copy, Clone)]
Expand Down Expand Up @@ -38,7 +38,7 @@ fn main() {
let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());
fs::write(out_dir.join("product-version.txt"), product_version).unwrap();
fs::write(
out_dir.join("android-product-version.txt"),
out_dir.join("android-version-name.txt"),
android_product_version,
)
.unwrap();
Expand Down
3 changes: 1 addition & 2 deletions mullvad-version/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use mullvad_version::{PreStableType, Version};
use std::{env, process::exit};

const ANDROID_VERSION: &str =
include_str!(concat!(env!("OUT_DIR"), "/android-product-version.txt"));
const ANDROID_VERSION: &str = include_str!(concat!(env!("OUT_DIR"), "/android-version-name.txt"));

fn main() {
let command = env::args().nth(1);
Expand Down
6 changes: 4 additions & 2 deletions prepare-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ if [[ "$DESKTOP" == "true" ]]; then
fi

if [[ "$ANDROID" == "true" ]]; then
echo "$PRODUCT_VERSION" > dist-assets/android-product-version.txt
echo "$PRODUCT_VERSION" > dist-assets/android-version-name.txt
cargo run -q --bin mullvad-version versionCode > dist-assets/android-version-code.txt
git commit -S -m "Update android app version to $PRODUCT_VERSION" \
dist-assets/android-product-version.txt
dist-assets/android-version-name.txt \
dist-assets/android-version-code.txt
fi

NEW_TAGS=""
Expand Down

0 comments on commit 413b9a5

Please sign in to comment.