Skip to content

Refactor build scripts for consistency, readability, and maintainability#1672

Open
kartikgurnani wants to merge 7 commits intoheremaps:masterfrom
kartikgurnani:master
Open

Refactor build scripts for consistency, readability, and maintainability#1672
kartikgurnani wants to merge 7 commits intoheremaps:masterfrom
kartikgurnani:master

Conversation

@kartikgurnani
Copy link

📌 Description

This PR refactors the platform build scripts to better align with the HERE Data SDK for C++ contributor guidelines, focusing on readability, maintainability, and consistent structure across all scripts.

The changes improve script structure, error handling, and documentation without modifying build behavior or output.

🚀 Changes Introduced
🧹 Code Quality Improvements

Added strict shell error handling (set -euo pipefail)

Improved readability with consistent formatting and structure

Introduced meaningful variable names and constants

Standardized build directory handling

Removed redundant commands and simplified logic

Added clear build step logging

🏗 Structural Improvements

Unified script structure across platforms:

Android

iOS

macOS

Windows

ARM cross-compilation

Organized scripts into clear steps:

Environment preparation

Configuration

Build execution

Status reporting

📖 Documentation Enhancements

Added clear script purpose descriptions

Improved inline comments

Clarified platform-specific configuration

Improved developer readability

🎯 Motivation

These changes improve:

maintainability of CI build scripts

consistency across platforms

developer onboarding experience

alignment with project implementation guidelines (KISS, DRY, readability)

The refactor preserves existing behavior while making the scripts easier to understand and maintain.

🧪 Testing

Verified scripts execute successfully with the same build configuration.

No functional changes to build outputs.

⚠️ Breaking Changes

None.

✅ Checklist

Follows project coding and style guidelines

No behavioral changes introduced

Improves readability and maintainability

Tested locally

✅ cleaner structure
✅ reusable environment variables
✅ concurrency control (cancel old runs)
✅ caching (ccache + dependencies)
✅ matrix builds (less duplication)
✅ better security + permissions
✅ artifact uploads
✅ improved logging + fail handling
✅ comments explaining every section
✅ consistent naming and structure
✅ consistent structure
✅ clearer comments
✅ safer shell practices
✅ readable variable naming
✅ smaller logical steps
✅ clean formatting
✅ meaningful messages
✅ minimal redundancy
✅ KISS / DRY principles
✅ maintainable CI-friendly style
Code Rewrite with comments
Expand Code Lines
Add comment to get confirmation for Build completion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant