Compare commits
No commits in common. "f0ee39084ed20224025d001531d89dea86fdd205" and "fca94ffe4c508b4433295260dd43ff681ad52726" have entirely different histories.
f0ee39084e
...
fca94ffe4c
@ -1 +1 @@
|
|||||||
2.3.1
|
2.3.0
|
||||||
@ -1,6 +1,3 @@
|
|||||||
## 2.3.1
|
|
||||||
+ user config loads before project config
|
|
||||||
|
|
||||||
## 2.3.0
|
## 2.3.0
|
||||||
+ **CONFIG:** Added new file `./project.config.user.default`.
|
+ **CONFIG:** Added new file `./project.config.user.default`.
|
||||||
+ **CONFIG:** Changed `cbuild/default_tasks` to `@cbuild/default_tasks`.
|
+ **CONFIG:** Changed `cbuild/default_tasks` to `@cbuild/default_tasks`.
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
INSTALLED_CBUILD_VERSION=2.3.1
|
INSTALLED_CBUILD_VERSION=2.3.0
|
||||||
|
|
||||||
# set \t size to 4 spaces
|
# set \t size to 4 spaces
|
||||||
tabs 4
|
tabs 4
|
||||||
@ -45,7 +45,7 @@ include "@cbuild/include/functions.sh"
|
|||||||
include "@cbuild/include/config.sh"
|
include "@cbuild/include/config.sh"
|
||||||
|
|
||||||
function print_help {
|
function print_help {
|
||||||
myprint "${GRAY}cbuild v$INSTALLED_CBUILD_VERSION"
|
myprint "cbuild v$INSTALLED_CBUILD_VERSION"
|
||||||
myprint "C/C++ project build system written in bash."
|
myprint "C/C++ project build system written in bash."
|
||||||
myprint "Usage: cbuild [OPTIONS] [TASKS]"
|
myprint "Usage: cbuild [OPTIONS] [TASKS]"
|
||||||
myprint "Options:"
|
myprint "Options:"
|
||||||
@ -74,7 +74,7 @@ do
|
|||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
'-v' | '--version')
|
'-v' | '--version')
|
||||||
myprint "${GRAY}cbuild v$INSTALLED_CBUILD_VERSION"
|
myprint "cbuild v$INSTALLED_CBUILD_VERSION"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
'-c' | '--config')
|
'-c' | '--config')
|
||||||
|
|||||||
@ -10,6 +10,8 @@ function load_config {
|
|||||||
#true or false
|
#true or false
|
||||||
local quiet=$3
|
local quiet=$3
|
||||||
|
|
||||||
|
myprint "${BLUE}loading ${WHITE}'$proj_conf_file'"
|
||||||
|
|
||||||
if [ -z "$proj_conf_file" ]; then
|
if [ -z "$proj_conf_file" ]; then
|
||||||
error "config path is null"
|
error "config path is null"
|
||||||
fi
|
fi
|
||||||
@ -17,18 +19,6 @@ function load_config {
|
|||||||
error "${YELLOW}$proj_conf_file doesn't exist"
|
error "${YELLOW}$proj_conf_file doesn't exist"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# load project user config
|
|
||||||
local proj_conf_user_file="$proj_conf_file.user"
|
|
||||||
file_copy_default_if_not_present "$proj_conf_user_file" "$proj_conf_user_file.default"
|
|
||||||
myprint "${BLUE}loading ${WHITE}'$proj_conf_user_file'"
|
|
||||||
# throw error on undefined variable usage
|
|
||||||
set -u
|
|
||||||
include "$proj_conf_user_file"
|
|
||||||
# don't throw error on undefined variable usage
|
|
||||||
set +u
|
|
||||||
|
|
||||||
myprint "${BLUE}loading ${WHITE}'$proj_conf_file'"
|
|
||||||
|
|
||||||
OS=$(detect_os)
|
OS=$(detect_os)
|
||||||
ARCH=$(detect_arch)
|
ARCH=$(detect_arch)
|
||||||
myprint_quiet $quiet "${GREEN}detected OS: $OS"
|
myprint_quiet $quiet "${GREEN}detected OS: $OS"
|
||||||
@ -58,15 +48,23 @@ function load_config {
|
|||||||
myprint "${YELLOW}Install it to get latest bugfixes."
|
myprint "${YELLOW}Install it to get latest bugfixes."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# throw error on undefined variable usage
|
||||||
set -u
|
set -u
|
||||||
include "$proj_conf_file"
|
include "$proj_conf_file"
|
||||||
|
|
||||||
|
# load project user config
|
||||||
|
local proj_conf_user_file="$proj_conf_file.user"
|
||||||
|
file_copy_default_if_not_present "$proj_conf_user_file" "$proj_conf_user_file.default"
|
||||||
|
myprint "${BLUE}loading ${WHITE}'$proj_conf_user_file'"
|
||||||
|
include "$proj_conf_user_file"
|
||||||
|
|
||||||
mkdir -p "$OUTDIR"
|
mkdir -p "$OUTDIR"
|
||||||
mkdir -p "$OBJDIR/objects"
|
mkdir -p "$OBJDIR/objects"
|
||||||
mkdir -p "$OBJDIR/static_libs"
|
mkdir -p "$OBJDIR/static_libs"
|
||||||
mkdir -p "$OBJDIR/dynamic_libs"
|
mkdir -p "$OBJDIR/dynamic_libs"
|
||||||
mkdir -p "$OBJDIR/profile"
|
mkdir -p "$OBJDIR/profile"
|
||||||
|
|
||||||
|
# dont thorw error on undefined variable
|
||||||
set +u
|
set +u
|
||||||
|
|
||||||
myprint_quiet $quiet "${GREEN}config loading completed"
|
myprint_quiet $quiet "${GREEN}config loading completed"
|
||||||
|
|||||||
@ -4,6 +4,7 @@ include "@cbuild/include/myprint.sh"
|
|||||||
|
|
||||||
function detect_os {
|
function detect_os {
|
||||||
local uname_result="$(uname -o)"
|
local uname_result="$(uname -o)"
|
||||||
|
# myprint "uname result: '$uname_result'"
|
||||||
case "$uname_result" in
|
case "$uname_result" in
|
||||||
Msys | Cygwin | MS/Windows)
|
Msys | Cygwin | MS/Windows)
|
||||||
safeprint WINDOWS
|
safeprint WINDOWS
|
||||||
|
|||||||
@ -233,9 +233,7 @@ function pack_static_lib {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
local command="ar rcs $OUTDIR/$outfile $objects"
|
local command="ar rcs $OUTDIR/$outfile $objects"
|
||||||
print_hline "${GRAY}" "─"
|
myprint "$command"
|
||||||
myprint "${GRAY}$command"
|
|
||||||
print_hline "${GRAY}" "─"
|
|
||||||
if $command
|
if $command
|
||||||
then
|
then
|
||||||
myprint "${GREEN}file $CYAN$outfile ${GREEN}created"
|
myprint "${GREEN}file $CYAN$outfile ${GREEN}created"
|
||||||
@ -270,9 +268,7 @@ function link {
|
|||||||
done
|
done
|
||||||
|
|
||||||
local command="$CMP_CPP $objects $static_libs $args $dynamic_libs_args -o $OUTDIR/$outfile"
|
local command="$CMP_CPP $objects $static_libs $args $dynamic_libs_args -o $OUTDIR/$outfile"
|
||||||
print_hline "${GRAY}" "─"
|
myprint "$command"
|
||||||
myprint "${GRAY}$command"
|
|
||||||
print_hline "${GRAY}" "─"
|
|
||||||
if $command
|
if $command
|
||||||
then
|
then
|
||||||
myprint "${GREEN}file $CYAN$outfile ${GREEN}created"
|
myprint "${GREEN}file $CYAN$outfile ${GREEN}created"
|
||||||
|
|||||||
@ -18,7 +18,7 @@ function safeprint {
|
|||||||
|
|
||||||
# prints text with special characters and resets color
|
# prints text with special characters and resets color
|
||||||
function myprint {
|
function myprint {
|
||||||
printf "$@${GRAY}\n"
|
printf "${GRAY}$@${GRAY}\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
function myprint_quiet {
|
function myprint_quiet {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
CBUILD_VERSION=2.3.1
|
CBUILD_VERSION=2.3.0
|
||||||
|
|
||||||
PROJECT="%PROJECT_NAME%"
|
PROJECT="%PROJECT_NAME%"
|
||||||
CMP_C="gcc"
|
CMP_C="gcc"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user