Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfedr committed May 26, 2023
1 parent 9fdce87 commit 4e24ceb
Showing 1 changed file with 44 additions and 44 deletions.
88 changes: 44 additions & 44 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ variants=('30' '31' '32' '33')

## Disabled creating extra node variants, rather just having a default for each SDK
#node_variants=('14' '18')
declare -A default_node_variants=(
declare -A default_node_variants=(
['30']='14'
['31']='14'
['32']='18'
Expand All @@ -30,71 +30,71 @@ declare -A extra_packages=(
)

for variant in "${variants[@]}"; do
# for node_variant in "${node_variants[@]}"; do
for jdk_variant in "${jdk_variants[@]}"; do
for type in 'default' 'emulator' 'ndk' 'stf-client'; do
template="Dockerfile.template"
default_node_variant="${default_node_variants[$variant]}"
node_variant="$default_node_variant"
if [ "$type" != "default" ]; then
dir="$variant-$type"
if [ "$node_variant" != "$default_node_variant" ]; then
break 1
fi
if [ "$jdk_variant" != "$default_jdk_variant" ]; then
break 1
fi
else
dir="$variant"
if [ "$node_variant" != "$default_node_variant" ] && [ "$jdk_variant" != "$default_jdk_variant" ]; then
break 1
fi
fi

# for node_variant in "${node_variants[@]}"; do
for jdk_variant in "${jdk_variants[@]}"; do
for type in 'default' 'emulator' 'ndk' 'stf-client'; do
template="Dockerfile.template"
default_node_variant="${default_node_variants[$variant]}"
node_variant="$default_node_variant"
if [ "$type" != "default" ]; then
dir="$variant-$type"
if [ "$node_variant" != "$default_node_variant" ]; then
dir="$dir-node$node_variant"
break 1
fi

if [ "$jdk_variant" != "$default_jdk_variant" ]; then
dir="$dir-jdk$jdk_variant"
break 1
fi
else
dir="$variant"
if [ "$node_variant" != "$default_node_variant" ] && [ "$jdk_variant" != "$default_jdk_variant" ]; then
break 1
fi
fi

if [ "$node_variant" != "$default_node_variant" ]; then
dir="$dir-node$node_variant"
fi

echo "$dir"
if [ "$jdk_variant" != "$default_jdk_variant" ]; then
dir="$dir-jdk$jdk_variant"
fi

rm -rf "$dir"
mkdir -p "$dir"
cp -r tools/ "$dir/tools/"
echo "$dir"

extra_sed=''
if [ "$type" = "emulator" ]; then
cp -r tools-emulator/ "$dir/tools-emulator/"
else
extra_sed='
rm -rf "$dir"
mkdir -p "$dir"
cp -r tools/ "$dir/tools/"

extra_sed=''
if [ "$type" = "emulator" ]; then
cp -r tools-emulator/ "$dir/tools-emulator/"
else
extra_sed='
'"$extra_sed"'
/##<emulator>##/,/##<\/emulator>##/d;
'
fi
if [ "$type" != "ndk" ]; then
extra_sed='
fi
if [ "$type" != "ndk" ]; then
extra_sed='
'"$extra_sed"'
/##<ndk>##/,/##<\/ndk>##/d;
'
fi
if [ "$type" != "stf-client" ]; then
extra_sed='
fi
if [ "$type" != "stf-client" ]; then
extra_sed='
'"$extra_sed"'
/##<stf-client>##/,/##<\/stf-client>##/d;
'
fi
sed -E '
fi
sed -E '
'"$extra_sed"'
s/%%VARIANT%%/'"$variant"'/;
s/%%NODE_VARIANT%%/'"$node_variant"'/;
s/%%BUILD_TOOLS%%/'"${build_tools[$variant]}"'/;
s/%%EXTRA_PACKAGES%%/'"${extra_packages[$variant]}"'/;
s/%%JDK_VERSION%%/'"$jdk_variant"'/;
' $template >"$dir/Dockerfile"
done
done
# done
done
# done
done

0 comments on commit 4e24ceb

Please sign in to comment.