From 125fb818ee164bd8028ca81fa88fd2f6809bbec8 Mon Sep 17 00:00:00 2001 From: Rob Greene Date: Sat, 2 Apr 2022 10:40:36 -0500 Subject: [PATCH] Updated `ant-ac` to run Ant tests from the Gradle build. #80 --- DEVELOPER.md | 6 ++++-- app/ant-ac/build.gradle | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/DEVELOPER.md b/DEVELOPER.md index 486ecf3..2940e2f 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -29,9 +29,11 @@ BUILD SUCCESSFUL in 554ms 19 actionable tasks: 19 up-to-date ``` -## Testing for Ant Task +## Testing of the Ant Task -The Apache Ant Task has been added as an independent "application" to the Gradle source structure. It resides in `app/ant-ac`. To test the Ant Task, there is an actual Ant build script available. Run this script from the AppleCommander project directory -- it should figure out paths from that starting position. +The Ant Task testing has been enbedded within the Gradle build for Ant itself and does not need to be run separately. The `app/ant-ac/build.gradle` script reads from the `app/ant-ac/src/test/resources/build-testacant.xml` and executes the tests as part of the testing task. + +However, if the Ant script itself is being worked upon, it may be useful to run it outside of the build process. Run the following from the main AppleCommander project directory; note that this requires Ant to be installed and active. As usual, note your Java versions and ensure that Java 11 is active. ``` $ ant -f app/ant-ac/src/test/resources/build-testacant.xml diff --git a/app/ant-ac/build.gradle b/app/ant-ac/build.gradle index c72f2e1..9b7d5a7 100644 --- a/app/ant-ac/build.gradle +++ b/app/ant-ac/build.gradle @@ -24,3 +24,11 @@ jar { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } } + +// Automagically run the Ant tests as part of the build process. +ant.importBuild('src/test/resources/build-testacant.xml') { antTargetName -> + 'anttest-' + antTargetName +} +tasks.named('test') { + finalizedBy('anttest-all') +}