-
Notifications
You must be signed in to change notification settings - Fork 50
Adds Gradle build that delegates to existing Ant build #214
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?
Changes from all commits
67f60a6
af42a7a
ef166c3
b865627
dcee44c
e8f3c19
5b3e33d
4b87572
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # | ||
| # https://help.github.com/articles/dealing-with-line-endings/ | ||
| # | ||
| # Linux start script should use lf | ||
| /gradlew text eol=lf | ||
|
|
||
| # These are Windows script files and should use crlf | ||
| *.bat text eol=crlf | ||
|
|
||
| # Binary files should be left untouched | ||
| *.jar binary | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # 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 | ||
| ant=1.10.14 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| /* | ||
| * Root build file | ||
| * | ||
| * For more detailed information on multi-project builds, please refer to | ||
| * https://docs.gradle.org/9.2.1/userguide/multi_project_builds.html | ||
| */ | ||
|
|
||
| allprojects { | ||
| group = "com.mirth.connect" | ||
| version = providers.gradleProperty("version").get() | ||
| } | ||
|
|
||
| subprojects { | ||
| repositories { | ||
| mavenCentral() | ||
| } | ||
| } | ||
|
|
||
| // Configure Ant to have access to JUnit task | ||
|
|
||
| ant.lifecycleLogLevel = AntBuilder.AntMessagePriority.INFO | ||
|
|
||
| configurations { | ||
| create("antJUnit") | ||
| } | ||
|
|
||
| dependencies { | ||
| // ant-junit4 is required for JUnit 4 annotation support (@Test, etc.) | ||
| "antJUnit"("org.apache.ant:ant-junit:1.10.15") { | ||
| exclude(group = "junit", module = "junit") | ||
| } | ||
| "antJUnit"("org.apache.ant:ant-junit4:1.10.15") { | ||
| exclude(group = "junit", module = "junit") | ||
| } | ||
| } | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } | ||
|
|
||
| // Make JUnit available to Ant | ||
| afterEvaluate { | ||
| ant.withGroovyBuilder { | ||
| "taskdef"( | ||
| "name" to "junit", | ||
| "classname" to "org.apache.tools.ant.taskdefs.optional.junit.JUnitTask", | ||
| "classpath" to configurations["antJUnit"].asPath | ||
| ) | ||
| "taskdef"( | ||
| "name" to "junitreport", | ||
| "classname" to "org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator", | ||
| "classpath" to configurations["antJUnit"].asPath | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| // Pass Gradle properties to Ant | ||
| project.findProperty("disableSigning")?.let { | ||
| ant.properties["disableSigning"] = it.toString() | ||
| } | ||
|
|
||
| project.findProperty("disableTests")?.let { | ||
| ant.properties["disableTests"] = it.toString() | ||
| } | ||
|
Comment on lines
+57
to
+64
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are there other properties we need to be passing?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question. I'm not sure. These are the only two I use and the only two available in
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know JUnit supports some properties for running specific tests instead of the whole suite, but I doubt anyone actually uses that. I have in the past, but I would need to look them up to even identify what they are called, because it's not something I do frequently. I wouldn't hold up this PR for that.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This commit added |
||
|
|
||
| project.findProperty("coverage")?.let { | ||
| ant.properties["coverage"] = it.toString() | ||
| } | ||
|
|
||
| // Import existing Ant build for gradual migration | ||
| ant.importBuild("server/mirth-build.xml") { antTargetName -> | ||
| // Rename conflicting Ant targets to avoid collision with Gradle built-in tasks | ||
| when (antTargetName) { | ||
| "init" -> "ant-init" | ||
| "build" -> "ant-build" | ||
| else -> antTargetName | ||
| } | ||
| } | ||
|
|
||
| // Make the default Gradle build task delegate to Ant's build target | ||
| tasks.register("build") { | ||
| dependsOn("ant-build") | ||
| group = "build" | ||
| description = "Builds the project using Ant (delegated)" | ||
| } | ||
Large diffs are not rendered by default.
NicoPiel marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| // ant.importBuild("ant-build.xml") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| // ant.importBuild("build.xml") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| // ant.importBuild("build.xml") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| // ant.importBuild("build.xml") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # This file was generated by the Gradle 'init' task. | ||
| # https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties | ||
|
|
||
| org.gradle.configuration-cache=true | ||
| org.gradle.parallel=true | ||
| org.gradle.caching=true | ||
|
|
||
| version=4.5.2 | ||
| archiveEntryDate=1999-01-01T00:00:00.000Z | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # This file was generated by the Gradle 'init' task. | ||
| # https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format | ||
|
|
||
| [versions] | ||
| guava = "33.4.5-jre" | ||
|
|
||
| [libraries] | ||
| guava = { module = "com.google.guava:guava", version.ref = "guava" } | ||
NicoPiel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-all.zip | ||
NicoPiel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| networkTimeout=10000 | ||
| validateDistributionUrl=true | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists | ||
Uh oh!
There was an error while loading. Please reload this page.