From 88c7cf8c083ca049f6161c3afab83a82123f373f Mon Sep 17 00:00:00 2001 From: mharmer Date: Mon, 26 Nov 2018 16:51:05 -0800 Subject: [PATCH] Updated the target execution to perform a copy of local properties before invoking the target. This is similar to how the parallel Ant task performs this, and ensures that two targets running at the same time don't race on the previously shared local properties. --- .../org/codeaholics/tools/build/pant/AntWrapperImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/codeaholics/tools/build/pant/AntWrapperImpl.java b/src/main/java/org/codeaholics/tools/build/pant/AntWrapperImpl.java index debed8a..02f5ee2 100644 --- a/src/main/java/org/codeaholics/tools/build/pant/AntWrapperImpl.java +++ b/src/main/java/org/codeaholics/tools/build/pant/AntWrapperImpl.java @@ -18,10 +18,15 @@ import org.apache.tools.ant.Project; import org.apache.tools.ant.Target; +import org.apache.tools.ant.property.LocalProperties; public class AntWrapperImpl implements AntWrapper { @Override public void executeTarget(final Target target) { + // Ensure a copy of the LocalProperties is performed before invoking the + // target to prevent data races from multiple targets invoked in parallel. + LocalProperties.get(target.getProject()).copy(); + target.performTasks(); }