mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
fix: strip trailing slashes for android keystore and jarsigner paths
The `system()` call on linux was failing to execute the `jarsigner` command because its path had a trailing slash
This commit is contained in:
@@ -1574,6 +1574,8 @@ gb_internal void init_android_values(bool with_sdk) {
|
|||||||
|
|
||||||
|
|
||||||
bc->ODIN_ANDROID_JAR_SIGNER = normalize_path(permanent_allocator(), make_string_c(gb_get_env("ODIN_ANDROID_JAR_SIGNER", permanent_allocator())), NIX_SEPARATOR_STRING);
|
bc->ODIN_ANDROID_JAR_SIGNER = normalize_path(permanent_allocator(), make_string_c(gb_get_env("ODIN_ANDROID_JAR_SIGNER", permanent_allocator())), NIX_SEPARATOR_STRING);
|
||||||
|
// Strip trailing slash so system() call doesn't fail.
|
||||||
|
bc->ODIN_ANDROID_JAR_SIGNER = substring(bc->ODIN_ANDROID_JAR_SIGNER, 0, bc->ODIN_ANDROID_JAR_SIGNER.len - 1);
|
||||||
if (with_sdk) {
|
if (with_sdk) {
|
||||||
if (bc->ODIN_ANDROID_SDK.len == 0) {
|
if (bc->ODIN_ANDROID_SDK.len == 0) {
|
||||||
gb_printf_err("Error: ODIN_ANDROID_SDK not set, which is required for -build-mode:executable for -subtarget:android");
|
gb_printf_err("Error: ODIN_ANDROID_SDK not set, which is required for -build-mode:executable for -subtarget:android");
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ i32 bundle_android(String original_init_directory) {
|
|||||||
if (current_directory.len != 0) {
|
if (current_directory.len != 0) {
|
||||||
bool ok = set_working_directory(init_directory);
|
bool ok = set_working_directory(init_directory);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
gb_printf_err("Error: Unable to currectly set the current working directory to '%.*s'\n", LIT(init_directory));
|
gb_printf_err("Error: Unable to correctly set the current working directory to '%.*s'\n", LIT(init_directory));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,7 +174,8 @@ i32 bundle_android(String original_init_directory) {
|
|||||||
cmd = gb_string_append_length(cmd, build_context.ODIN_ANDROID_JAR_SIGNER.text, build_context.ODIN_ANDROID_JAR_SIGNER.len);
|
cmd = gb_string_append_length(cmd, build_context.ODIN_ANDROID_JAR_SIGNER.text, build_context.ODIN_ANDROID_JAR_SIGNER.len);
|
||||||
cmd = gb_string_append_fmt(cmd, " -storepass android");
|
cmd = gb_string_append_fmt(cmd, " -storepass android");
|
||||||
if (build_context.android_keystore.len != 0) {
|
if (build_context.android_keystore.len != 0) {
|
||||||
String keystore = concatenate_strings(temporary_allocator(), current_directory, build_context.android_keystore);
|
String keystore = normalize_path(temporary_allocator(), build_context.android_keystore, NIX_SEPARATOR_STRING);
|
||||||
|
keystore = substring(keystore, 0, keystore.len - 1);
|
||||||
cmd = gb_string_append_fmt(cmd, " -keystore \"%.*s\"", LIT(keystore));
|
cmd = gb_string_append_fmt(cmd, " -keystore \"%.*s\"", LIT(keystore));
|
||||||
}
|
}
|
||||||
cmd = gb_string_append_fmt(cmd, " \"%.*s.apk-build\"", LIT(output_apk));
|
cmd = gb_string_append_fmt(cmd, " \"%.*s.apk-build\"", LIT(output_apk));
|
||||||
|
|||||||
Reference in New Issue
Block a user