Setting up macOS Build Environment for DIYLC
This document describes how to set up a macOS machine for building and signing DIYLC application bundles.
Prerequisites
-
macOS System
- macOS 11 (Big Sur) or later
- Xcode Command Line Tools installed
xcode-select --install -
Java Development Kit
- Install JDK 17 (recommended to use SDKMAN!)
# Install SDKMAN! curl -s "https://get.sdkman.io" | bash source "$HOME/.sdkman/bin/sdkman-init.sh" # Install JDK 17 sdk install java 17.0.14-tem -
Maven
- Install Maven 3.9 or later
sdk install maven
Apple Developer Account Setup
-
Apple Developer Account
- Enroll in the Apple Developer Program
- You need a paid membership ($99/year) for distribution signing
-
Developer Certificate
- Open Keychain Access
- Go to Certificate Assistant → Request a Certificate from a Certificate Authority
- Fill in your email and name
- Save to disk
- Go to Apple Developer Certificates
- Create a new Developer ID Application certificate
- Download and double-click to install in Keychain
-
Notarization Setup
-
Create an app-specific password:
- Go to Apple ID Account
- Security → App-Specific Passwords → Generate Password
- Save this password securely
-
Create a keychain profile for notarization:
xcrun notarytool store-credentials "AC_PASSWORD" \ --apple-id "your.email@example.com" \ --team-id "YOUR_TEAM_ID" \ --password "app-specific-password" -
Environment Configuration
-
Set Developer Identity
- Find your Developer ID in Keychain Access
security find-identity -v -p codesigning- Set the environment variable (add to your ~/.zshrc):
export APPLE_DEVELOPER_IDENTITY="Developer ID Application: Your Name (TEAM_ID)" -
Verify Setup
# Verify codesign is available codesign --version # Verify notarytool is available xcrun notarytool --version # Verify your identity is set echo $APPLE_DEVELOPER_IDENTITY
Building DIYLC
-
Clone the Repository
git clone https://github.com/bancika/diy-layout-creator.git cd diy-layout-creator/diylc -
Build for Intel Macs
mvn clean package -P mac-x86 -
Build for Apple Silicon Macs
mvn clean package -P mac-arm -
Build Both Architectures
mvn clean package -P mac-x86,mac-arm
Output Files
After successful builds, you'll find these files in the diylc-swing/target directory:
Signed and Notarized Builds:
diylc-<version>-mac-intel.zip- Signed and notarized Intel builddiylc-<version>-mac-silicon.zip- Signed and notarized Apple Silicon (ARM) build
Unsigned Builds:
diylc-<version>-mac-intel-unsigned.zip- Unsigned Intel builddiylc-<version>-mac-silicon-unsigned.zip- Unsigned Apple Silicon (ARM) build
The unsigned builds are created before the signing and notarization process and can be useful for testing or in environments where code signing is not required.
Troubleshooting
-
Signing Issues
- Verify your certificate is valid:
security find-identity -v -p codesigning- Check certificate expiration in Keychain Access
-
Notarization Issues
- Check notarization status:
xcrun notarytool log <submission-id> --keychain-profile "AC_PASSWORD"- Verify entitlements are correct in
deploy/mac/entitlements.plist
-
Build Issues
- Clear Maven cache:
rm -rf ~/.m2/repository/org/diylc- Verify JDK version:
java -version
Common Issues
-
"The specified item could not be found in the keychain"
- Solution: Verify your Developer ID certificate is in the keychain
- Check the exact name matches
APPLE_DEVELOPER_IDENTITY
-
"No account for team found"
- Solution: Verify your Apple Developer membership is active
- Check team ID in notarytool credentials
-
"The binary is not signed"
- Solution: Check that the signing process isn't being skipped
- Verify all dependencies are properly signed
Support
For additional help:
- Check the Apple Code Signing Documentation
- File an issue on the DIYLC GitHub repository
- Contact the development team