mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-13 01:21:38 -07:00
Command package -> bundle
This commit is contained in:
@@ -217,7 +217,10 @@ enum CommandKind : u64 {
|
||||
Command_strip_semicolon = 1<<6,
|
||||
Command_bug_report = 1<<7,
|
||||
|
||||
Command_package_android = 1<<8,
|
||||
Command_bundle_android = 1<<8,
|
||||
Command_bundle_macos = 1<<9,
|
||||
Command_bundle_ios = 1<<10,
|
||||
Command_bundle_orca = 1<<11,
|
||||
|
||||
Command__does_check = Command_run|Command_build|Command_check|Command_doc|Command_test|Command_strip_semicolon,
|
||||
Command__does_build = Command_run|Command_build|Command_test,
|
||||
@@ -233,7 +236,10 @@ gb_global char const *odin_command_strings[32] = {
|
||||
"test",
|
||||
"strip-semicolon",
|
||||
"",
|
||||
"package-android",
|
||||
"bundle android",
|
||||
"bundle macos",
|
||||
"bundle ios",
|
||||
"bundle orca",
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
i32 package_android(String init_directory);
|
||||
i32 bundle_android(String init_directory);
|
||||
|
||||
i32 package(String init_directory) {
|
||||
i32 bundle(String init_directory) {
|
||||
switch (build_context.command_kind) {
|
||||
case Command_package_android:
|
||||
return package_android(init_directory);
|
||||
case Command_bundle_android:
|
||||
return bundle_android(init_directory);
|
||||
}
|
||||
gb_printf_err("Unknown odin package <platform>\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
i32 package_android(String original_init_directory) {
|
||||
i32 bundle_android(String original_init_directory) {
|
||||
TEMPORARY_ALLOCATOR_GUARD();
|
||||
|
||||
i32 result = 0;
|
||||
+14
-14
@@ -74,7 +74,7 @@ gb_global Timings global_timings = {0};
|
||||
#include "cached.cpp"
|
||||
|
||||
#include "linker.cpp"
|
||||
#include "package_command.cpp"
|
||||
#include "bundle_command.cpp"
|
||||
|
||||
#if defined(GB_SYSTEM_WINDOWS) && defined(ODIN_TILDE_BACKEND)
|
||||
#define ALLOW_TILDE 1
|
||||
@@ -572,7 +572,7 @@ gb_internal bool parse_build_flags(Array<String> args) {
|
||||
add_flag(&build_flags, BuildFlag_Microarch, str_lit("microarch"), BuildFlagParam_String, Command__does_build);
|
||||
add_flag(&build_flags, BuildFlag_TargetFeatures, str_lit("target-features"), BuildFlagParam_String, Command__does_build);
|
||||
add_flag(&build_flags, BuildFlag_StrictTargetFeatures, str_lit("strict-target-features"), BuildFlagParam_None, Command__does_build);
|
||||
add_flag(&build_flags, BuildFlag_MinimumOSVersion, str_lit("minimum-os-version"), BuildFlagParam_String, Command__does_build | Command_package_android);
|
||||
add_flag(&build_flags, BuildFlag_MinimumOSVersion, str_lit("minimum-os-version"), BuildFlagParam_String, Command__does_build | Command_bundle_android);
|
||||
|
||||
add_flag(&build_flags, BuildFlag_RelocMode, str_lit("reloc-mode"), BuildFlagParam_String, Command__does_build);
|
||||
add_flag(&build_flags, BuildFlag_DisableRedZone, str_lit("disable-red-zone"), BuildFlagParam_None, Command__does_build);
|
||||
@@ -629,14 +629,14 @@ gb_internal bool parse_build_flags(Array<String> args) {
|
||||
add_flag(&build_flags, BuildFlag_Subsystem, str_lit("subsystem"), BuildFlagParam_String, Command__does_build);
|
||||
#endif
|
||||
|
||||
add_flag(&build_flags, BuildFlag_AndroidKeystore, str_lit("android-keystore"), BuildFlagParam_String, Command_package_android);
|
||||
add_flag(&build_flags, BuildFlag_AndroidKeystoreAlias, str_lit("android-keystore-alias"), BuildFlagParam_String, Command_package_android);
|
||||
add_flag(&build_flags, BuildFlag_AndroidManifest, str_lit("android-manifest"), BuildFlagParam_String, Command_package_android);
|
||||
add_flag(&build_flags, BuildFlag_AndroidKeystore, str_lit("android-keystore"), BuildFlagParam_String, Command_bundle_android);
|
||||
add_flag(&build_flags, BuildFlag_AndroidKeystoreAlias, str_lit("android-keystore-alias"), BuildFlagParam_String, Command_bundle_android);
|
||||
add_flag(&build_flags, BuildFlag_AndroidManifest, str_lit("android-manifest"), BuildFlagParam_String, Command_bundle_android);
|
||||
|
||||
|
||||
Array<String> flag_args = {};
|
||||
|
||||
if (build_context.command_kind == Command_package_android) {
|
||||
if (build_context.command_kind == Command_bundle_android) {
|
||||
GB_ASSERT(args.count >= 4);
|
||||
flag_args = array_slice(args, 4, args.count);
|
||||
} else {
|
||||
@@ -2267,8 +2267,8 @@ gb_internal void print_show_help(String const arg0, String command, String optio
|
||||
} else if (command == "strip-semicolon") {
|
||||
print_usage_line(1, "strip-semicolon");
|
||||
print_usage_line(2, "Parses and type checks .odin file(s) and then removes unneeded semicolons from the entire project.");
|
||||
} else if (command == "package") {
|
||||
print_usage_line(1, "package <platform> Packages directory in a specific layout for that platform");
|
||||
} else if (command == "bundle") {
|
||||
print_usage_line(1, "bundle <platform> Bundles a directory in a specific layout for that platform");
|
||||
print_usage_line(2, "Supported platforms:");
|
||||
print_usage_line(3, "android");
|
||||
}
|
||||
@@ -2280,7 +2280,7 @@ gb_internal void print_show_help(String const arg0, String command, String optio
|
||||
bool strip_semicolon = command == "strip-semicolon";
|
||||
bool check_only = command == "check" || strip_semicolon;
|
||||
bool check = run_or_build || check_only;
|
||||
bool is_package = command == "package";
|
||||
bool bundle = command == "bundle";
|
||||
|
||||
if (command == "help") {
|
||||
doc = true;
|
||||
@@ -2548,7 +2548,7 @@ gb_internal void print_show_help(String const arg0, String command, String optio
|
||||
}
|
||||
}
|
||||
|
||||
if (run_or_build || is_package) {
|
||||
if (run_or_build || bundle) {
|
||||
if (print_flag("-minimum-os-version:<string>")) {
|
||||
print_usage_line(2, "Sets the minimum OS version targeted by the application.");
|
||||
print_usage_line(2, "Default: -minimum-os-version:11.0.0");
|
||||
@@ -3337,13 +3337,13 @@ int main(int arg_count, char const **arg_ptr) {
|
||||
print_show_help(args[0], args[1], args[2]);
|
||||
return 0;
|
||||
}
|
||||
} else if (command == "package") {
|
||||
} else if (command == "bundle") {
|
||||
if (args.count < 4) {
|
||||
usage(args[0]);
|
||||
return 1;
|
||||
}
|
||||
if (args[2] == "android") {
|
||||
build_context.command_kind = Command_package_android;
|
||||
build_context.command_kind = Command_bundle_android;
|
||||
} else {
|
||||
gb_printf_err("Unknown package command: '%.*s'\n", LIT(args[2]));
|
||||
usage(args[0]);
|
||||
@@ -3425,8 +3425,8 @@ int main(int arg_count, char const **arg_ptr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (command == "package") {
|
||||
return package(init_filename);
|
||||
if (command == "bundle") {
|
||||
return bundle(init_filename);
|
||||
}
|
||||
|
||||
// NOTE(bill): add 'shared' directory if it is not already set
|
||||
|
||||
Reference in New Issue
Block a user