Author: taher
Date: Wed Nov 8 16:01:50 2017
New Revision: 1814593
URL:
http://svn.apache.org/viewvc?rev=1814593&view=revLog:
Improved: implemented a declarative style of executing integration test reports
The call of execute() directly is against gradle recommendations and I disliked
this piece of code from the moment I wrote it. Luckily the solution is rather
simple by simply replacing the direct call from the graph with a finalizedBy
clause in the java execution task.
Modified:
ofbiz/ofbiz-framework/trunk/build.gradle
Modified: ofbiz/ofbiz-framework/trunk/build.gradle
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/build.gradle?rev=1814593&r1=1814592&r2=1814593&view=diff==============================================================================
--- ofbiz/ofbiz-framework/trunk/build.gradle (original)
+++ ofbiz/ofbiz-framework/trunk/build.gradle Wed Nov 8 16:01:50 2017
@@ -493,16 +493,6 @@ task createTestReports(group: sysadminGr
}
}
}
-/*
- * TODO replace this code with something more declarative.
- * We are using it so that if tests fail we still get HTML reports
- */
-gradle.taskGraph.afterTask { Task task, TaskState state ->
- if (task.name ==~ /^ofbiz.*--test.*/
- || task.name ==~ /^ofbiz.*-t.*/) {
- tasks.createTestReports.execute()
- }
-}
task gitInfoFooter(group: sysadminGroup, description: 'Update the Git Branch-revision info in the footer if Git is used') {
doLast {
@@ -899,6 +889,10 @@ def createOfbizCommandTask(taskName, arg
args argument
}
+ if (taskName ==~ /^ofbiz.*--test.*/
+ || taskName ==~ /^ofbiz.*-t.*/) {
+ finalizedBy(createTestReports)
+ }
}
}