Serge Huber created UNOMI-887:
---------------------------------

             Summary: Introduce enhanced build.sh script with improved 
developer experience
                 Key: UNOMI-887
                 URL: https://issues.apache.org/jira/browse/UNOMI-887
             Project: Apache Unomi
          Issue Type: Sub-task
          Components: unomi(-core)
    Affects Versions: unomi-3.0.0
            Reporter: Serge Huber
             Fix For: unomi-3.0.0


h3. Overview

This ticket introduces a new enhanced
{noformat}
build.sh{noformat}
script for Apache Unomi 3.x that significantly improves the developer 
experience by providing a robust, user-friendly build system with comprehensive 
error handling, colorized output, and multiple build configuration options.
h3. Features

The script includes the following key features:
h4. Comprehensive Error Handling

Detailed error messages with line numbers and function traces
Trap mechanism to catch failures during build process
Visually distinct error output
h4. User-Friendly Output

Colorized terminal output (automatically disabled if colors not supported)
Progress tracking for build steps
Unicode symbols for status indicators (with ASCII fallbacks)
Section headers for better visual organization
h4. System Requirements Validation

Checks for required tools (Java, Maven, GraphViz, etc.)
Verifies minimum versions of required dependencies
Validates system resources (memory, disk space)
Confirms port availability for debug sessions
h4. Build Configuration Options
{panel:title=Command Line Options}
{noformat}
--skip-tests{noformat}
: Skip all tests
{noformat}
--integration-tests{noformat}
: Run integration tests
{noformat}
--deploy{noformat}
: Deploy after build
{noformat}
--debug{noformat}
: Run Karaf in debug mode
{noformat}
--debug-port{noformat}
: Set debug port (default: 5005)
{noformat}
--debug-suspend{noformat}
: Suspend JVM until debugger connects
{noformat}
--no-maven-cache{noformat}
: Disable Maven build cache
{noformat}
--purge-maven-cache{noformat}
: Purge local Maven cache before building
{noformat}
--karaf-home{noformat}
: Set Karaf home directory for deployment
{noformat}
--use-opensearch{noformat}
: Use OpenSearch instead of ElasticSearch
{noformat}
--no-karaf{noformat}
: Build without starting Karaf
{noformat}
--auto-start{noformat}
: Auto-start with specified search engine
{noformat}
--single-test{noformat}
: Run a single integration test
{noformat}
--it-debug{noformat}
: Enable integration test debug mode
{noformat}
--it-debug-port{noformat}
: Set integration test debug port
{noformat}
--it-debug-suspend{noformat}
: Suspend integration test until debugger connects
{noformat}
-X, --maven-debug{noformat}
: Enable Maven debug output
{noformat}
-o, --offline{noformat}
: Run Maven in offline mode
{panel}
h4. Environment Integration

Support for Darwin/macOS and Linux environments
Detection of Apple Silicon (M1/M2) for appropriate Java recommendations
Adherence to NO_COLOR standard [https://no-color.org/]
Terminal capability detection
h3. Benefits

Improved Developer Experience: Clear, informative output and helpful error 
messages
Time Savings: Reduced troubleshooting time for build issues
Consistency: Standardized build process across development environments
Flexibility: Multiple configuration options for different development needs
Quality Assurance: Automatic validation of environment prerequisites
h3. Testing Done

Verified all command line options function as expected
Confirmed error handling works properly for various failure scenarios
Validated color output displays correctly on supported terminals
Tested deployments to existing Karaf instances
h3. Documentation

The script includes detailed help text (
{noformat}
--help{noformat}
) with explanations of all options and example usages.
h2. How to Test

Clone the unomi-3 branch
Run
{noformat}
./build.sh --help{noformat}
to see available options
Test basic build with
{noformat}
./build.sh{noformat}
Test with various options like
{noformat}
./build.sh --integration-tests --use-opensearch{noformat}
Verify the error handling by intentionally causing failures
Test debug mode with
{noformat}
./build.sh --debug{noformat}
h2. Additional Notes

This script serves as the foundation for the Unomi 3.x build system and will be 
maintained alongside the codebase to ensure compatibility with future changes.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to