11#! /bin/bash
2- # This script configures and builds the project using configuration from build_config.ini
2+ # This script cleans the build directory then calls the fast version to build
33set -e
44
55# Function to read INI configuration file
@@ -71,8 +71,7 @@ log() {
7171}
7272
7373log " ========================================" " INFO"
74- log " Starting Linux Build Process" " INFO"
75- log " You shell specified all build settings in build_config.ini before action builds..." " INFO"
74+ log " Starting Linux Build Process (Full Clean + Build)" " INFO"
7675log " ========================================" " INFO"
7776
7877# Get the script directory and project root
@@ -94,11 +93,8 @@ eval "$(get_ini_config "$CONFIG_FILE")"
9493log " Configuration loaded successfully!" " SUCCESS"
9594
9695# Extract configuration values
97- GENERATOR= " $config_cmake_generator "
98- TOOLCHAIN= " $config_cmake_toolchain "
9996SOURCE_DIR= " $config_paths_source "
10097BUILD_DIR= " $config_paths_build_dir "
101- JOBS= " ${config_options_jobs:- } "
10298
10399# Resolve source directory: if relative, make it relative to project root
104100if [[ " $SOURCE_DIR " = /* ]]; then
@@ -109,21 +105,17 @@ else
109105 RESOLVED_SOURCE_DIR=" $( cd " $PROJECT_ROOT /$SOURCE_DIR " 2> /dev/null && pwd) " || " $PROJECT_ROOT /$SOURCE_DIR "
110106fi
111107
112- log " Generator: $GENERATOR " " INFO"
113- log " Toolchain: $TOOLCHAIN " " INFO"
114108log " Source directory: $SOURCE_DIR (resolved: $RESOLVED_SOURCE_DIR )" " INFO"
115109log " Build directory: $BUILD_DIR " " INFO"
116- log " Parallel jobs: ${JOBS:- auto} " " INFO"
117110
118- # Step 0 : Clean build directory
111+ # Step 1 : Clean build directory
119112log " ========================================" " INFO"
120- log " Step 0: Cleaning build directory" " INFO"
121- log " Build directory path: $BUILD_DIR " " INFO"
113+ log " Step 1: Cleaning build directory" " INFO"
122114log " ========================================" " INFO"
123115
124116FULL_BUILD_PATH= " $PROJECT_ROOT /$BUILD_DIR "
125117
126- # Step 0 : Clear the Build Directory
118+ # Step 1 : Clear the Build Directory
127119if [[ -d " $FULL_BUILD_PATH " ]]; then
128120 log " Removing existing build directory: $FULL_BUILD_PATH " " INFO"
129121 if rm -rf " $FULL_BUILD_PATH " ; then
@@ -136,46 +128,24 @@ else
136128 log " Build directory does not exist, skipping clean step" " INFO"
137129fi
138130
139- # Step 1: Configure with CMake
131+ # Step 2: Call the fast build script
140132log " ========================================" " INFO"
141- log " Step 1: Configuring with CMake" " INFO"
142- log " Command: cmake -G $GENERATOR -DUSE_TOOLCHAIN=$TOOLCHAIN -S $RESOLVED_SOURCE_DIR -B $BUILD_DIR " " INFO"
133+ log " Step 2: Calling fast build script" " INFO"
143134log " ========================================" " INFO"
144135
145- if cmake -G " $GENERATOR " -DUSE_TOOLCHAIN=" $TOOLCHAIN " -S " $RESOLVED_SOURCE_DIR " -B " $BUILD_DIR " ; then
146- log " CMake configuration completed successfully!" " SUCCESS"
147- else
148- exit_code=$?
149- log " CMake configuration failed with exit code: $exit_code " " ERROR"
150- exit $exit_code
151- fi
136+ FAST_BUILD_SCRIPT= " $SCRIPT_DIR /linux_fast_develop_build.sh"
137+ log " Executing: $FAST_BUILD_SCRIPT " " INFO"
152138
153- # Step 2: Build with CMake
154- log " ========================================" " INFO"
155- log " Step 2: Building project" " INFO"
156-
157- # Prepare build command with parallel jobs if specified
158- BUILD_CMD= " cmake --build \" $BUILD_DIR \" "
159- if [[ -n " $JOBS " ]]; then
160- BUILD_CMD=" $BUILD_CMD --parallel \" $JOBS \" "
161- log " Command: cmake --build $BUILD_DIR --parallel $JOBS " " INFO"
162- else
163- log " Command: cmake --build $BUILD_DIR " " INFO"
164- fi
165- log " ========================================" " INFO"
166-
167- if eval " $BUILD_CMD " ; then
168- log " Build completed successfully!" " SUCCESS"
139+ if bash " $FAST_BUILD_SCRIPT " ; then
140+ log " ========================================" " INFO"
141+ log " Build process completed successfully!" " SUCCESS"
142+ log " ========================================" " INFO"
169143else
170144 exit_code=$?
171- log " Build failed with exit code: $exit_code " " ERROR"
145+ log " Fast build script failed with exit code: $exit_code " " ERROR"
172146 exit $exit_code
173147fi
174148
175- log " ========================================" " INFO"
176- log " Build process completed successfully!" " SUCCESS"
177- log " ========================================" " INFO"
178-
179149# Step 3: Run tests
180150log " ========================================" " INFO"
181151log " Step 3: Running tests" " INFO"
0 commit comments