-
Notifications
You must be signed in to change notification settings - Fork 43
Feature/modern build system (gradle without requiring ant) #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feature/modern build system (gradle without requiring ant) #243
Conversation
- Add Gradle build configuration for all modules (donkey, server, client, command, manager, generator, webadmin) - Add version catalog (libs.versions.toml) for centralized dependency management - Add native packaging support using nebula.ospackage plugin: - RPM packages for RHEL/CentOS/Fedora - DEB packages for Debian/Ubuntu - tar.gz archives for generic Linux - Add systemd service configuration with security hardening - Add FHS-compliant file layout (/opt/oie, /etc/oie, /var/log/oie) - Add pre/post install scripts for user creation and service setup - Update CI workflow with PostgreSQL service for integration tests - Fix donkey test infrastructure to initialize connection pools - Add Gradle caching to CI for faster builds
- Add mirth-vocab as test runtime dependency for generator module to provide dynamically-loaded HL7 model classes - Exclude server tests from CI build as they use internal JDK classes (com.sun.crypto.provider) that are not exported in Java 17's module system
This enables testing the build comparison during development, not just on main branch pushes.
- Fix nested directory structure (was oie-4.5.2/oie-4.5.2/, now oie-4.5.2/) - Use gzip compression for tar archive (.tar.gz instead of .tar) - Copy launcher JAR without version number (mirth-server-launcher.jar) - Copy core JARs without version numbers for launcher compatibility (mirth-server.jar, mirth-client-core.jar, mirth-crypto.jar, mirth-dbconf.jar) - Create log4j subdirectory in server-lib for launcher expectations - Generate manifest classpath dynamically from resolved dependencies - Update workflow to reference .tar.gz extension
- Exclude old BouncyCastle jdk14 JARs from itext/flying-saucer-pdf (they conflict with modern bcprov-jdk18on-1.78.1) - Copy donkey JARs (model, server, dbconf) to lib/donkey - Include full plugins/** and connectors/** directories in mirth-server.jar (was only including top-level *.class files)
Implement JAR signing infrastructure for Java Web Start client support: - Add signingEnabled flag with -PdisableSigning=true override option - Add loadKeystoreProperties() to read keystore configuration - Add modifyJarManifests task to inject Web Start security attributes - Add signClientJars task with 5x retry logic and controlled parallelism using a fixed 4-thread pool to avoid resource exhaustion Build complete extension installation system: - Add installExtensions task to deploy extensions to setup/extensions/ - Build server JARs for all extension types (connectors, datatypes, plugins) - Fix extension lib path from lib/extensionConfigs/ to lib/extensions/ - Add httpauthUserutilSourcesJar task for httpauth userutil sources - Wire task chain: assembleSetup -> installExtensions -> installExtensionClients -> signClientJars Add extension client JAR support in client project: - Define 40 extension client configurations (connectors, datatypes, plugins) - Create per-extension client JAR tasks - Add buildExtensionClients and installExtensionClients tasks - Include HTML/CSS/JS resources for MirthTagWebBrowser component Improve assembleSetup to copy all client-lib dependencies: - Extension shared JARs for client deserialization - mirth-client.jar, mirth-client-core.jar, mirth-crypto.jar - mirth-vocab.jar, donkey-model.jar - Client lib dependencies Update Eclipse project files to use Gradle Buildship: - Replace manual JAR path entries with gradleclasspathcontainer - Dependencies now resolved dynamically from build.gradle.kts
Signing changes: - Always sign JARs in all builds - Use secrets if configured, otherwise generate self-signed certificate - Clean up keystore files after build Compare builds improvements: - Normalize JAR names for fair comparison (strip version numbers) - Fail if Gradle build is missing JARs present in Ant build - Report detailed comparison summary Add prerelease job: - Trigger on tag push (v* or semver patterns) - Trigger on push to 'release' branch - Trigger manually via workflow_dispatch with create_prerelease option - Package names include version tag (e.g., oie-4.5.2-rc1.rpm) - Auto-generate release notes
- Remove existing keystore.jks before generating new one - Use PKCS12 storetype for better compatibility
Compare builds:
- Exclude cli-lib/ and manager-lib/ directories from comparison
- Exclude mirth-cli-launcher.jar and mirth-manager-launcher.jar
- These CLI/Manager components are not yet in the Gradle build
Prerelease version extraction:
- Fix regex to handle 'val mirthVersion by extra("4.5.2")' format
- Add error handling if version extraction fails
- Organize server-lib JARs into categorized subdirectories (aws, commons, database, jackson, javax, jersey, jetty, log4j, etc.) to match official distribution structure - Update serverLauncherJar manifest classpath to use subdirectory paths - Add META-INF/ to .gitignore to prevent build artifacts from jar umf
- Add duplicate JARs at root level (HikariCP, guice, quartz, javassist) to match official distribution structure - Copy log4j JARs to both log4j/ and donkey/ directories for compatibility with upstream MirthLauncher.java - Combine Gradle build commands to avoid signing JARs twice - Remove legacy Ant build and comparison jobs from CI workflow
| // Initialize connection pools before returning configuration | ||
| DonkeyConnectionPools.getInstance().init(databaseProperties); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why this is necessary? Does it help with testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not necessary. This PR does not currently have test cases working fully. This was an attempt to start fixing that but is not relevant for the PR unless we include getting the test suite working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. In that case I think it would be better to exclude these changes from the PR, as it is already a massive thing to review.
Test cases have been a pain point with the other Gradle PRs as well, you're not alone.
|
Love to see it! I've not gotten to review, but look forward to doing so. Current view is that we'll need to merge piecemeal, but if we can get to all passing and byte identical releases, I think a single PR might be possible. |
I see there are other open PRs related to gradle build approaches. I'm not sure if this one adds value above and beyond what others are working on but I figured I'd submit it just in case.
This PR adds a native gradle build capabilities that fully builds tar.gz, deb, and rpm packages. There is also a github action that automates all of this.
There are probably still bugs and inadequacies with this PR but the validated bits include
TODOs include