[fpc-pascal] Introducing PasBuild 1.0.0 - Maven-Inspired Build Tool for Free Pascal
mailinglists at geldenhuys.co.uk
mailinglists at geldenhuys.co.uk
Tue Dec 9 17:28:04 CET 2025
Hi all,
I'm excited to announce the first release of PasBuild v1.0.0, a
modern build automation tool for Free Pascal projects inspired by
Apache Maven!
GitHub: https://github.com/graemeg/PasBuild
Why PasBuild?
=============
While fpmake is powerful, it can be laborious to create and
maintain, especially for large projects. A real-world example:
fpGUI Toolkit has 120+ units, include files in various locations,
and platform-dependent directory trees. The fpmake.pp file was
40KB with over 750 lines of code that needed constant updates when
adding or removing units.
PasBuild's project.xml? Just 3KB and 117 lines - and we know how
verbose XML is. ;-) No updates needed when units change - it
self-discovers your code and dynamically builds the FPC command!
Key Features
============
Convention Over Configuration
-----------------------------
- Standard directory layout (src/main/pascal, src/test/pascal)
- Zero configuration for projects following conventions
- Override only what you need to customize
Intelligent Automation
----------------------
- Auto-discovers all units and subdirectories
- Automatic include path detection (*.inc files)
- Self-maintaining - add/remove files without updating config
- Cross-platform path handling (src/main/pascal → src\main\pascal)
Complete Build Lifecycle
-------------------------
- clean: Remove build artifacts
- compile: Build your executable or library
- test: Compile and run tests (FPCUnit/FPTest auto-detection)
- package: Create release archives
- source-package: Generate source distributions
Build Profiles
--------------
- Define multiple build configurations (debug, release, etc.)
- Activate single or multiple profiles: -p base,debug,logging
- Profile-specific compiler options and defines
- Perfect for cross-platform conditional compilation
Resource Management
-------------------
- Automatic resource copying to target directory
- Variable filtering: ${project.version} → 1.0.0
- Supports both main and test resources
- Version injection via resource filtering
Developer-Friendly
------------------
- Single XML configuration file (project.xml)
- Semantic versioning 2.0.0 with pre-release tags
- Verbose mode for debugging (-v flag)
- Alternate project files support (-f custom.xml)
- Maven-style goal dependencies
Cross-Platform
--------------
- Works identically on Linux, Windows, macOS, FreeBSD
- Automatic path separator handling
- Platform-specific conditional compilation support
Self-Hosting
------------
- PasBuild builds itself using project.xml
- Demonstrates best practices
- Easy to bootstrap from source
Real-World Testing
==================
PasBuild has been extensively tested with:
- Multiple production applications
- fpGUI Toolkit (120+ units, complex structure)
- Projects with platform-dependent code trees
- Libraries and applications alike
Example: Minimal project.xml
=============================
<?xml version="1.0" encoding="UTF-8"?>
<project>
<name>MyApp</name>
<version>1.0.0</version>
<author>Your Name</author>
<license>BSD-3-Clause</license>
<build>
<mainSource>Main.pas</mainSource>
<executableName>myapp</executableName>
</build>
</project>
That's it! PasBuild handles the rest automatically.
Getting Started
===============
# Bootstrap compilation
mkdir -p target/units
echo '1.0.0' > target/version.inc
fpc -Mobjfpc -O1 -FEtarget -FUtarget/units -Fitarget \
-Fusrc/main/pascal src/main/pascal/PasBuild.pas
# Now use PasBuild to build itself
./target/pasbuild compile
# Create a new project
mkdir myproject && cd myproject
pasbuild init
Documentation
=============
Comprehensive documentation available in the repository:
- Quick Start Guide: docs/quick-start-guide.adoc
- Design Document: docs/design.adoc
- Bootstrap Instructions: BOOTSTRAP.txt
Try It Today!
=============
Clone from GitHub:
git clone https://github.com/graemeg/PasBuild.git
Your feedback and contributions are welcome! Please
kindly use the GitHub Issue Tracker.
More features to come soon.
License: BSD-3-Clause
Regards,
- Graeme -
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
More information about the fpc-pascal
mailing list