rebuild linac
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Joe 2024-02-14 12:45:17 -06:00
parent c8545a759d
commit 9024f131f1
Signed by: joe
GPG Key ID: 8595A3F8F2CE1B74
1 changed files with 22 additions and 18 deletions

40
linac
View File

@ -2,7 +2,7 @@
# shellcheck disable=SC1090,SC2004
projectName='LINAC'
projectDescription='LINAC is not a compiler'
projectVersion=0.10.0
projectVersion=0.10.1
projectAuthor='Joe <joe@thisisjoes.site>'
projectLicense='GPLv3'
Configure() {
@ -117,10 +117,13 @@ BuildModule() {
Log debug "Got args '$*'"
local module="$1"
local version="$2"
local module_path="${config[module_path]}"
cd "$module_path/${module}/${version}"
local module_path="${config[module_path]}"
local path="$module_path/${module}/${version}"
cd "$path" || {
Log error "Failed to enter module directory '$path' for module '$module'"
return 1
}
linac get && linac build -m "${module}.build"
}
RetrieveModule() {
@ -160,7 +163,7 @@ CheckModuleCache() {
GetModuleDependencies() {
local module_file="${projectName,,}.module"
local -A depends
local -A module_dependencies
if [[ -f "$module_file" ]]; then
. "$module_file" ||
@ -168,19 +171,20 @@ GetModuleDependencies() {
Log error "Failed to load LINAC module file '$module_file'"
return 1
}
Log info "Loaded LINAC module file '$module_file'"
else
Log info "'${projectName}' has no module file, skipping"
return 0
fi
local module
for module in "${!depends[@]}"; do
for module in "${!module_dependencies[@]}"; do
Log debug "$module"
Log debug "${depends[$module]}"
declare -A "$module"'='"${depends[$module]}"
Log debug "${module_dependencies[$module]}"
declare -A "$module"'='"${module_dependencies[$module]}"
done
for module in "${!depends[@]}"; do
for module in "${!module_dependencies[@]}"; do
local -n ref
ref=${module}
local version
@ -199,7 +203,7 @@ GetModulePaths() {
local module_file="${projectName,,}.module"
local -A depends
local -A module_dependencies
if [[ -f "$module_file" ]]; then
. "$module_file" ||
@ -213,13 +217,13 @@ GetModulePaths() {
fi
local module
for module in "${!depends[@]}"; do
for module in "${!module_dependencies[@]}"; do
Log debug "$module"
Log debug "${depends[$module]}"
declare -Ag "$module"'='"${depends[$module]}"
Log debug "${module_dependencies[$module]}"
declare -Ag "$module"'='"${module_dependencies[$module]}"
done
for module in "${!depends[@]}"; do
for module in "${!module_dependencies[@]}"; do
local -n ref
ref=${module}
local version
@ -277,8 +281,8 @@ BuildProject() {
GetModulePaths module_paths
local -a local_paths
mapfile -t local_paths < <(ProcessBuildFile "$target")
paths+=(${module_paths[@]})
paths+=(${local_paths[@]})
paths+=("${module_paths[@]}")
paths+=("${local_paths[@]}")
Log debug "Paths are '${paths[*]}'"
local files
@ -407,7 +411,7 @@ MakeStub() {
if [ -n "${config[shellcheck_ignore]}" ]; then
echo "# shellcheck disable=${config[shellcheck_ignore]}" >> "${config[build_path]}$name"
fi
cat "$name"'.info' >> "${config[build_path]}$name"
echo "$(<"$name"'.info')" >> "${config[build_path]}$name"
}
PrintInfo() {
echo -e "${projectName} ${projectVersion}"' - '"${projectDescription}"