Updated Ant with minor adjustments

git-svn-id: https://brutex.net/svn/xservices/trunk@181 e7e49efb-446e-492e-b9ec-fcafc1997a86
master
Brian Rosenberger 2015-09-04 08:40:50 +00:00
parent 99e1f74305
commit dbe899c014
2 changed files with 9 additions and 7 deletions

View File

@ -18,6 +18,7 @@ package net.brutex.xservices.types.ant;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
@ -44,13 +45,13 @@ public class AntProperty {
/** /**
* Converts a Map<String, String> into a list of * Converts a Map<String, String> into a list of
* AntProperties. * AntProperties.
* @param map The map to convert * @param newMap The map to convert
* @return A list of key/value pairs * @return A list of key/value pairs
*/ */
public static List<AntProperty> createAntPropertyList(Map<String, String> map) { public static List<AntProperty> createAntPropertyList(Map<String, Object> newMap) {
List<AntProperty> list = new ArrayList<AntProperty>(); List<AntProperty> list = new ArrayList<AntProperty>();
for(Map.Entry<String, String> e : map.entrySet()) { for(Map.Entry<String, Object> e : newMap.entrySet()) {
list.add(new AntProperty(e.getKey(), e.getValue())); list.add(new AntProperty(e.getKey(), (String)e.getValue()));
} }
return list; return list;
} }

View File

@ -19,6 +19,7 @@ import java.io.ByteArrayOutputStream;
import java.io.PrintStream; import java.io.PrintStream;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import net.brutex.xservices.types.ReturnCode; import net.brutex.xservices.types.ReturnCode;
import net.brutex.xservices.types.ant.AntProperty; import net.brutex.xservices.types.ant.AntProperty;
@ -80,14 +81,14 @@ public class RunTask {
*/ */
public ReturnCode postTask() throws BuildException { public ReturnCode postTask() throws BuildException {
int returnCode = 0; int returnCode = 0;
Map<String, String> origMap = new HashMap<String, String>(); Map<String, Object> origMap = new HashMap<String, Object>();
Map<String, String> newMap = null; Map<String, Object> newMap = null;
origMap.putAll(antproject.getProperties()); origMap.putAll(antproject.getProperties());
antproject.executeTarget(anttarget.getName()); antproject.executeTarget(anttarget.getName());
newMap = antproject.getProperties(); newMap = antproject.getProperties();
newMap.putAll(antproject.getUserProperties()); newMap.putAll(antproject.getUserProperties());
for (Map.Entry<String, String> e : origMap.entrySet()) { for (Map.Entry<String, Object> e : origMap.entrySet()) {
newMap.remove(e.getKey()); newMap.remove(e.getKey());
} }