diff --git a/Makefile b/Makefile index a3b91ba..7b76a03 100644 --- a/Makefile +++ b/Makefile @@ -1,28 +1,15 @@ build: clean - mkdir -p ./bin/debug/ - odin build ./src/ -out:bin/debug/odin_runner.exe -debug - -build_rel: clean_rel - mkdir -p ./bin/release/ - odin build ./src/ -out:bin/release/odin_runner.exe + mkdir -p ./bin/ + odin build ./src/ -out:bin/odin_runner.exe -debug run: - ./bin/debug/odin_runner.exe - -run_rel: - ./bin/release/odin_runner.exe + ./bin/odin_runner.exe check: odin check ./src/ clean: - rm -rf ./bin/debug/ - -clean_rel: - rm -rf ./bin/release/ - -cleanall: - rm -rf ./bin/ + rm -rf ./bin/odin_runner.* nuke: rm -rf ./bin diff --git a/odin_runner.json b/odin_runner.json index cc34926..263a324 100644 --- a/odin_runner.json +++ b/odin_runner.json @@ -3,8 +3,8 @@ "collections": [], "flags": [], "source": "./src/", - "output_dir": "", - "binary_name": "" + "output_dir": "./bin/", + "binary_name": "binary_name.bin" }, "configurations": [ { diff --git a/readme.md b/readme.md index 5a16879..09fc8fb 100644 --- a/readme.md +++ b/readme.md @@ -2,13 +2,10 @@ Because I can. # How to use - -Usage examples: -``` +Usage: * `odin_runner` - Run the default command with the defautl configuration (i.e. build with the defaults) * `odin_runner build` - Same as above * `odin_runner build debug` - Same as above but with an explicit configuration (`debug`) * `odin_runner check` - Runs odin check with the defaults * `odin_runner check debug` - Same as above but with an explicit configuration (`debug`) * `odin_runner clean debug` - Cleans up build artefacts in the build directory of an explicit configuration (`debug`) -``` diff --git a/src.bin b/src.bin new file mode 100755 index 0000000..9885ffb Binary files /dev/null and b/src.bin differ diff --git a/src/command_executor.odin b/src/command_executor.odin index 39334ab..7c9c3f9 100644 --- a/src/command_executor.odin +++ b/src/command_executor.odin @@ -16,26 +16,6 @@ execute_command :: proc( configuration: ConfigurationTargets, ) -> ( error: ExecutionError, -) { - if command == .CHECK || command == .BUILD { - return build_or_check(command, target_name, configuration) - } - if command == .CLEAN { - return clean(command, target_name, configuration) - } - if command == .TEST { - return test(command, target_name, configuration) - } - - return -} - -build_or_check :: proc( - command: Command, - target_name: TargetName, - configuration: ConfigurationTargets, -) -> ( - error: ExecutionError, ) { target_config, found_target_in_config := configuration[target_name] if !found_target_in_config && target_name != "" { @@ -52,7 +32,6 @@ build_or_check :: proc( strings.write_string(&sb, command_to_string(command)) strings.write_byte(&sb, ' ') - // Append the command if def_config, ok := configuration[DEFAULT_TARGET_NAME]; ok && !found_target_in_config { strings.write_string(&sb, string(def_config.source)) } else if found_target_in_config { @@ -90,26 +69,6 @@ build_or_check :: proc( strings.write_string(&sb, flag) } } - // Append the output dir - if command == .BUILD { - output_dir: Path;binary_name: string - if def_config, ok := configuration[DEFAULT_TARGET_NAME]; ok { - if len(def_config.output_dir) != 0 && len(def_config.binary_name) != 0 { - output_dir = def_config.output_dir - binary_name = def_config.binary_name - } - } - if found_target_in_config { - output_dir = target_config.output_dir - binary_name = target_config.binary_name - } - - if len(output_dir) > 0 && len(binary_name) > 0 { - strings.write_string(&sb, " -out:") - strings.write_string(&sb, string(output_dir)) - strings.write_string(&sb, binary_name) - } - } compile_flags = strings.to_string(sb) @@ -119,23 +78,3 @@ build_or_check :: proc( return } - -clean :: proc( - command: Command, - target_name: TargetName, - configuration: ConfigurationTargets, -) -> ( - error: ExecutionError, -) { - return -} - -test :: proc( - command: Command, - target_name: TargetName, - configuration: ConfigurationTargets, -) -> ( - error: ExecutionError, -) { - return -}