Skip to content

Commit a6cfbb4

Browse files
committed
chore(scripts): improve test app build scripts to be faster and more descriptive
1 parent 24accec commit a6cfbb4

File tree

4 files changed

+71
-71
lines changed

4 files changed

+71
-71
lines changed

packages/angular/test/build.sh

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,38 @@
11
#!/bin/bash
22

3-
# The directory where the source
4-
# for each specific application is.
3+
# Directory containing test application versions
4+
# (e.g. ng18, ng19, etc.)
55
APPS_DIR="apps"
66

7-
# The directory where the
8-
# base application logic is
7+
# Base application template that all test apps are built from
98
BASE_DIR="base"
9+
10+
# Output directory for built applications
1011
BUILD_DIR="build"
1112

12-
# The specific application
13-
# we are building
13+
# Application version to build (passed as first argument)
1414
APP_DIR="${1}"
1515

16-
# The full path to the specific application.
16+
# Full paths for source and destination
1717
FULL_APP_DIR="${APPS_DIR}/${APP_DIR}/."
18-
19-
# The full path to the base application.
2018
FULL_BASE_DIR="${BASE_DIR}/."
21-
22-
# The full path to the built application.
2319
BUILD_APP_DIR="${BUILD_DIR}/${APP_DIR}/"
2420

25-
# Make sure the full app directory exists.
21+
# Verify application version exists
2622
if [ ! -d $FULL_APP_DIR ]; then
2723
echo "Could not find test app: ${FULL_APP_DIR}"
2824
exit 1
2925
fi
3026

31-
# Make the build directory if it does not already exist.
27+
# Create build directory if needed
3228
mkdir -p $BUILD_DIR
3329

34-
# First we need to copy the base application
35-
cp -R $FULL_BASE_DIR $BUILD_APP_DIR
30+
# Copy base template first
31+
echo "Copying base application..."
32+
rsync -a --exclude='.git' --exclude='node_modules' $FULL_BASE_DIR $BUILD_APP_DIR
3633

37-
# Then we can copy the specific app which
38-
# will override any files in the base application.
39-
cp -R $FULL_APP_DIR $BUILD_APP_DIR
34+
# Copy version-specific files (overrides base template)
35+
echo "Copying application version..."
36+
rsync -a --exclude='.git' --exclude='node_modules' $FULL_APP_DIR $BUILD_APP_DIR
4037

4138
echo "Copied test app files for ${APP_DIR}"
Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,38 @@
11
#!/bin/bash
22

3-
# The directory where the source
4-
# for each specific application is.
3+
# Directory containing test application versions
4+
# (e.g. reactrouter5, reactrouter6, etc.)
55
APPS_DIR="apps"
66

7-
# The directory where the
8-
# base application logic is
7+
# Base application template that all test apps are built from
98
BASE_DIR="base"
9+
10+
# Output directory for built applications
1011
BUILD_DIR="build"
1112

12-
# The specific application
13-
# we are building
13+
# Application version to build (passed as first argument)
1414
APP_DIR="${1}"
1515

16-
# The full path to the specific application.
16+
# Full paths for source and destination
1717
FULL_APP_DIR="${APPS_DIR}/${APP_DIR}/."
18-
19-
# The full path to the base application.
2018
FULL_BASE_DIR="${BASE_DIR}/."
21-
22-
# The full path to the built application.
2319
BUILD_APP_DIR="${BUILD_DIR}/${APP_DIR}/"
2420

25-
# Make the build directory if it does not already exist.
21+
# Verify application version exists
22+
if [ ! -d $FULL_APP_DIR ]; then
23+
echo "Could not find test app: ${FULL_APP_DIR}"
24+
exit 1
25+
fi
26+
27+
# Create build directory if needed
2628
mkdir -p $BUILD_DIR
2729

28-
# First we need to copy the base application
29-
cp -R $FULL_BASE_DIR $BUILD_APP_DIR
30+
# Copy base template first
31+
echo "Copying base application..."
32+
rsync -a --exclude='.git' --exclude='node_modules' $FULL_BASE_DIR $BUILD_APP_DIR
33+
34+
# Copy version-specific files (overrides base template)
35+
echo "Copying application version..."
36+
rsync -a --exclude='.git' --exclude='node_modules' $FULL_APP_DIR $BUILD_APP_DIR
3037

31-
# Then we can copy the specific app which
32-
# will override any files in the base application.
33-
cp -R $FULL_APP_DIR $BUILD_APP_DIR
38+
echo "Copied test app files for ${APP_DIR}"

packages/react/test/build.sh

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
11
#!/bin/bash
22

3-
# The directory where the source
4-
# for each specific application is.
3+
# Directory containing test application versions
4+
# (e.g. react18, react19, etc.)
55
APPS_DIR="apps"
66

7-
# The directory where the
8-
# base application logic is
7+
# Base application template that all test apps are built from
98
BASE_DIR="base"
9+
10+
# Output directory for built applications
1011
BUILD_DIR="build"
1112

12-
# The specific application
13-
# we are building
13+
# Application version to build (passed as first argument)
1414
APP_DIR="${1}"
1515

16-
# The full path to the specific application.
16+
# Full paths for source and destination
1717
FULL_APP_DIR="${APPS_DIR}/${APP_DIR}/."
18-
19-
# The full path to the base application.
2018
FULL_BASE_DIR="${BASE_DIR}/."
21-
22-
# The full path to the built application.
2319
BUILD_APP_DIR="${BUILD_DIR}/${APP_DIR}/"
2420

25-
# Make sure the full app directory exists.
21+
# Verify application version exists
2622
if [ ! -d $FULL_APP_DIR ]; then
2723
echo "Could not find test app: ${FULL_APP_DIR}"
2824
exit 1
2925
fi
3026

31-
# Make the build directory if it does not already exist.
27+
# Create build directory if needed
3228
mkdir -p $BUILD_DIR
3329

34-
# First we need to copy the base application
35-
cp -R $FULL_BASE_DIR $BUILD_APP_DIR
30+
# Copy base template first
31+
echo "Copying base application..."
32+
rsync -a --exclude='.git' --exclude='node_modules' $FULL_BASE_DIR $BUILD_APP_DIR
33+
34+
# Copy version-specific files (overrides base template)
35+
echo "Copying application version..."
36+
rsync -a --exclude='.git' --exclude='node_modules' $FULL_APP_DIR $BUILD_APP_DIR
3637

37-
# Then we can copy the specific app which
38-
# will override any files in the base application.
39-
cp -R $FULL_APP_DIR $BUILD_APP_DIR
38+
echo "Copied test app files for ${APP_DIR}"

packages/vue/test/build.sh

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
11
#!/bin/bash
22

3-
# The directory where the source
4-
# for each specific application is.
3+
# Directory containing test application versions
4+
# (e.g. vue2, vue3, etc.)
55
APPS_DIR="apps"
66

7-
# The directory where the
8-
# base application logic is
7+
# Base application template that all test apps are built from
98
BASE_DIR="base"
9+
10+
# Output directory for built applications
1011
BUILD_DIR="build"
1112

12-
# The specific application
13-
# we are building
13+
# Application version to build (passed as first argument)
1414
APP_DIR="${1}"
1515

16-
# The full path to the specific application.
16+
# Full paths for source and destination
1717
FULL_APP_DIR="${APPS_DIR}/${APP_DIR}/."
18-
19-
# The full path to the base application.
2018
FULL_BASE_DIR="${BASE_DIR}/."
21-
22-
# The full path to the built application.
2319
BUILD_APP_DIR="${BUILD_DIR}/${APP_DIR}/"
2420

25-
# Make sure the full app directory exists.
21+
# Verify application version exists
2622
if [ ! -d $FULL_APP_DIR ]; then
2723
echo "Could not find test app: ${FULL_APP_DIR}"
2824
exit 1
2925
fi
3026

31-
# Make the build directory if it does not already exist.
27+
# Create build directory if needed
3228
mkdir -p $BUILD_DIR
3329

34-
# First we need to copy the base application
35-
cp -R $FULL_BASE_DIR $BUILD_APP_DIR
30+
# Copy base template first
31+
echo "Copying base application..."
32+
rsync -a --exclude='.git' --exclude='node_modules' $FULL_BASE_DIR $BUILD_APP_DIR
33+
34+
# Copy version-specific files (overrides base template)
35+
echo "Copying application version..."
36+
rsync -a --exclude='.git' --exclude='node_modules' $FULL_APP_DIR $BUILD_APP_DIR
3637

37-
# Then we can copy the specific app which
38-
# will override any files in the base application.
39-
cp -R $FULL_APP_DIR $BUILD_APP_DIR
38+
echo "Copied test app files for ${APP_DIR}"

0 commit comments

Comments
 (0)