This guide covers all configuration options for the Bearsampp Python module build system.
Main bundle configuration file.
Location: build.properties
Format: Java Properties
Required Properties:
# Bundle name (used for directory naming)
bundle.name = python
# Bundle release version
bundle.release = 2025.8.21
# Bundle type (tools, apps, bins)
bundle.type = tools
# Archive format (7z, zip, tar, tar.gz)
bundle.format = 7zOptional Properties:
# Custom build path (defaults to ~/Bearsampp-build)
build.path = C:/Bearsampp-build
# Custom temporary path (defaults to {build.path}/tmp)
#tmp.path = C:/Bearsampp-build/tmp
# Custom release path (defaults to {build.path}/release)
#release.path = C:/Bearsampp-build/releaseExample:
bundle.name = python
bundle.release = 2025.8.21
bundle.type = tools
bundle.format = 7z
build.path = D:/CustomBuildPathGradle build configuration.
Location: gradle.properties
Format: Java Properties
Daemon Configuration:
# Enable Gradle daemon for faster builds
org.gradle.daemon=true
# Daemon idle timeout in milliseconds (default: 3 hours)
org.gradle.daemon.idletimeout=10800000Performance Configuration:
# Enable parallel execution
org.gradle.parallel=true
# Maximum number of worker processes
org.gradle.workers.max=4
# Enable build caching
org.gradle.caching=true
# Enable configuration on demand
org.gradle.configureondemand=falseJVM Configuration:
# JVM arguments for Gradle
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError
# For larger builds
#org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g -XX:+UseG1GCConsole Configuration:
# Console output mode (auto, plain, rich, verbose)
org.gradle.console=auto
# Warning mode (all, fail, summary, none)
org.gradle.warning.mode=all
# Logging level (quiet, warn, lifecycle, info, debug)
org.gradle.logging.level=lifecycleBuild Configuration:
# Enable configuration cache (experimental)
org.gradle.unsafe.configuration-cache=true
# Enable file system watching
org.gradle.vfs.watch=true
# Enable verbose logging
org.gradle.logging.stacktrace=internalExample:
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g
org.gradle.console=rich
org.gradle.warning.mode=allGradle settings configuration.
Location: settings.gradle
Format: Groovy DSL
Basic Configuration:
// Project name
rootProject.name = 'module-python'Feature Previews:
// Enable stable configuration cache
enableFeaturePreview('STABLE_CONFIGURATION_CACHE')
// Enable type-safe project accessors
enableFeaturePreview('TYPESAFE_PROJECT_ACCESSORS')Build Cache Configuration:
buildCache {
local {
enabled = true
directory = file("${rootDir}/.gradle/build-cache")
removeUnusedEntriesAfterDays = 30
}
}Plugin Management:
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
}
}Example:
rootProject.name = 'module-python'
enableFeaturePreview('STABLE_CONFIGURATION_CACHE')
buildCache {
local {
enabled = true
directory = file("${rootDir}/.gradle/build-cache")
removeUnusedEntriesAfterDays = 30
}
}
gradle.rootProject {
println "Initializing Bearsampp Module Python Build"
}Available Python releases configuration.
Location: releases.properties
Format: Java Properties
Structure:
{version}={download_url}Example:
3.10.6=https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exe
3.10.9=https://www.python.org/ftp/python/3.10.9/python-3.10.9-amd64.exe
3.11.5=https://www.python.org/ftp/python/3.11.5/python-3.11.5-amd64.exe
3.11.8=https://www.python.org/ftp/python/3.11.8/python-3.11.8-amd64.exe
3.12.2=https://www.python.org/ftp/python/3.12.2/python-3.12.2-amd64.exe
3.12.9=https://www.python.org/ftp/python/3.12.9/python-3.12.9-amd64.exe
3.13.2=https://www.python.org/ftp/python/3.13.2/python-3.13.2-amd64.exe
3.13.5=https://www.python.org/ftp/python/3.13.5/python-3.13.5-amd64.exeWheel package configuration (per Python version).
Location: bin/python{version}/wheel/wheel.properties
Format: Java Properties
Structure:
wheel={wheel_package_url}Example:
wheel=https://files.pythonhosted.org/packages/28/6c/640e3f5c734c296a7193a483a1a120ae66e0c3a5a562e6b3c4b8f8f3e1f/PyQt5-5.15.9-cp313-cp313-win_amd64.whlMultiple Wheels (if needed):
wheel.pyqt5=https://files.pythonhosted.org/packages/.../PyQt5-5.15.9-cp313-cp313-win_amd64.whl
wheel.numpy=https://files.pythonhosted.org/packages/.../numpy-1.24.3-cp313-cp313-win_amd64.whlEach Python version must follow this structure:
bin/python{version}/
├── bin/
│ ├── python.bat # Python launcher
│ ├── python.exe # Python executable
│ └── [other binaries]
├── wheel/
│ ├── wheel.properties # Wheel configuration
│ └── install.bat # Installation script
├── bearsampp.conf # Bearsampp configuration
├── Lib/ # Python libraries
├── DLLs/ # Python DLLs
└── [other Python files]
Bearsampp module configuration.
Location: bin/python{version}/bearsampp.conf
Format: INI
Example:
[python]
name = "Python"
version = "3.13.5"
release = "2025.8.21"Wheel installation script.
Location: bin/python{version}/wheel/install.bat
Format: Batch Script
Example:
@echo off
cd ..
bin\python.bat -m pip install wheel\PyQt5-5.15.9-cp313-cp313-win_amd64.whlMultiple Wheels:
@echo off
cd ..
bin\python.bat -m pip install wheel\PyQt5-5.15.9-cp313-cp313-win_amd64.whl
bin\python.bat -m pip install wheel\numpy-1.24.3-cp313-cp313-win_amd64.whlbuildPath = "${System.getProperty('user.home')}/Bearsampp-build"
tmpPath = "${buildPath}/tmp"
releasePath = "${buildPath}/release"Windows Example:
- Build Path:
C:/Users/username/Bearsampp-build - Temp Path:
C:/Users/username/Bearsampp-build/tmp - Release Path:
C:/Users/username/Bearsampp-build/release
Override in build.properties:
build.path = D:/CustomBuildPathResults in:
- Build Path:
D:/CustomBuildPath - Temp Path:
D:/CustomBuildPath/tmp - Release Path:
D:/CustomBuildPath/release
- 7z (default): 7-Zip format, best compression
- zip: Standard ZIP format
- tar: TAR archive
- tar.gz: Compressed TAR archive
In build.properties:
bundle.format = 7z| Format | Compression | Speed | Compatibility |
|---|---|---|---|
| 7z | Excellent | Medium | Requires 7-Zip |
| zip | Good | Fast | Universal |
| tar | None | Fast | Unix/Linux |
| tar.gz | Good | Medium | Unix/Linux |
Small Builds (< 1GB):
org.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=256mMedium Builds (1-2GB):
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512mLarge Builds (> 2GB):
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1gG1GC (recommended for large heaps):
org.gradle.jvmargs=-Xmx4g -XX:+UseG1GCParallel GC (default):
org.gradle.jvmargs=-Xmx2g -XX:+UseParallelGCHeap Dump on OOM:
org.gradle.jvmargs=-Xmx2g -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./heap-dump.hprofGC Logging:
org.gradle.jvmargs=-Xmx2g -Xlog:gc*:file=gc.logEnable parallel task execution:
org.gradle.parallel=true
org.gradle.workers.max=4Recommended Workers:
- 2-4 cores:
workers.max=2 - 4-8 cores:
workers.max=4 - 8+ cores:
workers.max=8
Enable build caching:
org.gradle.caching=trueConfigure cache in settings.gradle:
buildCache {
local {
enabled = true
directory = file("${rootDir}/.gradle/build-cache")
removeUnusedEntriesAfterDays = 30
}
}Enable configuration cache (experimental):
org.gradle.unsafe.configuration-cache=trueOr use feature preview in settings.gradle:
enableFeaturePreview('STABLE_CONFIGURATION_CACHE')Enable file system watching:
org.gradle.vfs.watch=true# Gradle user home
GRADLE_USER_HOME=C:/Users/username/.gradle
# Gradle options
GRADLE_OPTS=-Xmx2g -XX:MaxMetaspaceSize=512m
# Java home
JAVA_HOME=C:/Program Files/Java/jdk-17# Custom build path
BEARSAMPP_BUILD_PATH=D:/CustomBuildPath
# Python version
PYTHON_VERSION=3.13.5Add custom configuration to build.gradle:
ext {
// Custom properties
customBuildPath = System.getenv('CUSTOM_BUILD_PATH') ?: buildPath
skipWheelInstall = project.hasProperty('skipWheels')
}
tasks.register('customRelease') {
group = 'build'
description = 'Custom release with additional steps'
doLast {
// Custom build logic
}
}if (project.hasProperty('production')) {
// Production configuration
ext.buildPath = 'D:/Production/Bearsampp-build'
} else {
// Development configuration
ext.buildPath = "${System.getProperty('user.home')}/Bearsampp-build"
}Create profile-specific properties:
gradle-dev.properties:
org.gradle.jvmargs=-Xmx1g
build.path=./build-devgradle-prod.properties:
org.gradle.jvmargs=-Xmx4g
build.path=D:/Production/Bearsampp-buildUse with:
gradle release -Pprofile=prod# Validate build.properties
gradle validateProperties
# Validate Python version
gradle validatePythonVersion "-PbundleVersion=3.13.5"
# Verify entire environment
gradle verify-
build.propertieshas all required properties -
gradle.propertieshas appropriate JVM settings - Python versions exist in
bin/directory - Each version has
wheel.propertiesandinstall.bat - 7-Zip is installed and in PATH
- Dev directory exists in parent directory
- Build path is writable
Issue: Out of memory errors
Solution: Increase heap size in gradle.properties:
org.gradle.jvmargs=-Xmx4gIssue: Slow builds
Solution: Enable parallel execution and caching:
org.gradle.parallel=true
org.gradle.caching=trueIssue: Configuration cache warnings
Solution: Disable configuration cache:
org.gradle.unsafe.configuration-cache=false- Use version control: Track all configuration files in Git
- Document changes: Add comments for custom configurations
- Test configurations: Validate after changes with
gradle verify - Use profiles: Separate dev and production configurations
- Monitor performance: Adjust JVM settings based on build times
- Keep updated: Use latest stable Gradle version
- Backup configurations: Keep copies of working configurations