Skip to content

Commit

Permalink
Fix incorrect naming for main proj (i.e., root build dir)
Browse files Browse the repository at this point in the history
  • Loading branch information
L1ghtmann authored and 0cyn committed Jan 14, 2024
1 parent 7610ba3 commit 4ad04fd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
15 changes: 9 additions & 6 deletions bin/dragon
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,12 @@ get_subprojs()
# Relying on generator to obtain project info
# shellcheck disable=SC2207
subsb=($(python3 -c "print('${project_dirs}' if ('${project_dirs}'.count('.')<2) else '${project_names}')"))
proj_names=($(python3 -c "print('${project_names}')"))
set +f
index=0
for i in "${subsb[@]}"; do
echo "$i"
echo "$i ${proj_names[$index]}"
((index++))
done
}

Expand All @@ -189,11 +192,11 @@ get_subprojs()
# --------
if [[ $clean -eq 1 ]]; then
# clean subproj build dir(s)
get_subprojs | while read -r i; do
clean_dir $i
get_subprojs | while read -r i j; do
clean_dir $i $j
done
# ensure clean primary build dir
clean_dir .
clean_dir . $(basename $PWD)
fi


Expand All @@ -204,14 +207,14 @@ if [[ $build -eq 1 ]]; then
mkdir -p "$DRAGON_DATA_DIR"
cp DragonMake "$DRAGON_DATA_DIR/DragonMake" 2> /dev/null

get_subprojs | while read -r i; do
get_subprojs | while read -r i j; do
# Copy the DragonMake into the subproject's build directory
# Primarily for bundle filter gen, right now.
if [[ -d $i ]]; then
mkdir -p "$i/$DRAGON_DIR/"
cp DragonMake "$i/$DRAGON_DIR/DragonMake" 2> /dev/null
fi
build $i
build $i $j
done

find . -name '.clean' -type f -delete
Expand Down
21 changes: 7 additions & 14 deletions src/dragon/shscripts/building
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
#!/usr/bin/env bash

get_name()
{
if [[ $1 == "." ]]; then
i=$(basename $PWD)
else
i=$1
fi
echo "$i"
}

clean_dir()
{
DNAME=$(get_name $1)
DNAME=$1
PROJ=$2
pushd $DNAME &> /dev/null
if [[ -d $DRAGON_DIR && ! -f $DRAGON_DIR/.clean ]]; then
prefix_print "Cleaning $DNAME"
prefix_print "Cleaning $PROJ"
if [[ -z $DRAGON_DIR ]]; then
drexit_reason "nil DRAGON_DIR"
fi
Expand Down Expand Up @@ -52,8 +44,9 @@ build()

mkdir -p $DRAGON_DIR/_/.dragonbuilding $DRAGON_DIR/modules

DNAME=$(get_name $1)
prefix_print "Building $DNAME"
DNAME=$1
PROJ=$2
prefix_print "Building $PROJ"

if ! [[ -e build.ninja ]]; then
mv "${i}.ninja" build.ninja
Expand All @@ -79,7 +72,7 @@ build()

# mv build.ninja $DRAGON_DIR/ninja # Was this renamed "ninja" for use elsewhere?
mv build.ninja $DRAGON_DIR/build.ninja
if [[ $1 == "." ]]; then
if [[ $DNAME == "." ]]; then
true
else
cp -R $DRAGON_DIR/_ "$DRAGON_DATA_DIR" 2>/dev/null
Expand Down

0 comments on commit 4ad04fd

Please sign in to comment.