Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 72
Replace the Ant build with Gradle, output verified byte-identical#326
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
8a2dc5924c96f529c5df764e1a98d724b51File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Diff view
Diff view
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Line-ending rules for files where endings are functional. | ||
| # (Pattern follows PR #214 by NicoPiel.) | ||
| # Unix start scripts must stay LF | ||
| /gradlew text eol=lf | ||
| oieserver text eol=lf | ||
| configure-from-env text eol=lf | ||
| # Windows scripts must stay CRLF | ||
| *.bat text eol=crlf | ||
| # Binary files are left untouched | ||
| *.jar binary | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -32,15 +32,18 @@ jobs: | ||
| java-package: 'jdk+fx' | ||
| distribution: 'zulu' | ||
| - name: Set up Gradle | ||
| uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3 | ||
| with: | ||
| validate-wrappers: true | ||
mgaffigan marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| - name: Build OIE (signed) | ||
| if: github.ref == 'refs/heads/main' | ||
| working-directory: server | ||
| run: ant -f mirth-build.xml | ||
| run: ./gradlew build | ||
| - name: Build OIE (unsigned) | ||
| if: github.ref != 'refs/heads/main' | ||
| working-directory: server | ||
| run: ant -f mirth-build.xml -DdisableSigning=true -Dcoverage=true | ||
| run: ./gradlew build -PdisableSigning=true -Pcoverage=true | ||
| - name: Package distribution | ||
| run: tar czf openintegrationengine.tar.gz -C server/ setup --transform 's|^setup|openintegrationengine/|' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| # Enable auto-env through the sdkman_auto_env config | ||
| # Add key=value pairs of SDKs to use below | ||
| java=17.0.17.fx-zulu | ||
| ant=1.10.14 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -26,8 +26,45 @@ git checkout -b feature/your-feature-name | ||
| ``` | ||
| ### 5. Install Tooling | ||
| OIE specifies the working versions of Java and Ant in [.sdkmanrc](./.sdkmanrc). To take advantage of this, install [SDKMAN](https://sdkman.io/) and run `sdk env install` | ||
| in the project's root directory. | ||
| OIE specifies the working Java version in [.sdkmanrc](./.sdkmanrc). To take advantage of this, install [SDKMAN](https://sdkman.io/) and run `sdk env install` | ||
| in the project's root directory. No other tooling is required. | ||
| ### 5a. Build | ||
| The build is driven by Gradle through the included wrapper; no separate Gradle install is needed: | ||
| ```bash | ||
| ./gradlew build -PdisableSigning=true # full build without jar signing | ||
tonygermano marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| ./gradlew test # run the unit tests (-Pcoverage=true for JaCoCo) | ||
| ./gradlew dist # build the distribution extension zips | ||
| ``` | ||
| On Windows use `gradlew.bat` instead of `./gradlew`. The assembled distribution lands in `server/setup`, the same location the previous Ant build used. For release artifacts, run a clean build: `./gradlew clean build dist`. Windows with SDKMan may generate an error about the file path being too long in the javadoc step, skip this by adding `-x :server:userApiJavadoc` to your Gradle command. | ||
| Dependencies are pinned and checksum-verified. To change a dependency version: edit `gradle/libs.versions.toml`, then refresh the checksum metadata **with a cold dependency cache and CI's flags**: | ||
| ```bash | ||
| GRADLE_USER_HOME=$(mktemp -d) ./gradlew --write-verification-metadata sha256 build dist -PdisableSigning=true -Pcoverage=true | ||
| ``` | ||
| The cold cache matters: a warm cache skips re-resolving already-cached parent POMs, so they never get recorded, and the build then fails verification only in CI (this bit us once during the migration). The run downloads everything once and takes a few minutes. Only when adding a **new** artifact that ships in the distribution does `gradle/vendored-layout.json` need a one-line placement entry, and the build fails with a message telling you so. | ||
| ### Changing build logic | ||
| The build's correctness is guarded by output comparison, not by unit | ||
| tests of the build scripts. When you change build logic (staging, | ||
| packaging, jar definitions), confirm the change does not alter the | ||
| product: build `server/setup` before and after, and compare the two | ||
| trees. The [oie-build-parity](https://github.com/pacmano1/oie-build-parity) | ||
| tooling does this at the archive-entry level (and can reproduce the | ||
| original byte-identical comparison against the pre-Gradle Ant baseline). | ||
| Only the changes you intended should appear. | ||
| ### Run and debug | ||
| ```bash | ||
| ./gradlew :server:createDerbyDb # one-time: create the embedded database | ||
| ./gradlew :server:devRun # run the server from the development tree | ||
| ./gradlew :server:devLauncher # run the server the way production starts it (from server/setup) | ||
| ./gradlew :client:devClient # run the administrator client against https://localhost:8443 | ||
| ``` | ||
| Add `--debug-jvm` to any of these to suspend on JVM start and attach a debugger on port 5005. The JDK module flags come from `server/conf/default_modules.vmoptions`, the same file the production launcher uses. For IDEs, import the repository as a Gradle project (IntelliJ does this natively; Eclipse via Buildship); the old `.classpath`/`.project` files are gone on purpose. | ||
| ### 6. Implement your changes | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.