rebuild_dependencies
This commit is contained in:
parent
b7109ef9fa
commit
de9a63f84b
@ -1,6 +1,8 @@
|
||||
# v2.0.2
|
||||
+ new dependency resolution system (see **config** and `example_dependency_configs`)
|
||||
+ **config**: changed description of `OBJDIR`
|
||||
+ **config**: added task `rebuild_dependencies`
|
||||
+ added variable `TASK_ARGS` which can be used in task scripts
|
||||
|
||||
# v2.0.1
|
||||
+ updated `.gitignore`
|
||||
|
||||
13
cbuild.sh
13
cbuild.sh
@ -95,6 +95,7 @@ function call_task {
|
||||
local current_config_path="$1"
|
||||
local default_config_path="$2"
|
||||
local task="$3"
|
||||
TASK_ARGS="$4"
|
||||
|
||||
print_header "${CYAN}" "─" "$PROJECT/$task"
|
||||
load_config "$current_config_path" "$default_config_path" "$task" true
|
||||
@ -117,8 +118,16 @@ function call_tasks {
|
||||
local tasks="$@"
|
||||
load_config "$current_config_path" "$default_config_path" "" false
|
||||
print_header "${WHITE}" "═" "$PROJECT"
|
||||
for task in $tasks ; do
|
||||
call_task "$current_config_path" "$default_config_path" "$task"
|
||||
project_dir="$(pwd)"
|
||||
for task_str in $tasks ; do
|
||||
task=$(safeprint "$task_str" | sed 's/=.*//g')
|
||||
local args_str=$(safeprint "$task_str" | grep -oP '(?<=\=).*' || echo "")
|
||||
IFS_backup="$IFS"
|
||||
IFS=',;'
|
||||
args_array=($args_str)
|
||||
IFS="$IFS_backup"
|
||||
call_task "$current_config_path" "$default_config_path" "$task" "${args_array[@]}"
|
||||
cd "$project_dir"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
@ -27,6 +27,9 @@ function load_config {
|
||||
local default_config_path="$2"
|
||||
TASK="$3"
|
||||
local quiet=$4
|
||||
|
||||
myprint "${BLUE}loading config current='$(realpath $current_config_path)' default='$(realpath $default_config_path)'"
|
||||
|
||||
if [ -z "$current_config_path" ]; then
|
||||
error "current_config_path is null"
|
||||
fi
|
||||
|
||||
@ -169,6 +169,12 @@ case "$TASK" in
|
||||
TASK_SCRIPT=cbuild/default_tasks/exec.sh
|
||||
POST_TASK_SCRIPT=
|
||||
;;
|
||||
# rebuilds specified dependencies
|
||||
# EXAMPLE: `cbuild rebuild_dependencies=libexample1,fonts`
|
||||
# 'all' can be specified to rebuild all dependencies
|
||||
rebuild_dependencies)
|
||||
TASK_SCRIPT=cbuild/default_tasks/rebuild_dependencies.sh
|
||||
;;
|
||||
# deletes generated files
|
||||
clean)
|
||||
TASK_SCRIPT=cbuild/default_tasks/clean.sh
|
||||
@ -178,6 +184,6 @@ case "$TASK" in
|
||||
;;
|
||||
# unknown task
|
||||
*)
|
||||
error "task <$TASK> not found"
|
||||
error "task <$PROJECT/$TASK> not found"
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -5,8 +5,10 @@ try_delete_dir_or_file "$OUTDIR"
|
||||
myprint "${WHITE}deleting build logs"
|
||||
rm -rf *.log
|
||||
|
||||
project_dir="$(pwd)"
|
||||
for dep in $ENABLED_DEPENDENCIES; do
|
||||
load_dependency_config "$DEPENDENCY_CONFIGS_DIR/$dep.config"
|
||||
cd "$DEP_WORKING_DIR"
|
||||
exec_command "$DEP_CLEAN_COMMAND"
|
||||
cd "$project_dir"
|
||||
done
|
||||
|
||||
11
default_tasks/rebuild_dependencies.sh
Normal file
11
default_tasks/rebuild_dependencies.sh
Normal file
@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
dependencies="$TASK_ARGS"
|
||||
if [ "$dependencies" = 'all' ]; then
|
||||
dependencies="$ENABLED_DEPENDENCIES"
|
||||
fi
|
||||
if [ ! -z "$dependencies" ]; then
|
||||
myprint "${BLUE}dependencies to be rebuild: $dependencies"
|
||||
build_dependencies "$dependencies" true
|
||||
else
|
||||
myprint "${YELLOW}no dependencies specified"
|
||||
fi
|
||||
Loading…
Reference in New Issue
Block a user