You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2013/12/30 08:41:12 UTC
[1/2] fixes required to get ant_on_air to run FlexJS install script
Updated Branches:
refs/heads/develop e4f33bbca -> 0dace696b
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/Unzip.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Unzip.as b/ant_on_air/src/org/apache/flex/ant/tags/Unzip.as
index 009d29b..45894e3 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/Unzip.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/Unzip.as
@@ -35,7 +35,7 @@ package org.apache.flex.ant.tags
import org.as3commons.zip.ZipEvent;
import org.as3commons.zip.ZipFile;
- [ResourceBundle("ant")]
+ [ResourceBundle("ant")]
[Mixin]
public class Unzip extends TaskHandler
{
@@ -43,57 +43,88 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["unzip"] = Unzip;
}
-
+
public function Unzip()
{
super();
}
- private function get src():String
- {
- return getAttributeValue("@src");
- }
-
- private function get dest():String
- {
- return getAttributeValue("@dest");
- }
-
- private function get overwrite():Boolean
- {
- return getAttributeValue("@overwrite") == "true";
- }
+ private function get src():String
+ {
+ return getAttributeValue("@src");
+ }
+
+ private function get dest():String
+ {
+ return getAttributeValue("@dest");
+ }
+
+ private function get overwrite():Boolean
+ {
+ return getAttributeValue("@overwrite") == "true";
+ }
+ private var srcFile:File;
private var destFile:File;
- private var patternSet:PatternSet;
+ private var patternSet:PatternSet;
override public function execute(callbackMode:Boolean, context:Object):Boolean
{
super.execute(callbackMode, context);
- if (numChildren > 0)
- {
- // look for a patternset
- for (var i:int = 0; i < numChildren; i++)
- {
- var child:ITagHandler = getChildAt(i);
- if (child is PatternSet)
- {
- patternSet = child as PatternSet;
- break;
- }
- }
- }
-
- var srcFile:File = File.applicationDirectory.resolvePath(src);
- destFile = File.applicationDirectory.resolvePath(dest);
-
- var s:String = ResourceManager.getInstance().getString('ant', 'UNZIP');
- s = s.replace("%1", srcFile.nativePath);
- s = s.replace("%2", destFile.nativePath);
- ant.output(ant.formatOutput("unzip", s));
-
+ if (numChildren > 0)
+ {
+ // look for a patternset
+ for (var i:int = 0; i < numChildren; i++)
+ {
+ var child:ITagHandler = getChildAt(i);
+ if (child is PatternSet)
+ {
+ patternSet = child as PatternSet;
+ patternSet.setContext(context);
+ break;
+ }
+ }
+ }
+
+ try {
+ srcFile = File.applicationDirectory.resolvePath(src);
+ }
+ catch (e:Error)
+ {
+ ant.output(src);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return true;
+ }
+
+ try {
+ destFile = File.applicationDirectory.resolvePath(dest);
+ if (!destFile.exists)
+ destFile.createDirectory();
+ }
+ catch (e:Error)
+ {
+ ant.output(dest);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return true;
+ }
+
+
+ var s:String = ResourceManager.getInstance().getString('ant', 'UNZIP');
+ s = s.replace("%1", srcFile.nativePath);
+ s = s.replace("%2", destFile.nativePath);
+ ant.output(ant.formatOutput("unzip", s));
+ ant.functionToCall = dounzip;
+ return false;
+ }
+
+ private function dounzip():void
+ {
unzip(srcFile);
- return true;
+ dispatchEvent(new Event(Event.COMPLETE));
}
private function unzip(fileToUnzip:File):void {
@@ -108,7 +139,7 @@ package org.apache.flex.ant.tags
fzip.addEventListener(ZipEvent.FILE_LOADED, onFileLoaded);
fzip.addEventListener(Event.COMPLETE, onUnzipComplete, false, 0, true);
fzip.addEventListener(ErrorEvent.ERROR, onUnzipError, false, 0, true);
-
+
// synchronous, so no progress events
fzip.loadBytes(zipFileBytes);
}
@@ -123,11 +154,11 @@ package org.apache.flex.ant.tags
private function onFileLoaded(e:ZipEvent):void {
try {
var fzf:ZipFile = e.file;
- if (patternSet)
- {
- if (!(patternSet.matches(fzf.filename)))
- return;
- }
+ if (patternSet)
+ {
+ if (!(patternSet.matches(fzf.filename)))
+ return;
+ }
var f:File = destFile.resolvePath(fzf.filename);
var fs:FileStream = new FileStream();
@@ -135,7 +166,7 @@ package org.apache.flex.ant.tags
// Is a directory, not a file. Dont try to write anything into it.
return;
}
-
+
fs.open(f, FileMode.WRITE);
fs.writeBytes(fzf.content);
fs.close();
@@ -153,7 +184,7 @@ package org.apache.flex.ant.tags
fzip.removeEventListener(Event.COMPLETE, onUnzipComplete);
fzip.removeEventListener(ErrorEvent.ERROR, onUnzipError);
}
-
+
private function onUnzipError(event:Event):void {
var fzip:Zip = event.target as Zip;
fzip.close();
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/XmlProperty.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/XmlProperty.as b/ant_on_air/src/org/apache/flex/ant/tags/XmlProperty.as
index de818ee..b59f004 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/XmlProperty.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/XmlProperty.as
@@ -34,16 +34,27 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["xmlproperty"] = XmlProperty;
}
-
+
public function XmlProperty()
{
}
override public function execute(callbackMode:Boolean, context:Object):Boolean
{
- super.execute(callbackMode, context);
-
- var f:File = new File(fileName);
+ super.execute(callbackMode, context);
+
+ try {
+ var f:File = new File(fileName);
+ }
+ catch (e:Error)
+ {
+ ant.output(fileName);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return true;
+ }
+
var fs:FileStream = new FileStream();
fs.open(f, FileMode.READ);
var data:String = fs.readUTFBytes(fs.bytesAvailable);
@@ -70,6 +81,9 @@ package org.apache.flex.ant.tags
else if (node.nodeKind() == "element")
{
key = prefix + "." + node.name();
+ var id:String = node.@id.toString();
+ if (id)
+ ant.project.refids[id] = key;
createProperties(node, key);
}
}
@@ -88,14 +102,14 @@ package org.apache.flex.ant.tags
}
private function get fileName():String
- {
- return getAttributeValue("@file");
- }
-
+ {
+ return getAttributeValue("@file");
+ }
+
private function get collapse():Boolean
- {
- return getAttributeValue("@collapseAttributes") == "true";
- }
+ {
+ return getAttributeValue("@collapseAttributes") == "true";
+ }
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/DirectoryScanner.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/DirectoryScanner.as b/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/DirectoryScanner.as
index 3257fc9..362fbaa 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/DirectoryScanner.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/filesetClasses/DirectoryScanner.as
@@ -113,7 +113,7 @@ package org.apache.flex.ant.tags.filesetClasses
*
*/
public class DirectoryScanner
- /* implements FileScanner, SelectorScanner, ResourceFactory*/ {
+ /* implements FileScanner, SelectorScanner, ResourceFactory*/ {
/**
* Patterns which should be excluded by default.
@@ -130,49 +130,49 @@ package org.apache.flex.ant.tags.filesetClasses
protected static const DEFAULTEXCLUDES:Vector.<String> = Vector.<String>([
// Miscellaneous typical temporary files
SelectorUtils.DEEP_TREE_MATCH + "/*~",
- SelectorUtils.DEEP_TREE_MATCH + "/#*#",
- SelectorUtils.DEEP_TREE_MATCH + "/.#*",
- SelectorUtils.DEEP_TREE_MATCH + "/%*%",
- SelectorUtils.DEEP_TREE_MATCH + "/._*",
-
- // CVS
- SelectorUtils.DEEP_TREE_MATCH + "/CVS",
- SelectorUtils.DEEP_TREE_MATCH + "/CVS/" + SelectorUtils.DEEP_TREE_MATCH,
- SelectorUtils.DEEP_TREE_MATCH + "/.cvsignore",
-
- // SCCS
- SelectorUtils.DEEP_TREE_MATCH + "/SCCS",
- SelectorUtils.DEEP_TREE_MATCH + "/SCCS/" + SelectorUtils.DEEP_TREE_MATCH,
-
- // Visual SourceSafe
- SelectorUtils.DEEP_TREE_MATCH + "/vssver.scc",
-
- // Subversion
- SelectorUtils.DEEP_TREE_MATCH + "/.svn",
- SelectorUtils.DEEP_TREE_MATCH + "/.svn/" + SelectorUtils.DEEP_TREE_MATCH,
-
- // Git
- SelectorUtils.DEEP_TREE_MATCH + "/.git",
- SelectorUtils.DEEP_TREE_MATCH + "/.git/" + SelectorUtils.DEEP_TREE_MATCH,
- SelectorUtils.DEEP_TREE_MATCH + "/.gitattributes",
- SelectorUtils.DEEP_TREE_MATCH + "/.gitignore",
- SelectorUtils.DEEP_TREE_MATCH + "/.gitmodules",
-
- // Mercurial
- SelectorUtils.DEEP_TREE_MATCH + "/.hg",
- SelectorUtils.DEEP_TREE_MATCH + "/.hg/" + SelectorUtils.DEEP_TREE_MATCH,
- SelectorUtils.DEEP_TREE_MATCH + "/.hgignore",
- SelectorUtils.DEEP_TREE_MATCH + "/.hgsub",
- SelectorUtils.DEEP_TREE_MATCH + "/.hgsubstate",
- SelectorUtils.DEEP_TREE_MATCH + "/.hgtags",
-
- // Bazaar
- SelectorUtils.DEEP_TREE_MATCH + "/.bzr",
- SelectorUtils.DEEP_TREE_MATCH + "/.bzr/" + SelectorUtils.DEEP_TREE_MATCH,
- SelectorUtils.DEEP_TREE_MATCH + "/.bzrignore",
-
- // Mac
- SelectorUtils.DEEP_TREE_MATCH + "/.DS_Store"
+ SelectorUtils.DEEP_TREE_MATCH + "/#*#",
+ SelectorUtils.DEEP_TREE_MATCH + "/.#*",
+ SelectorUtils.DEEP_TREE_MATCH + "/%*%",
+ SelectorUtils.DEEP_TREE_MATCH + "/._*",
+
+ // CVS
+ SelectorUtils.DEEP_TREE_MATCH + "/CVS",
+ SelectorUtils.DEEP_TREE_MATCH + "/CVS/" + SelectorUtils.DEEP_TREE_MATCH,
+ SelectorUtils.DEEP_TREE_MATCH + "/.cvsignore",
+
+ // SCCS
+ SelectorUtils.DEEP_TREE_MATCH + "/SCCS",
+ SelectorUtils.DEEP_TREE_MATCH + "/SCCS/" + SelectorUtils.DEEP_TREE_MATCH,
+
+ // Visual SourceSafe
+ SelectorUtils.DEEP_TREE_MATCH + "/vssver.scc",
+
+ // Subversion
+ SelectorUtils.DEEP_TREE_MATCH + "/.svn",
+ SelectorUtils.DEEP_TREE_MATCH + "/.svn/" + SelectorUtils.DEEP_TREE_MATCH,
+
+ // Git
+ SelectorUtils.DEEP_TREE_MATCH + "/.git",
+ SelectorUtils.DEEP_TREE_MATCH + "/.git/" + SelectorUtils.DEEP_TREE_MATCH,
+ SelectorUtils.DEEP_TREE_MATCH + "/.gitattributes",
+ SelectorUtils.DEEP_TREE_MATCH + "/.gitignore",
+ SelectorUtils.DEEP_TREE_MATCH + "/.gitmodules",
+
+ // Mercurial
+ SelectorUtils.DEEP_TREE_MATCH + "/.hg",
+ SelectorUtils.DEEP_TREE_MATCH + "/.hg/" + SelectorUtils.DEEP_TREE_MATCH,
+ SelectorUtils.DEEP_TREE_MATCH + "/.hgignore",
+ SelectorUtils.DEEP_TREE_MATCH + "/.hgsub",
+ SelectorUtils.DEEP_TREE_MATCH + "/.hgsubstate",
+ SelectorUtils.DEEP_TREE_MATCH + "/.hgtags",
+
+ // Bazaar
+ SelectorUtils.DEEP_TREE_MATCH + "/.bzr",
+ SelectorUtils.DEEP_TREE_MATCH + "/.bzr/" + SelectorUtils.DEEP_TREE_MATCH,
+ SelectorUtils.DEEP_TREE_MATCH + "/.bzrignore",
+
+ // Mac
+ SelectorUtils.DEEP_TREE_MATCH + "/.DS_Store"
]);
/**
@@ -404,7 +404,7 @@ package org.apache.flex.ant.tags.filesetClasses
*/
public function DirectoryScanner() {
}
-
+
/**
* Test whether or not a given path matches the start of a given
* pattern up to the first "**".
@@ -424,10 +424,10 @@ package org.apache.flex.ant.tags.filesetClasses
* pattern up to the first "**".
*/
protected static function matchPatternStart(pattern:String, str:String,
- isCaseSensitive:Boolean = true):Boolean {
- return SelectorUtils.matchPatternStart(pattern, str, isCaseSensitive);
- }
-
+ isCaseSensitive:Boolean = true):Boolean {
+ return SelectorUtils.matchPatternStart(pattern, str, isCaseSensitive);
+ }
+
/**
* Test whether or not a given path matches a given pattern.
*
@@ -442,9 +442,9 @@ package org.apache.flex.ant.tags.filesetClasses
* or <code>false</code> otherwise.
*/
protected static function matchPath(pattern:String, str:String,
- isCaseSensitive:Boolean = true):Boolean {
- return SelectorUtils.matchPath(pattern, str, isCaseSensitive);
- }
+ isCaseSensitive:Boolean = true):Boolean {
+ return SelectorUtils.matchPath(pattern, str, isCaseSensitive);
+ }
/**
* Test whether or not a string matches against a pattern.
@@ -464,9 +464,9 @@ package org.apache.flex.ant.tags.filesetClasses
* or <code>false</code> otherwise.
*/
protected static function match(pattern:String, str:String,
- isCaseSensitive:Boolean = true):Boolean{
- return SelectorUtils.match(pattern, str, isCaseSensitive);
- }
+ isCaseSensitive:Boolean = true):Boolean{
+ return SelectorUtils.match(pattern, str, isCaseSensitive);
+ }
/**
@@ -479,7 +479,7 @@ package org.apache.flex.ant.tags.filesetClasses
* @since Ant 1.6
*/
public static function getDefaultExcludes():Vector.<String> {
- return defaultExcludes.slice();
+ return defaultExcludes.slice();
}
/**
@@ -526,14 +526,14 @@ package org.apache.flex.ant.tags.filesetClasses
* @since Ant 1.6
*/
public static function resetDefaultExcludes():Vector.<String> {
- var arr:Vector.<String> = defaultExcludes;
- if (!arr)
- arr = new Vector.<String>();
- arr.length = 0;
- for (var i:int = 0; i < DEFAULTEXCLUDES.length; i++) {
- arr.push(DEFAULTEXCLUDES[i]);
- }
- return arr;
+ var arr:Vector.<String> = defaultExcludes;
+ if (!arr)
+ arr = new Vector.<String>();
+ arr.length = 0;
+ for (var i:int = 0; i < DEFAULTEXCLUDES.length; i++) {
+ arr.push(DEFAULTEXCLUDES[i]);
+ }
+ return arr;
}
/**
@@ -550,7 +550,7 @@ package org.apache.flex.ant.tags.filesetClasses
else
setBasedirFile(basedir == null ? null
: new File(basedir.replace('/', File.separator).replace(
- '\\', File.separator)));
+ '\\', File.separator)));
}
/**
@@ -562,7 +562,7 @@ package org.apache.flex.ant.tags.filesetClasses
public function setBasedirFile(basedir:File):void {
this.basedir = basedir;
}
-
+
/**
* Return the base directory to be scanned.
* This is the directory which is scanned recursively.
@@ -762,64 +762,64 @@ package org.apache.flex.ant.tags.filesetClasses
{
var savedBase:File = basedir;
try {
- illegal = null;
- clearResults();
-
- // set in/excludes to reasonable defaults if needed:
- var nullIncludes:Boolean = (includes == null);
- includes = nullIncludes
- ? Vector.<String>([SelectorUtils.DEEP_TREE_MATCH]) : includes;
- var nullExcludes:Boolean = (excludes == null);
- excludes = nullExcludes ? new Vector.<String>(0) : excludes;
-
- if (basedir != null && !followSymlinks
- && basedir.isSymbolicLink) {
- notFollowedSymlinks.push(basedir.nativePath);
- basedir = null;
+ illegal = null;
+ clearResults();
+
+ // set in/excludes to reasonable defaults if needed:
+ var nullIncludes:Boolean = (includes == null);
+ includes = nullIncludes
+ ? Vector.<String>([SelectorUtils.DEEP_TREE_MATCH]) : includes;
+ var nullExcludes:Boolean = (excludes == null);
+ excludes = nullExcludes ? new Vector.<String>(0) : excludes;
+
+ if (basedir != null && !followSymlinks
+ && basedir.isSymbolicLink) {
+ notFollowedSymlinks.push(basedir.nativePath);
+ basedir = null;
+ }
+
+ if (basedir == null) {
+ // if no basedir and no includes, nothing to do:
+ if (nullIncludes) {
+ return;
}
-
- if (basedir == null) {
- // if no basedir and no includes, nothing to do:
- if (nullIncludes) {
- return;
- }
- } else {
- if (!basedir.exists) {
- if (errorOnMissingDir) {
- illegal = new IllegalStateException("basedir "
- + basedir
- + DOES_NOT_EXIST_POSTFIX);
- } else {
- // Nothing to do - basedir does not exist
- return;
- }
- } else if (!basedir.isDirectory) {
+ } else {
+ if (!basedir.exists) {
+ if (errorOnMissingDir) {
illegal = new IllegalStateException("basedir "
+ basedir
- + " is not a"
- + " directory.");
- }
- if (illegal != null) {
- throw illegal;
+ + DOES_NOT_EXIST_POSTFIX);
+ } else {
+ // Nothing to do - basedir does not exist
+ return;
}
+ } else if (!basedir.isDirectory) {
+ illegal = new IllegalStateException("basedir "
+ + basedir
+ + " is not a"
+ + " directory.");
}
- if (isIncludedPath(TokenizedPath.EMPTY_PATH)) {
- if (!isExcludedPath(TokenizedPath.EMPTY_PATH)) {
- if (isSelected("", basedir)) {
- dirsIncluded.push("");
- } else {
- dirsDeselected.push("");
- }
+ if (illegal != null) {
+ throw illegal;
+ }
+ }
+ if (isIncludedPath(TokenizedPath.EMPTY_PATH)) {
+ if (!isExcludedPath(TokenizedPath.EMPTY_PATH)) {
+ if (isSelected("", basedir)) {
+ dirsIncluded.push("");
} else {
- dirsExcluded.push("");
+ dirsDeselected.push("");
}
} else {
- dirsNotIncluded.push("");
+ dirsExcluded.push("");
}
- checkIncludePatterns();
- clearCaches();
- includes = nullIncludes ? null : includes;
- excludes = nullExcludes ? null : excludes;
+ } else {
+ dirsNotIncluded.push("");
+ }
+ checkIncludePatterns();
+ clearCaches();
+ includes = nullIncludes ? null : includes;
+ excludes = nullExcludes ? null : excludes;
} catch (ex:IOException) {
throw new BuildException(ex.message);
} catch (e:Error) {
@@ -848,14 +848,10 @@ package org.apache.flex.ant.tags.filesetClasses
pattern;
}
}
- for each (var entry:Object in includeNonPatterns) {
- for (var p:String in entry)
- {
- pattern = p;
- break;
- }
+ for (var p:String in includeNonPatterns) {
+ pattern = p;
if (!shouldSkipPattern(pattern)) {
- newroots[entry[pattern]] = pattern;
+ newroots[includeNonPatterns[pattern]] = pattern;
}
}
@@ -875,7 +871,7 @@ package org.apache.flex.ant.tags.filesetClasses
}
// only scan directories that can include matched files or
// directories
- for (entry in newroots) {
+ for (var entry:Object in newroots) {
var currentPath:TokenizedPath;
currentPath = entry as TokenizedPath;
var currentelement:String = currentPath.toString();
@@ -942,7 +938,7 @@ package org.apache.flex.ant.tags.filesetClasses
}
} else {
var originalpattern:String;
- originalpattern = newroots[entry] as String;
+ originalpattern = newroots[entry] as String;
var included:Boolean = isCaseSensitive()
? originalpattern == currentelement
: originalpattern.toUpperCase() == currentelement.toUpperCase();
@@ -1005,28 +1001,28 @@ package org.apache.flex.ant.tags.filesetClasses
protected function slowScan():void
{
try {
- // set in/excludes to reasonable defaults if needed:
- var nullIncludes:Boolean = (includes == null);
- includes = nullIncludes
- ? Vector.<String>([SelectorUtils.DEEP_TREE_MATCH]) : includes;
- var nullExcludes:Boolean = (excludes == null);
- excludes = nullExcludes ? new Vector.<String>(0) : excludes;
-
- var excl:Vector.<String> = dirsExcluded.slice();
-
- var notIncl:Vector.<String> = dirsNotIncluded.slice();
-
- ensureNonPatternSetsReady();
-
- processSlowScan(excl);
- processSlowScan(notIncl);
- clearCaches();
- includes = nullIncludes ? null : includes;
- excludes = nullExcludes ? null : excludes;
+ // set in/excludes to reasonable defaults if needed:
+ var nullIncludes:Boolean = (includes == null);
+ includes = nullIncludes
+ ? Vector.<String>([SelectorUtils.DEEP_TREE_MATCH]) : includes;
+ var nullExcludes:Boolean = (excludes == null);
+ excludes = nullExcludes ? new Vector.<String>(0) : excludes;
+
+ var excl:Vector.<String> = dirsExcluded.slice();
+
+ var notIncl:Vector.<String> = dirsNotIncluded.slice();
+
+ ensureNonPatternSetsReady();
+
+ processSlowScan(excl);
+ processSlowScan(notIncl);
+ clearCaches();
+ includes = nullIncludes ? null : includes;
+ excludes = nullExcludes ? null : excludes;
} finally {
- haveSlowResults = true;
- slowScanning = false;
- slowScanLock.notifyAll();
+ haveSlowResults = true;
+ slowScanning = false;
+ slowScanLock.notifyAll();
}
}
@@ -1100,107 +1096,107 @@ package org.apache.flex.ant.tags.filesetClasses
}
var arr2:Array = [];
for each (var f:File in arr)
- arr2.push(f.name);
+ arr2.push(f.name);
var newfiles:Vector.<String> = Vector.<String>(arr2);;
_scandir(dir, path, fast, newfiles, new Vector.<String>());
}
private function _scandir(dir:File, path:TokenizedPath, fast:Boolean,
- newfiles:Vector.<String>, directoryNamesFollowed:Vector.<String>):void {
- var vpath:String = path.toString();
- if (vpath.length > 0 && vpath.charAt(vpath.length - 1) != File.separator) {
- vpath += File.separator;
- }
-
- // avoid double scanning of directories, can only happen in fast mode
- if (fast && hasBeenScanned(vpath)) {
- return;
- }
- if (!followSymlinks) {
- var noLinks:Vector.<String> = new Vector.<String>();
- for (i = 0; i < newfiles.length; i++) {
- try {
- if (new File(dir + File.separator + newfiles[i]).isSymbolicLink) {
- var name:String = vpath + newfiles[i];
- var file:File = new File(dir.nativePath + File.separator + newfiles[i]);
- (file.isDirectory
- ? dirsExcluded : filesExcluded).push(name);
- if (!isExcluded(name)) {
- notFollowedSymlinks.push(file.nativePath);
- }
- } else {
- noLinks.push(newfiles[i]);
+ newfiles:Vector.<String>, directoryNamesFollowed:Vector.<String>):void {
+ var vpath:String = path.toString();
+ if (vpath.length > 0 && vpath.charAt(vpath.length - 1) != File.separator) {
+ vpath += File.separator;
+ }
+
+ // avoid double scanning of directories, can only happen in fast mode
+ if (fast && hasBeenScanned(vpath)) {
+ return;
+ }
+ if (!followSymlinks) {
+ var noLinks:Vector.<String> = new Vector.<String>();
+ for (i = 0; i < newfiles.length; i++) {
+ try {
+ if (new File(dir + File.separator + newfiles[i]).isSymbolicLink) {
+ var name:String = vpath + newfiles[i];
+ var file:File = new File(dir.nativePath + File.separator + newfiles[i]);
+ (file.isDirectory
+ ? dirsExcluded : filesExcluded).push(name);
+ if (!isExcluded(name)) {
+ notFollowedSymlinks.push(file.nativePath);
}
- } catch (ioe:IOException) {
- var msg:String = "IOException caught while checking "
- + "for links, couldn't get canonical path!";
- // will be caught and redirected to Ant's logging system
- Ant.currentAnt.output(msg);
+ } else {
noLinks.push(newfiles[i]);
}
+ } catch (ioe:IOException) {
+ var msg:String = "IOException caught while checking "
+ + "for links, couldn't get canonical path!";
+ // will be caught and redirected to Ant's logging system
+ Ant.currentAnt.output(msg);
+ noLinks.push(newfiles[i]);
}
- newfiles = noLinks.slice();
- } else {
- directoryNamesFollowed.unshift(dir.nativePath);
}
-
- for (var i:int = 0; i < newfiles.length; i++) {
- name = vpath + newfiles[i];
- var newPath:TokenizedPath = new TokenizedPath("").initAsChild(path, newfiles[i]);
- file = new File(dir.nativePath + File.separator + newfiles[i]);
- var arr:Array = null;
- var arr2:Array = [];
- var children:Vector.<String> = null;
- if (file.isDirectory)
- {
- arr = file.getDirectoryListing();
- for each (var f:File in arr)
- arr2.push(f.name);
- children = Vector.<String>(arr2);
+ newfiles = noLinks.slice();
+ } else {
+ directoryNamesFollowed.unshift(dir.nativePath);
+ }
+
+ for (var i:int = 0; i < newfiles.length; i++) {
+ name = vpath + newfiles[i];
+ var newPath:TokenizedPath = new TokenizedPath("").initAsChild(path, newfiles[i]);
+ file = new File(dir.nativePath + File.separator + newfiles[i]);
+ var arr:Array = null;
+ var arr2:Array = [];
+ var children:Vector.<String> = null;
+ if (file.isDirectory)
+ {
+ arr = file.getDirectoryListing();
+ for each (var f:File in arr)
+ arr2.push(f.name);
+ children = Vector.<String>(arr2);
+ }
+ if (children == null || (children.length == 0 && !file.isDirectory)) {
+ if (isIncludedPath(newPath)) {
+ accountForIncludedFile(newPath, file);
+ } else {
+ everythingIncluded = false;
+ filesNotIncluded.push(name);
}
- if (children == null || (children.length == 0 && !file.isDirectory)) {
- if (isIncludedPath(newPath)) {
- accountForIncludedFile(newPath, file);
- } else {
- everythingIncluded = false;
- filesNotIncluded.push(name);
- }
- } else { // dir
-
- if (followSymlinks
- && causesIllegalSymlinkLoop(newfiles[i], dir,
- directoryNamesFollowed)) {
- // will be caught and redirected to Ant's logging system
- Ant.currentAnt.output("skipping symbolic link "
- + file.nativePath
- + " -- too many levels of symbolic"
- + " links.");
- notFollowedSymlinks.push(file.nativePath);
- continue;
- }
-
- if (isIncludedPath(newPath)) {
- accountForIncludedDir(newPath, file, fast, children,
+ } else { // dir
+
+ if (followSymlinks
+ && causesIllegalSymlinkLoop(newfiles[i], dir,
+ directoryNamesFollowed)) {
+ // will be caught and redirected to Ant's logging system
+ Ant.currentAnt.output("skipping symbolic link "
+ + file.nativePath
+ + " -- too many levels of symbolic"
+ + " links.");
+ notFollowedSymlinks.push(file.nativePath);
+ continue;
+ }
+
+ if (isIncludedPath(newPath)) {
+ accountForIncludedDir(newPath, file, fast, children,
+ directoryNamesFollowed);
+ } else {
+ everythingIncluded = false;
+ dirsNotIncluded.push(name);
+ if (fast && couldHoldIncludedPath(newPath)
+ && !contentsExcluded(newPath)) {
+ _scandir(file, newPath, fast, children,
directoryNamesFollowed);
- } else {
- everythingIncluded = false;
- dirsNotIncluded.push(name);
- if (fast && couldHoldIncludedPath(newPath)
- && !contentsExcluded(newPath)) {
- _scandir(file, newPath, fast, children,
- directoryNamesFollowed);
- }
- }
- if (!fast) {
- _scandir(file, newPath, fast, children, directoryNamesFollowed);
}
}
+ if (!fast) {
+ _scandir(file, newPath, fast, children, directoryNamesFollowed);
+ }
}
-
- if (followSymlinks) {
- directoryNamesFollowed.shift();
- }
}
+
+ if (followSymlinks) {
+ directoryNamesFollowed.shift();
+ }
+ }
/**
* Process included file.
@@ -1220,36 +1216,46 @@ package org.apache.flex.ant.tags.filesetClasses
* @param fast whether to perform fast scans.
*/
private function accountForIncludedDir(name:TokenizedPath,
- file:File, fast:Boolean,
- children:Vector.<String> = null,
- directoryNamesFollowed:Vector.<String> = null):void {
- processIncluded(name, file, dirsIncluded, dirsExcluded, dirsDeselected);
- if (fast && couldHoldIncludedPath(name) && !contentsExcluded(name)) {
- _scandir(file, name, fast, children, directoryNamesFollowed);
+ file:File, fast:Boolean,
+ children:Vector.<String> = null,
+ directoryNamesFollowed:Vector.<String> = null):void {
+ processIncluded(name, file, dirsIncluded, dirsExcluded, dirsDeselected);
+ if (fast && couldHoldIncludedPath(name) && !contentsExcluded(name)) {
+ if (directoryNamesFollowed == null)
+ directoryNamesFollowed = new Vector.<String>();
+ if (children == null)
+ {
+ var listing:Array = file.getDirectoryListing();
+ var nameList:Array = [];
+ for each (var f:File in listing)
+ nameList.push(f.name);
+ children = Vector.<String>(nameList);
}
+ _scandir(file, name, fast, children, directoryNamesFollowed);
}
+ }
private function processIncluded(path:TokenizedPath,
- file:File, inc:Vector.<String>, exc:Vector.<String>,
- des:Vector.<String>):void {
- var name:String = path.toString();
- if (inc.indexOf(name) != -1 ||
- exc.indexOf(name) != -1 ||
- des.indexOf(name) != -1) {
- return;
- }
-
- var included:Boolean = false;
- if (isExcludedPath(path)) {
- exc.push(name);
- } else if (isSelected(name, file)) {
- included = true;
- inc.push(name);
- } else {
- des.push(name);
- }
- everythingIncluded = everythingIncluded || included;
+ file:File, inc:Vector.<String>, exc:Vector.<String>,
+ des:Vector.<String>):void {
+ var name:String = path.toString();
+ if (inc.indexOf(name) != -1 ||
+ exc.indexOf(name) != -1 ||
+ des.indexOf(name) != -1) {
+ return;
}
+
+ var included:Boolean = false;
+ if (isExcludedPath(path)) {
+ exc.push(name);
+ } else if (isSelected(name, file)) {
+ included = true;
+ inc.push(name);
+ } else {
+ des.push(name);
+ }
+ everythingIncluded = everythingIncluded || included;
+ }
/**
* Test whether or not a name matches against at least one include
@@ -1331,11 +1337,11 @@ package org.apache.flex.ant.tags.filesetClasses
* include pattern, or <code>false</code> otherwise.
*/
private function couldHoldIncludedWithIncludes(tokenizedName:TokenizedPath,
- tokenizedInclude:TokenizedPattern):Boolean {
- return tokenizedInclude.matchStartOf(tokenizedName, isCaseSensitive())
- && isMorePowerfulThanExcludes(tokenizedName.toString())
- && isDeeper(tokenizedInclude, tokenizedName);
- }
+ tokenizedInclude:TokenizedPattern):Boolean {
+ return tokenizedInclude.matchStartOf(tokenizedName, isCaseSensitive())
+ && isMorePowerfulThanExcludes(tokenizedName.toString())
+ && isDeeper(tokenizedInclude, tokenizedName);
+ }
/**
* Verify that a pattern specifies files deeper
@@ -1458,7 +1464,7 @@ package org.apache.flex.ant.tags.filesetClasses
*/
public function getIncludedFiles():Vector.<String> {
var files:Vector.<String>;
- files = filesIncluded.slice();
+ files = filesIncluded.slice();
files.sort(0);
return files;
}
@@ -1535,7 +1541,7 @@ package org.apache.flex.ant.tags.filesetClasses
*/
public function getIncludedDirectories():Vector.<String> {
var directories:Vector.<String>;
- directories = dirsIncluded.slice();
+ directories = dirsIncluded.slice();
directories.sort(0);
return directories;
}
@@ -1611,7 +1617,7 @@ package org.apache.flex.ant.tags.filesetClasses
*/
public function getNotFollowedSymlinks():Vector.<String> {
var links:Vector.<String>;
- links = notFollowedSymlinks.slice();
+ links = notFollowedSymlinks.slice();
links.sort(0);
return links;
}
@@ -1726,42 +1732,42 @@ package org.apache.flex.ant.tags.filesetClasses
* @since Ant 1.8.0
*/
private function causesIllegalSymlinkLoop(dirName:String, parent:File,
- directoryNamesFollowed:Vector.<String>):Boolean {
- try {
- if (directoryNamesFollowed.length >= maxLevelsOfSymlinks
- && CollectionUtils.frequency(directoryNamesFollowed, dirName)
- >= maxLevelsOfSymlinks
- && new File(parent.nativePath + File.separator + dirName).isSymbolicLink) {
-
- var files:Vector.<String> = new Vector.<String>();
- var f:File = FILE_UTILS.resolveFile(parent, dirName);
- f.canonicalize();
- var target:String = f.nativePath;
- files.push(target);
-
- var relPath:String = "";
- for each (var dir:String in directoryNamesFollowed) {
- relPath += "../";
- if (dirName == dir) {
- f = FILE_UTILS.resolveFile(parent, relPath + dir);
- f.canonicalize();
- files.push(f.nativePath);
- if (files.length > maxLevelsOfSymlinks
- && CollectionUtils.frequency(files, target)
- > maxLevelsOfSymlinks) {
- return true;
- }
+ directoryNamesFollowed:Vector.<String>):Boolean {
+ try {
+ if (directoryNamesFollowed.length >= maxLevelsOfSymlinks
+ && CollectionUtils.frequency(directoryNamesFollowed, dirName)
+ >= maxLevelsOfSymlinks
+ && new File(parent.nativePath + File.separator + dirName).isSymbolicLink) {
+
+ var files:Vector.<String> = new Vector.<String>();
+ var f:File = FILE_UTILS.resolveFile(parent, dirName);
+ f.canonicalize();
+ var target:String = f.nativePath;
+ files.push(target);
+
+ var relPath:String = "";
+ for each (var dir:String in directoryNamesFollowed) {
+ relPath += "../";
+ if (dirName == dir) {
+ f = FILE_UTILS.resolveFile(parent, relPath + dir);
+ f.canonicalize();
+ files.push(f.nativePath);
+ if (files.length > maxLevelsOfSymlinks
+ && CollectionUtils.frequency(files, target)
+ > maxLevelsOfSymlinks) {
+ return true;
}
}
-
}
- return false;
- } catch (ex:IOException) {
- throw new BuildException("Caught error while checking for"
- + " symbolic links" + ex.message);
+
}
return false;
+ } catch (ex:IOException) {
+ throw new BuildException("Caught error while checking for"
+ + " symbolic links" + ex.message);
}
+ return false;
+ }
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/FileSetTaskHandler.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/FileSetTaskHandler.as b/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/FileSetTaskHandler.as
index 5e1f1c8..1a36148 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/FileSetTaskHandler.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/FileSetTaskHandler.as
@@ -43,7 +43,7 @@ package org.apache.flex.ant.tags.supportClasses
/**
* Do the work.
* TaskHandlers lazily create their children
- * and attributes so
+ * and attributes so
* super.execute() should be called before
* doing any real work.
*/
@@ -75,17 +75,17 @@ package org.apache.flex.ant.tags.supportClasses
}
}
}
- if (numChildren)
- outputTotal(totalFiles);
+ if (numChildren)
+ outputTotal(totalFiles);
actOnFileSets();
return !callbackMode;
}
- protected function outputTotal(total:int):void
- {
-
- }
-
+ protected function outputTotal(total:int):void
+ {
+
+ }
+
private function actOnFileSets():void
{
if (current == numChildren)
@@ -102,7 +102,18 @@ package org.apache.flex.ant.tags.supportClasses
var list:Vector.<String> = fs.getValue(context) as Vector.<String>;
if (list)
{
- currentDir = new File(fs.dir);
+ try {
+ currentDir = new File(fs.dir);
+ }
+ catch (e:Error)
+ {
+ ant.output(fs.dir);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ dispatchEvent(new Event(Event.COMPLETE));
+ return;
+ }
currentFile = 0;
currentList = list;
actOnList();
@@ -111,14 +122,14 @@ package org.apache.flex.ant.tags.supportClasses
}
}
}
-
- if (current == numChildren)
- {
- dispatchEvent(new Event(Event.COMPLETE));
- return;
- }
+
+ if (current == numChildren)
+ {
+ dispatchEvent(new Event(Event.COMPLETE));
+ return;
+ }
}
-
+
private function actOnList():void
{
if (currentFile == currentList.length)
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/NamedTagHandler.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/NamedTagHandler.as b/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/NamedTagHandler.as
index 99ed48f..f4d803a 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/NamedTagHandler.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/NamedTagHandler.as
@@ -27,17 +27,12 @@ package org.apache.flex.ant.tags.supportClasses
{
}
- private var _name:String;
-
/**
* The name property.
*/
public function get name():String
{
- if (_name == null && xml != null)
- _name = xml.@name.toString();
-
- return _name;
+ return getNullOrAttributeValue("@name");
}
}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/TagHandler.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/TagHandler.as b/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/TagHandler.as
index 88ec3f4..854d134 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/TagHandler.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/supportClasses/TagHandler.as
@@ -47,6 +47,14 @@ package org.apache.flex.ant.tags.supportClasses
protected var context:Object;
/**
+ * Set the context
+ */
+ public function setContext(context:Object):void
+ {
+ this.context = context;
+ }
+
+ /**
* The xml node for this tag
*/
protected var xml:XML;
@@ -60,19 +68,19 @@ package org.apache.flex.ant.tags.supportClasses
this.xml = xml;
}
- protected function getAttributeValue(name:String):String
- {
- return ant.getValue(xml[name].toString(), context);
- }
-
- protected function getNullOrAttributeValue(name:String):String
- {
- var xmlList:XMLList = xml[name];
- if (xmlList.length() == 0)
- return null;
-
- return ant.getValue(xml[name].toString(), context);
- }
-
+ protected function getAttributeValue(name:String):String
+ {
+ return ant.getValue(xml[name].toString(), context);
+ }
+
+ protected function getNullOrAttributeValue(name:String):String
+ {
+ var xmlList:XMLList = xml[name];
+ if (xmlList.length() == 0)
+ return null;
+
+ return ant.getValue(xml[name].toString(), context);
+ }
+
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/tests/AntOnAir.mxml
----------------------------------------------------------------------
diff --git a/ant_on_air/tests/AntOnAir.mxml b/ant_on_air/tests/AntOnAir.mxml
index 040b923..7e6182c 100644
--- a/ant_on_air/tests/AntOnAir.mxml
+++ b/ant_on_air/tests/AntOnAir.mxml
@@ -37,10 +37,21 @@ limitations under the License.
private function checkargs(event:InvokeEvent):void
{
var targets:Array = [];
+
+ var nextIsAntFile:Boolean;
for each (var s:String in event.arguments)
{
- if (s.indexOf("-f ") != -1)
+ if (s == "-f")
+ {
+ nextIsAntFile = true;
+ }
+ else if (nextIsAntFile)
+ {
+ nextIsAntFile = false;
+ antfilename = s;
+ }
+ else if (s.indexOf("-f ") != -1)
{
antfilename = s.substr(3);
}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/tests/copyfilesetofone.xml
----------------------------------------------------------------------
diff --git a/ant_on_air/tests/copyfilesetofone.xml b/ant_on_air/tests/copyfilesetofone.xml
new file mode 100644
index 0000000..e4d1c9d
--- /dev/null
+++ b/ant_on_air/tests/copyfilesetofone.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+
+<project name="ant_on_air_copy_fileset_of_one" basedir="." default="test">
+
+ <property name="closure.name" value="compiler" />
+ <property name="lib.dir" value="/Users/aharui/Work/apache-flex-flexjs-4.0.1-bin/js/lib" />
+ <property name="download.dir" value="/Users/aharui/Work/apache-flex-flexjs-4.0.1-bin/in" />
+
+ <target name="test" >
+ <copy todir="${lib.dir}/google/closure-compiler">
+ <fileset dir="${download.dir}/temp">
+ <include name="${closure.name}.jar"/>
+ </fileset>
+ </copy>
+ </target>
+
+</project>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/tests/redirect.xml
----------------------------------------------------------------------
diff --git a/ant_on_air/tests/redirect.xml b/ant_on_air/tests/redirect.xml
new file mode 100644
index 0000000..e5512bc
--- /dev/null
+++ b/ant_on_air/tests/redirect.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+
+<project name="ant_on_air_redirect" basedir="." default="test">
+
+ <target name="test" >
+ <get src="http://downloads.sourceforge.net/project/jburg/jburg-1.10.1.tar.gz"
+ dest="${basedir}" />
+ </target>
+
+</project>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/tests/test.xml
----------------------------------------------------------------------
diff --git a/ant_on_air/tests/test.xml b/ant_on_air/tests/test.xml
index 907a5af..dafa981 100644
--- a/ant_on_air/tests/test.xml
+++ b/ant_on_air/tests/test.xml
@@ -64,7 +64,7 @@
<target name="copy-test" >
<echo>FLEX_HOME is ${FLEX_HOME}. DEBUG is ${DEBUG_FLAG}. The OS is ${theOS}</echo>
<mkdir dir="${basedir}/temp" />
- <copy file="${basedir}/test.xml" toFile="${basedir}/temp/copied.xml" />
+ <copy file="${basedir}/test.xml" tofile="${basedir}/temp/copied.xml" />
<available file="${basedir}/temp/copied.xml" property="copied.doesnt.exist" value="got copied" />
<fail message="test.xml was not copied to temp/copied.xml">
<condition>
@@ -74,7 +74,7 @@
</condition>
</fail>
<echo>copied ${copied.doesnt.exist}. Should say: got copied</echo>
- <copy toDir="${basedir}/temp">
+ <copy todir="${basedir}/temp">
<fileset dir="${basedir}/../src">
<include name="**/**" />
<exclude name="**/Ant.as" />
[2/2] git commit: [flex-utilities] [refs/heads/develop] - fixes
required to get ant_on_air to run FlexJS install script
Posted by ah...@apache.org.
fixes required to get ant_on_air to run FlexJS install script
Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/0dace696
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/0dace696
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/0dace696
Branch: refs/heads/develop
Commit: 0dace696b0708b60b1a95ff3416c58c1b4091585
Parents: e4f33bb
Author: Alex Harui <ah...@apache.org>
Authored: Sun Dec 29 23:40:08 2013 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Sun Dec 29 23:40:08 2013 -0800
----------------------------------------------------------------------
ant_on_air/src/org/apache/flex/ant/Ant.as | 25 +-
.../src/org/apache/flex/ant/tags/AntCall.as | 64 +-
.../src/org/apache/flex/ant/tags/AntTask.as | 148 +++--
.../src/org/apache/flex/ant/tags/Available.as | 60 +-
.../src/org/apache/flex/ant/tags/Checksum.as | 129 ++--
ant_on_air/src/org/apache/flex/ant/tags/Copy.as | 198 ++++---
.../src/org/apache/flex/ant/tags/Delete.as | 77 ++-
ant_on_air/src/org/apache/flex/ant/tags/Echo.as | 57 +-
ant_on_air/src/org/apache/flex/ant/tags/Exec.as | 117 ++--
.../src/org/apache/flex/ant/tags/FileSet.as | 5 +-
ant_on_air/src/org/apache/flex/ant/tags/Get.as | 136 ++++-
.../org/apache/flex/ant/tags/LoadProperties.as | 27 +-
.../src/org/apache/flex/ant/tags/Mkdir.as | 14 +-
.../src/org/apache/flex/ant/tags/PatternSet.as | 101 ++--
.../src/org/apache/flex/ant/tags/Project.as | 44 +-
.../src/org/apache/flex/ant/tags/Property.as | 148 +++--
.../org/apache/flex/ant/tags/PropertyFile.as | 26 +-
.../src/org/apache/flex/ant/tags/Replace.as | 88 +--
.../src/org/apache/flex/ant/tags/Target.as | 84 +--
.../src/org/apache/flex/ant/tags/Touch.as | 37 +-
.../src/org/apache/flex/ant/tags/Untar.as | 75 ++-
.../src/org/apache/flex/ant/tags/Unzip.as | 127 ++--
.../src/org/apache/flex/ant/tags/XmlProperty.as | 36 +-
.../ant/tags/filesetClasses/DirectoryScanner.as | 592 ++++++++++---------
.../tags/supportClasses/FileSetTaskHandler.as | 43 +-
.../ant/tags/supportClasses/NamedTagHandler.as | 7 +-
.../flex/ant/tags/supportClasses/TagHandler.as | 36 +-
ant_on_air/tests/AntOnAir.mxml | 13 +-
ant_on_air/tests/copyfilesetofone.xml | 35 ++
ant_on_air/tests/redirect.xml | 28 +
ant_on_air/tests/test.xml | 4 +-
31 files changed, 1559 insertions(+), 1022 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/Ant.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/Ant.as b/ant_on_air/src/org/apache/flex/ant/Ant.as
index dc81fe2..11e05a5 100644
--- a/ant_on_air/src/org/apache/flex/ant/Ant.as
+++ b/ant_on_air/src/org/apache/flex/ant/Ant.as
@@ -70,6 +70,21 @@ package org.apache.flex.ant
context = {};
this.context = context;
var project:Project = processXMLTag(xml) as Project;
+ var basedir:String = project.basedir;
+ if (basedir == "")
+ basedir = ".";
+ try {
+ basedir = file.parent.resolvePath(basedir).nativePath;
+ }
+ catch (e:Error)
+ {
+ ant.output(basedir);
+ ant.output(e.message);
+ ant.project.status = false;
+ return true;
+ }
+
+ context.basedir = basedir;
this.project = project;
if (!project.execute(callbackMode, context))
{
@@ -134,6 +149,7 @@ package org.apache.flex.ant
private function completeHandler(event:Event):void
{
+ event.target.removeEventListener(Event.COMPLETE, completeHandler);
dispatchEvent(event);
}
@@ -171,14 +187,7 @@ package org.apache.flex.ant
if (c != -1)
{
var token:String = input.substring(i + 2, c);
- if (token == "basedir")
- {
- var basedir:String = context.basedir;
- rep = file.parent.resolvePath(basedir).nativePath;
- input = input.replace("${" + token + "}", rep);
- i += rep.length - token.length - 3;
- }
- else if (context.hasOwnProperty(token))
+ if (context.hasOwnProperty(token))
{
var rep:String = context[token];
input = input.replace("${" + token + "}", rep);
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/AntCall.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/AntCall.as b/ant_on_air/src/org/apache/flex/ant/tags/AntCall.as
index b107ddd..6539260 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/AntCall.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/AntCall.as
@@ -32,47 +32,49 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["antcall"] = AntCall;
}
-
+
public function AntCall()
{
super();
}
private function get target():String
- {
- return getAttributeValue("@target");
- }
+ {
+ return getAttributeValue("@target");
+ }
override public function execute(callbackMode:Boolean, context:Object):Boolean
{
- super.execute(callbackMode, context);
-
- // I think properties set in the sub-script to not affect the main script
- // so clone the properties here
- var subContext:Object = {};
- for (var p:String in context)
- subContext[p] = context[p];
-
- if (numChildren > 0)
- {
- for (var i:int = 0; i < numChildren; i++)
- {
- var param:Param = getChildAt(i) as Param;
- subContext[param.name] = param.value;
- }
- }
- var t:Target = ant.project.getTarget(target);
- if (!t.execute(callbackMode, subContext))
- {
- t.addEventListener(Event.COMPLETE, completeHandler);
- return false;
- }
+ super.execute(callbackMode, context);
+
+ // I think properties set in the sub-script to not affect the main script
+ // so clone the properties here
+ var subContext:Object = {};
+ for (var p:String in context)
+ subContext[p] = context[p];
+
+ if (numChildren > 0)
+ {
+ for (var i:int = 0; i < numChildren; i++)
+ {
+ var param:Param = getChildAt(i) as Param;
+ param.setContext(context);
+ subContext[param.name] = param.value;
+ }
+ }
+ var t:Target = ant.project.getTarget(target);
+ if (!t.execute(callbackMode, subContext))
+ {
+ t.addEventListener(Event.COMPLETE, completeHandler);
+ return false;
+ }
return true;
}
-
- private function completeHandler(event:Event):void
- {
- dispatchEvent(event);
- }
+
+ private function completeHandler(event:Event):void
+ {
+ event.target.removeEventListener(Event.COMPLETE, completeHandler);
+ dispatchEvent(event);
+ }
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/AntTask.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/AntTask.as b/ant_on_air/src/org/apache/flex/ant/tags/AntTask.as
index 8815051..9fc38aa 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/AntTask.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/AntTask.as
@@ -35,82 +35,102 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["ant"] = AntTask;
}
-
+
public function AntTask()
{
super();
}
private function get file():String
- {
- return getAttributeValue("@antfile");
- }
-
+ {
+ return getAttributeValue("@antfile");
+ }
+
private function get dir():String
- {
- return getAttributeValue("@dir");
- }
-
+ {
+ return getAttributeValue("@dir");
+ }
+
private function get target():String
- {
- return getAttributeValue("@target");
- }
-
- private var subant:Ant;
-
+ {
+ return getAttributeValue("@target");
+ }
+
+ private var subant:Ant;
+
override public function execute(callbackMode:Boolean, context:Object):Boolean
{
super.execute(callbackMode, context);
-
- // I think properties set in the sub-script to not affect the main script
- // so clone the properties here
- var subContext:Object = {};
- for (var p:String in context)
- subContext[p] = context[p];
- if (subContext.hasOwnProperty("targets"))
- delete subContext["targets"];
- if (target)
- subContext["targets"] = target;
-
- subant = new Ant();
- subant.parentAnt = ant;
- subant.output = ant.output;
- var file:File = File.applicationDirectory;
- file = file.resolvePath(dir + File.separator + this.file);
- if (!subant.processXMLFile(file, subContext, true))
- {
- subant.addEventListener("statusChanged", statusHandler);
- subant.addEventListener(Event.COMPLETE, completeHandler);
- subant.addEventListener(ProgressEvent.PROGRESS, progressEventHandler);
- // redispatch keyboard events off of ant so input task can see them
- ant.addEventListener(KeyboardEvent.KEY_DOWN, ant_keyDownHandler);
- return false;
- }
- else
- completeHandler(null);
+
+ // I think properties set in the sub-script to not affect the main script
+ // so clone the properties here
+ var subContext:Object = {};
+ for (var p:String in context)
+ subContext[p] = context[p];
+ if (subContext.hasOwnProperty("targets"))
+ delete subContext["targets"];
+ if (target)
+ subContext["targets"] = target;
+
+ subant = new Ant();
+ subant.parentAnt = ant;
+ subant.output = ant.output;
+ var file:File = File.applicationDirectory;
+ try {
+ file = file.resolvePath(dir + File.separator + this.file);
+ }
+ catch (e:Error)
+ {
+ ant.output(dir + File.separator + this.file);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return true;
+ }
+
+ if (!subant.processXMLFile(file, subContext, true))
+ {
+ subant.addEventListener("statusChanged", statusHandler);
+ subant.addEventListener(Event.COMPLETE, completeHandler);
+ subant.addEventListener(ProgressEvent.PROGRESS, progressEventHandler);
+ // redispatch keyboard events off of ant so input task can see them
+ ant.addEventListener(KeyboardEvent.KEY_DOWN, ant_keyDownHandler);
+ return false;
+ }
+ else
+ completeHandler(null);
return true;
}
-
- private function completeHandler(event:Event):void
- {
- dispatchEvent(event);
- }
-
- private function statusHandler(event:Event):void
- {
- ant.project.status = subant.project.status;
- dispatchEvent(new Event(Event.COMPLETE));
- }
-
- private function progressEventHandler(event:ProgressEvent):void
- {
- ant.dispatchEvent(event);
- }
-
- private function ant_keyDownHandler(event:KeyboardEvent):void
- {
- subant.dispatchEvent(event);
- }
-
+
+ private function completeHandler(event:Event):void
+ {
+ event.target.removeEventListener("statusChanged", statusHandler);
+ event.target.removeEventListener(Event.COMPLETE, completeHandler);
+ event.target.removeEventListener(ProgressEvent.PROGRESS, progressEventHandler);
+ ant.removeEventListener(KeyboardEvent.KEY_DOWN, ant_keyDownHandler);
+
+ dispatchEvent(event);
+ }
+
+ private function statusHandler(event:Event):void
+ {
+ event.target.removeEventListener("statusChanged", statusHandler);
+ event.target.removeEventListener(Event.COMPLETE, completeHandler);
+ event.target.removeEventListener(ProgressEvent.PROGRESS, progressEventHandler);
+ ant.removeEventListener(KeyboardEvent.KEY_DOWN, ant_keyDownHandler);
+ ant.project.status = subant.project.status;
+ dispatchEvent(new Event(Event.COMPLETE));
+ }
+
+ private function progressEventHandler(event:ProgressEvent):void
+ {
+ ant.dispatchEvent(event);
+ }
+
+ private function ant_keyDownHandler(event:KeyboardEvent):void
+ {
+ subant.dispatchEvent(event);
+ }
+
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/Available.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Available.as b/ant_on_air/src/org/apache/flex/ant/tags/Available.as
index d7638c6..b606b8a 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/Available.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/Available.as
@@ -33,39 +33,47 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["available"] = Available;
}
-
+
public function Available()
{
super();
}
private function get file():String
- {
- return getNullOrAttributeValue("@file");
- }
-
+ {
+ return getNullOrAttributeValue("@file");
+ }
+
private function get type():String
- {
- return getNullOrAttributeValue("@type");
- }
-
+ {
+ return getNullOrAttributeValue("@type");
+ }
+
private function get property():String
- {
- return getNullOrAttributeValue("@property");
- }
-
+ {
+ return getNullOrAttributeValue("@property");
+ }
+
private function get value():String
- {
- return getNullOrAttributeValue("@value");
- }
+ {
+ return getNullOrAttributeValue("@value");
+ }
public function getValue(context:Object):Object
{
- this.context = context;
-
+ this.context = context;
+
if (this.file == null) return false;
- var file:File = new File(this.file);
+ try
+ {
+ var file:File = new File(this.file);
+ }
+ catch (e:Error)
+ {
+ return false;
+ }
+
if (!file.exists)
return false;
@@ -74,18 +82,18 @@ package org.apache.flex.ant.tags
return true;
}
-
+
override public function execute(callbackMode:Boolean, context:Object):Boolean
{
super.execute(callbackMode, context);
var avail:Object = getValue(context);
- if (avail)
- {
- if (!context.hasOwnProperty(property))
- context[property] = value != null ? value : true;
- }
+ if (avail)
+ {
+ if (!context.hasOwnProperty(property))
+ context[property] = value != null ? value : true;
+ }
return true;
}
-
+
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/Checksum.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Checksum.as b/ant_on_air/src/org/apache/flex/ant/tags/Checksum.as
index b2f3737..b0b1399 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/Checksum.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/Checksum.as
@@ -31,7 +31,7 @@ package org.apache.flex.ant.tags
import org.apache.flex.ant.Ant;
import org.apache.flex.ant.tags.supportClasses.TaskHandler;
-
+
[Mixin]
public class Checksum extends TaskHandler
{
@@ -39,47 +39,67 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["checksum"] = Checksum;
}
-
+
public function Checksum()
{
super();
}
private function get file():String
- {
- return getAttributeValue("@file");
- }
-
+ {
+ return getAttributeValue("@file");
+ }
+
private function get toDir():String
- {
- return getAttributeValue("@todir");
- }
-
+ {
+ return getAttributeValue("@todir");
+ }
+
private function get fileExt():String
- {
- var val:String = getNullOrAttributeValue("@fileext");
- return val == null ? ".md5" : val;
- }
-
+ {
+ var val:String = getNullOrAttributeValue("@fileext");
+ return val == null ? ".md5" : val;
+ }
+
+ private function get property():String
+ {
+ return getNullOrAttributeValue("@property");
+ }
+
private function get verifyproperty():String
- {
- return getAttributeValue("@verifyproperty");
- }
-
+ {
+ return getNullOrAttributeValue("@verifyproperty");
+ }
+
private function get readbuffersize():int
- {
- var val:String = getNullOrAttributeValue("@readbuffersize");
- return val == null ? 8192 : int(val);
- }
-
+ {
+ var val:String = getNullOrAttributeValue("@readbuffersize");
+ return val == null ? 8192 : int(val);
+ }
+
private var md5:MD5Stream;
private var fs:FileStream;
override public function execute(callbackMode:Boolean, context:Object):Boolean
{
super.execute(callbackMode, context);
-
- var f:File = File.applicationDirectory.resolvePath(this.file);
+
+ try {
+ var f:File = File.applicationDirectory.resolvePath(this.file);
+ }
+ catch (e:Error)
+ {
+ ant.output(this.file);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ dispatchEvent(new Event(Event.COMPLETE));
+ return true;
+ }
+
+ if (!f.exists)
+ return true;
+
fs = new FileStream();
fs.open(f, FileMode.READ);
md5 = new MD5Stream();
@@ -109,31 +129,58 @@ package org.apache.flex.ant.tags
private function sumComplete():void
{
sum = md5.complete();
- var sumFile:File = getSumFile();
- var fs:FileStream = new FileStream();
- if (verifyproperty)
+ if (verifyproperty && property)
{
- fs.open(sumFile, FileMode.READ);
- var expected:String = fs.readUTFBytes(fs.bytesAvailable);
- fs.close();
- if (sum != expected)
- context[verifyproperty] = "false";
- else
+ if (sum == property)
context[verifyproperty] = "true";
+ else
+ context[verifyproperty] = "false";
+ }
+ else if (!toDir && property)
+ {
+ context[property] = sum;
}
else
{
- fs.open(sumFile, FileMode.WRITE);
- fs.writeUTFBytes(sum);
- fs.close();
+ var sumFile:File = getSumFile();
+ if (sumFile)
+ {
+ var fs:FileStream = new FileStream();
+ if (verifyproperty)
+ {
+ fs.open(sumFile, FileMode.READ);
+ var expected:String = fs.readUTFBytes(fs.bytesAvailable);
+ fs.close();
+ if (sum != expected)
+ context[verifyproperty != null ? verifyproperty : property] = "false";
+ else
+ context[verifyproperty != null ? verifyproperty : property] = "true";
+ }
+ else
+ {
+ fs.open(sumFile, FileMode.WRITE);
+ fs.writeUTFBytes(sum);
+ fs.close();
+ }
+ }
}
-
dispatchEvent(new Event(Event.COMPLETE));
}
private function getSumFile():File
{
- var sumFile:File = File.applicationDirectory.resolvePath(toDir);
+ try {
+ var sumFile:File = File.applicationDirectory.resolvePath(toDir);
+ }
+ catch (e:Error)
+ {
+ ant.output(toDir);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return null;
+ }
+
if (sumFile.isDirectory)
{
var fileName:String = file + fileExt;
@@ -146,6 +193,6 @@ package org.apache.flex.ant.tags
sumFile = sumFile.resolvePath(fileName);
}
return sumFile;
- }
+ }
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/Copy.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Copy.as b/ant_on_air/src/org/apache/flex/ant/tags/Copy.as
index e279918..0b28c3f 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/Copy.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/Copy.as
@@ -27,7 +27,7 @@ package org.apache.flex.ant.tags
import org.apache.flex.ant.tags.supportClasses.FileSetTaskHandler;
import org.apache.flex.xml.ITagHandler;
- [ResourceBundle("ant")]
+ [ResourceBundle("ant")]
[Mixin]
public class Copy extends FileSetTaskHandler
{
@@ -35,116 +35,164 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["copy"] = Copy;
}
-
+
public function Copy()
{
super();
}
private function get fileName():String
- {
- return getAttributeValue("@file");
- }
-
+ {
+ return getAttributeValue("@file");
+ }
+
private function get toFileName():String
- {
- return getAttributeValue("@toFile");
- }
-
+ {
+ var val:String = getNullOrAttributeValue("@toFile");
+ if (val != null)
+ return val;
+ return getNullOrAttributeValue("@tofile");
+
+ }
+
private function get toDirName():String
- {
- return getAttributeValue("@toDir");
- }
-
+ {
+ return getAttributeValue("@todir");
+ }
+
private function get overwrite():Boolean
- {
- return getAttributeValue("@overwrite") == "true";
- }
-
- private var mapper:GlobMapper;
+ {
+ return getAttributeValue("@overwrite") == "true";
+ }
+
+ private var mapper:GlobMapper;
+
+ private function mapFileName(name:String):String
+ {
+ var from:String = mapper.from;
+ if (from.indexOf(".*") == -1)
+ from = from.replace("*", ".*");
+ var regex:RegExp = new RegExp(from);
+ var results:Array = name.match(regex);
+ if (results && results.length == 1)
+ {
+ name = mapper.to.replace("*", results[0]);
+ return name;
+ }
+ return null;
+ }
+
+ private var searchedForMapper:Boolean;
- private function mapFileName(name:String):String
- {
- var from:String = mapper.from;
- if (from.indexOf(".*") == -1)
- from = from.replace("*", ".*");
- var regex:RegExp = new RegExp(from);
- var results:Array = name.match(regex);
- if (results && results.length == 1)
- {
- name = mapper.to.replace("*", results[0]);
- return name;
- }
- return null;
- }
-
- private var searchedForMapper:Boolean;
-
override protected function actOnFile(dir:String, fileName:String):void
{
- if (!searchedForMapper)
- {
- // look for a mapper
- for (var i:int = 0; i < numChildren; i++)
- {
- var child:ITagHandler = getChildAt(i);
- if (child is GlobMapper)
- {
- mapper = child as GlobMapper;
- break;
- }
- }
- searchedForMapper = true;
- }
-
+ if (!searchedForMapper)
+ {
+ // look for a mapper
+ for (var i:int = 0; i < numChildren; i++)
+ {
+ var child:ITagHandler = getChildAt(i);
+ if (child is GlobMapper)
+ {
+ mapper = child as GlobMapper;
+ mapper.setContext(context);
+ break;
+ }
+ }
+ searchedForMapper = true;
+ }
+
var srcName:String;
if (dir)
srcName = dir + File.separator + fileName;
else
srcName = fileName;
- var srcFile:File = File.applicationDirectory.resolvePath(srcName);
+ try {
+ var srcFile:File = File.applicationDirectory.resolvePath(srcName);
+ }
+ catch (e:Error)
+ {
+ ant.output(srcName);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return;
+ }
+
+
+ if (mapper)
+ {
+ fileName = mapFileName(fileName);
+ if (fileName == null)
+ return;
+ }
- if (mapper)
- {
- fileName = mapFileName(fileName);
- if (fileName == null)
- return;
- }
-
var destName:String;
if (toDirName)
destName = toDirName + File.separator + fileName;
else
destName = toFileName;
- var destFile:File = File.applicationDirectory.resolvePath(destName);
-
+ try {
+ var destFile:File = File.applicationDirectory.resolvePath(destName);
+ }
+ catch (e:Error)
+ {
+ ant.output(destName);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return;
+ }
+
srcFile.copyTo(destFile, overwrite);
}
- override protected function outputTotal(total:int):void
- {
- var s:String = ResourceManager.getInstance().getString('ant', 'COPYFILES');
- s = s.replace("%1", total.toString());
- s = s.replace("%2", toDirName);
- ant.output(ant.formatOutput("copy", s));
- }
-
+ override protected function outputTotal(total:int):void
+ {
+ var s:String = ResourceManager.getInstance().getString('ant', 'COPYFILES');
+ s = s.replace("%1", total.toString());
+ s = s.replace("%2", toDirName);
+ ant.output(ant.formatOutput("copy", s));
+ }
+
override public function execute(callbackMode:Boolean, context:Object):Boolean
{
var retVal:Boolean = super.execute(callbackMode, context);
if (numChildren > 0)
return retVal;
- var srcFile:File = File.applicationDirectory.resolvePath(fileName);
- var destFile:File = File.applicationDirectory.resolvePath(toFileName);;
+ try {
+ var srcFile:File = File.applicationDirectory.resolvePath(fileName);
+ }
+ catch (e:Error)
+ {
+ ant.output(fileName);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return true;
+ }
+
+ try {
+ var destFile:File = File.applicationDirectory.resolvePath(toFileName);
+ }
+ catch (e:Error)
+ {
+ ant.output(toFileName);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return true;
+ }
+
//var destDir:File = destFile.parent;
//var resolveName:String = destFile.nativePath.substr(destFile.nativePath.lastIndexOf(File.separator) + 1);
//destDir.resolvePath(resolveName);
- var s:String = ResourceManager.getInstance().getString('ant', 'COPY');
- s = s.replace("%1", "1");
- s = s.replace("%2", destFile.nativePath);
- ant.output(ant.formatOutput("copy", s));
+ var s:String = ResourceManager.getInstance().getString('ant', 'COPY');
+ s = s.replace("%1", "1");
+ s = s.replace("%2", destFile.nativePath);
+ ant.output(ant.formatOutput("copy", s));
srcFile.copyTo(destFile, overwrite);
return true;
}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/Delete.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Delete.as b/ant_on_air/src/org/apache/flex/ant/tags/Delete.as
index d558e38..2779aa6 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/Delete.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/Delete.as
@@ -26,7 +26,7 @@ package org.apache.flex.ant.tags
import org.apache.flex.ant.Ant;
import org.apache.flex.ant.tags.supportClasses.FileSetTaskHandler;
- [ResourceBundle("ant")]
+ [ResourceBundle("ant")]
[Mixin]
public class Delete extends FileSetTaskHandler
{
@@ -34,21 +34,21 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["delete"] = Delete;
}
-
+
public function Delete()
{
super();
}
private function get fileName():String
- {
- return getAttributeValue("@file");
- }
-
+ {
+ return getAttributeValue("@file");
+ }
+
private function get dirName():String
- {
- return getAttributeValue("@dir");
- }
+ {
+ return getAttributeValue("@dir");
+ }
override protected function actOnFile(dir:String, fileName:String):void
{
@@ -57,35 +57,68 @@ package org.apache.flex.ant.tags
srcName = dir + File.separator + fileName;
else
srcName = fileName;
- var delFile:File = File.applicationDirectory.resolvePath(srcName);
+ try {
+ var delFile:File = File.applicationDirectory.resolvePath(srcName);
+ }
+ catch (e:Error)
+ {
+ ant.output(fileName);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return;
+ }
+
if (delFile.isDirectory)
delFile.deleteDirectory(true);
else
delFile.deleteFile();
}
-
+
override public function execute(callbackMode:Boolean, context:Object):Boolean
{
var retVal:Boolean = super.execute(callbackMode, context);
if (numChildren > 0)
return retVal;
-
- var s:String;
-
+
+ var s:String;
+
if (fileName)
{
- var delFile:File = File.applicationDirectory.resolvePath(fileName);
- s = ResourceManager.getInstance().getString('ant', 'DELETEFILE');
- s = s.replace("%1", delFile.nativePath);
- ant.output(ant.formatOutput("delete", s));
+ try {
+ var delFile:File = File.applicationDirectory.resolvePath(fileName);
+ }
+ catch (e:Error)
+ {
+ ant.output(fileName);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return true;
+ }
+
+ s = ResourceManager.getInstance().getString('ant', 'DELETEFILE');
+ s = s.replace("%1", delFile.nativePath);
+ ant.output(ant.formatOutput("delete", s));
delFile.deleteFile();
}
else if (dirName)
{
- var delDir:File = File.applicationDirectory.resolvePath(dirName);
- s = ResourceManager.getInstance().getString('ant', 'DELETEDIR');
- s = s.replace("%1", delDir.nativePath);
- ant.output(ant.formatOutput("delete", s));
+ try {
+ var delDir:File = File.applicationDirectory.resolvePath(dirName);
+ }
+ catch (e:Error)
+ {
+ ant.output(fileName);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return true;
+ }
+
+ s = ResourceManager.getInstance().getString('ant', 'DELETEDIR');
+ s = s.replace("%1", delDir.nativePath);
+ ant.output(ant.formatOutput("delete", s));
delDir.deleteDirectory(true);
}
return true;
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/Echo.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Echo.as b/ant_on_air/src/org/apache/flex/ant/tags/Echo.as
index 2b17bf6..8cd71a3 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/Echo.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/Echo.as
@@ -35,25 +35,25 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["echo"] = Echo;
}
-
+
public function Echo()
{
super();
}
- private var _text:String;
-
+ private var _text:String;
+
private function get text():String
- {
- if (_text != null)
- return _text;
-
- return getAttributeValue("@text");
- }
- private function get fileName():String
- {
- return getNullOrAttributeValue("@file");
- }
+ {
+ if (_text != null)
+ return _text;
+
+ return getAttributeValue("@message");
+ }
+ private function get fileName():String
+ {
+ return getNullOrAttributeValue("@file");
+ }
public function setText(text:String):void
{
@@ -63,16 +63,27 @@ package org.apache.flex.ant.tags
override public function execute(callbackMode:Boolean, context:Object):Boolean
{
super.execute(callbackMode, context);
- if (fileName != null)
- {
- var f:File = new File(fileName);
- var fs:FileStream = new FileStream();
- fs.open(f, FileMode.WRITE);
- fs.writeUTFBytes(ant.getValue(text, context));
- fs.close();
- }
- else
- ant.output(ant.formatOutput("echo", ant.getValue(text, context)));
+ if (fileName != null)
+ {
+ try {
+ var f:File = new File(fileName);
+ }
+ catch (e:Error)
+ {
+ ant.output(fileName);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return true;
+ }
+
+ var fs:FileStream = new FileStream();
+ fs.open(f, FileMode.WRITE);
+ fs.writeUTFBytes(ant.getValue(text, context));
+ fs.close();
+ }
+ else
+ ant.output(ant.formatOutput("echo", ant.getValue(text, context)));
return true;
}
}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/Exec.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Exec.as b/ant_on_air/src/org/apache/flex/ant/tags/Exec.as
index e10e728..f30e68d 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/Exec.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/Exec.as
@@ -42,71 +42,72 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["exec"] = Exec;
}
-
+
public function Exec()
{
}
override public function execute(callbackMode:Boolean, context:Object):Boolean
{
- super.execute(callbackMode, context);
-
- var thisOS:String = Capabilities.os.toLowerCase();
- var osArr:Array = osFamily.split(",");
- var ok:Boolean = false;
- for each (var p:String in osArr)
- {
- if (thisOS.indexOf(p.toLowerCase()) != -1)
- {
- ok = true;
- break;
- }
- }
- if (!ok) return true;
-
- var file:File = File.applicationDirectory;
- if (Capabilities.os.toLowerCase().indexOf('win') == -1)
- file = new File("/bin/bash");
- else
- file = file.resolvePath("C:\\Windows\\System32\\cmd.exe");
- var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
- nativeProcessStartupInfo.executable = file;
- var args:Vector.<String> = new Vector.<String>();
- if (Capabilities.os.toLowerCase().indexOf('win') == -1)
- args.push("-c");
- else
- args.push("/c");
- if (numChildren > 0)
- {
- var arg:Arg = getChildAt(0) as Arg;
- args.push(fileName + " " + arg.value);
- }
- else
- args.push(fileName);
- nativeProcessStartupInfo.arguments = args;
- process = new NativeProcess();
- process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
- process.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, onOutputErrorData);
- process.start(nativeProcessStartupInfo);
- process.addEventListener(NativeProcessExitEvent.EXIT, exitHandler);
-
- return false;
+ super.execute(callbackMode, context);
+
+ var thisOS:String = Capabilities.os.toLowerCase();
+ var osArr:Array = osFamily.split(",");
+ var ok:Boolean = false;
+ for each (var p:String in osArr)
+ {
+ if (thisOS.indexOf(p.toLowerCase()) != -1)
+ {
+ ok = true;
+ break;
+ }
+ }
+ if (!ok) return true;
+
+ var file:File = File.applicationDirectory;
+ if (Capabilities.os.toLowerCase().indexOf('win') == -1)
+ file = new File("/bin/bash");
+ else
+ file = file.resolvePath("C:\\Windows\\System32\\cmd.exe");
+ var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
+ nativeProcessStartupInfo.executable = file;
+ var args:Vector.<String> = new Vector.<String>();
+ if (Capabilities.os.toLowerCase().indexOf('win') == -1)
+ args.push("-c");
+ else
+ args.push("/c");
+ if (numChildren > 0)
+ {
+ var arg:Arg = getChildAt(0) as Arg;
+ arg.setContext(context);
+ args.push(fileName + " " + arg.value);
+ }
+ else
+ args.push(fileName);
+ nativeProcessStartupInfo.arguments = args;
+ process = new NativeProcess();
+ process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
+ process.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, onOutputErrorData);
+ process.start(nativeProcessStartupInfo);
+ process.addEventListener(NativeProcessExitEvent.EXIT, exitHandler);
+
+ return false;
}
private function get fileName():String
- {
- return getAttributeValue("@executable");
- }
-
+ {
+ return getAttributeValue("@executable");
+ }
+
private function get osFamily():String
- {
- return getAttributeValue("@osfamily");
- }
-
+ {
+ return getAttributeValue("@osfamily");
+ }
+
private function get outputProperty():String
- {
- return getAttributeValue("@outputproperty");
- }
+ {
+ return getAttributeValue("@outputproperty");
+ }
private var process:NativeProcess;
@@ -114,7 +115,7 @@ package org.apache.flex.ant.tags
{
dispatchEvent(new Event(Event.COMPLETE));
}
-
+
private function onOutputErrorData(event:ProgressEvent):void
{
var stdError:IDataInput = process.standardError;
@@ -127,9 +128,9 @@ package org.apache.flex.ant.tags
var stdOut:IDataInput = process.standardOutput;
var data:String = stdOut.readUTFBytes(process.standardOutput.bytesAvailable);
trace("Got: ", data);
- if (outputProperty)
- context[outputProperty] = data;
+ if (outputProperty)
+ context[outputProperty] = data;
}
-
+
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/FileSet.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/FileSet.as b/ant_on_air/src/org/apache/flex/ant/tags/FileSet.as
index e169d7c..41f80d5 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/FileSet.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/FileSet.as
@@ -34,7 +34,7 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["fileset"] = FileSet;
}
-
+
public function FileSet()
{
super();
@@ -51,7 +51,7 @@ package org.apache.flex.ant.tags
{
if (_value) return _value;
this.context = context;
-
+
ant.processChildren(xml, this);
var ds:DirectoryScanner = new DirectoryScanner();
var n:int = numChildren;
@@ -60,6 +60,7 @@ package org.apache.flex.ant.tags
for (var i:int = 0; i < n; i++)
{
var tag:NamedTagHandler = getChildAt(i) as NamedTagHandler;
+ tag.setContext(context);
if (tag is FileSetInclude)
includes.push(tag.name);
else if (tag is FileSetExclude)
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/Get.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Get.as b/ant_on_air/src/org/apache/flex/ant/tags/Get.as
index fc15729..3b8c469 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/Get.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/Get.as
@@ -19,6 +19,7 @@
package org.apache.flex.ant.tags
{
import flash.events.Event;
+ import flash.events.HTTPStatusEvent;
import flash.events.IOErrorEvent;
import flash.events.ProgressEvent;
import flash.events.SecurityErrorEvent;
@@ -28,6 +29,7 @@ package org.apache.flex.ant.tags
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;
+ import flash.net.URLRequestHeader;
import flash.utils.ByteArray;
import mx.core.IFlexModuleFactory;
@@ -36,7 +38,7 @@ package org.apache.flex.ant.tags
import org.apache.flex.ant.Ant;
import org.apache.flex.ant.tags.supportClasses.TaskHandler;
- [ResourceBundle("ant")]
+ [ResourceBundle("ant")]
[Mixin]
public class Get extends TaskHandler
{
@@ -44,65 +46,115 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["get"] = Get;
}
-
+
public function Get()
{
super();
}
private function get src():String
- {
- return getAttributeValue("@src");
- }
-
+ {
+ return getAttributeValue("@src");
+ }
+
private function get dest():String
- {
- return getAttributeValue("@dest");
- }
-
+ {
+ return getAttributeValue("@dest");
+ }
+
private function get skipexisting():Boolean
- {
- return getAttributeValue("@skipexisting") == "true";
- }
+ {
+ return getAttributeValue("@skipexisting") == "true";
+ }
private var urlLoader:URLLoader;
override public function execute(callbackMode:Boolean, context:Object):Boolean
{
super.execute(callbackMode, context);
-
+
if (skipexisting)
{
var destFile:File = getDestFile();
if (destFile.exists)
return true;
}
- var s:String = ResourceManager.getInstance().getString('ant', 'GETTING');
- s = s.replace("%1", src);
- ant.output(ant.formatOutput("get", s));
- s = ResourceManager.getInstance().getString('ant', 'GETTO');
- s = s.replace("%1", getDestFile().nativePath);
- ant.output(ant.formatOutput("get", s));
+ var s:String = ResourceManager.getInstance().getString('ant', 'GETTING');
+ s = s.replace("%1", src);
+ ant.output(ant.formatOutput("get", s));
+ s = ResourceManager.getInstance().getString('ant', 'GETTO');
+ s = s.replace("%1", getDestFile().nativePath);
+ ant.output(ant.formatOutput("get", s));
+ var urlRequest:URLRequest = new URLRequest(src);
+ urlRequest.followRedirects = false;
+ urlRequest.userAgent = "Java"; // required to get sourceforge redirects to do the right thing
urlLoader = new URLLoader();
- urlLoader.load(new URLRequest(src));
+ urlLoader.load(urlRequest);
urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
urlLoader.addEventListener(Event.COMPLETE, completeHandler);
+ urlLoader.addEventListener(HTTPStatusEvent.HTTP_RESPONSE_STATUS, statusHandler);
urlLoader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
urlLoader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorEventHandler);
urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
return false;
}
+ private function statusHandler(event:HTTPStatusEvent):void
+ {
+ if (event.status >= 300 && event.status < 400)
+ {
+ // redirect response
+
+ urlLoader.close();
+
+ // remove handlers from old request
+ urlLoader.removeEventListener(Event.COMPLETE, completeHandler);
+ urlLoader.removeEventListener(HTTPStatusEvent.HTTP_RESPONSE_STATUS, statusHandler);
+ urlLoader.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
+ urlLoader.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorEventHandler);
+ urlLoader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
+
+ var newlocation:String;
+ for each (var header:URLRequestHeader in event.responseHeaders)
+ {
+ if (header.name == "Location")
+ {
+ newlocation = header.value;
+ break;
+ }
+ }
+ if (newlocation)
+ {
+ ant.output(ant.formatOutput("get", "redirected to: " + newlocation));
+ var urlRequest:URLRequest = new URLRequest(newlocation);
+ var refHeader:URLRequestHeader = new URLRequestHeader("Referer", src);
+ urlRequest.requestHeaders.push(refHeader);
+ urlRequest.followRedirects = false;
+ urlRequest.userAgent = "Java"; // required to get sourceforge redirects to do the right thing
+ urlLoader = new URLLoader();
+ urlLoader.load(urlRequest);
+ urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
+ urlLoader.addEventListener(Event.COMPLETE, completeHandler);
+ urlLoader.addEventListener(HTTPStatusEvent.HTTP_RESPONSE_STATUS, statusHandler);
+ urlLoader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
+ urlLoader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorEventHandler);
+ urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
+ }
+ }
+ }
+
private function ioErrorEventHandler(event:IOErrorEvent):void
{
+ ant.output(event.toString());
ant.project.status = false;
dispatchEvent(new Event(Event.COMPLETE));
event.preventDefault();
}
-
+
private function securityErrorHandler(event:SecurityErrorEvent):void
{
+ ant.output(event.toString());
ant.project.status = false;
dispatchEvent(new Event(Event.COMPLETE));
event.preventDefault();
@@ -117,17 +169,30 @@ package org.apache.flex.ant.tags
private function completeHandler(event:Event):void
{
var destFile:File = getDestFile();
- var fs:FileStream = new FileStream();
- fs.open(destFile, FileMode.WRITE);
- fs.writeBytes(urlLoader.data as ByteArray);
- fs.close();
-
+ if (destFile)
+ {
+ var fs:FileStream = new FileStream();
+ fs.open(destFile, FileMode.WRITE);
+ fs.writeBytes(urlLoader.data as ByteArray);
+ fs.close();
+ }
dispatchEvent(new Event(Event.COMPLETE));
}
private function getDestFile():File
{
- var destFile:File = File.applicationDirectory.resolvePath(dest);
+ try {
+ var destFile:File = File.applicationDirectory.resolvePath(dest);
+ }
+ catch (e:Error)
+ {
+ ant.output(dest);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return null;
+ }
+
if (destFile.isDirectory)
{
var fileName:String = src;
@@ -137,9 +202,20 @@ package org.apache.flex.ant.tags
c = fileName.lastIndexOf("/");
if (c != -1)
fileName = fileName.substr(c + 1);
- destFile = destFile.resolvePath(fileName);
+ try {
+ destFile = destFile.resolvePath(fileName);
+ }
+ catch (e:Error)
+ {
+ ant.output(fileName);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return null;
+ }
+
}
return destFile;
- }
+ }
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/LoadProperties.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/LoadProperties.as b/ant_on_air/src/org/apache/flex/ant/tags/LoadProperties.as
index 70ec113..51024a1 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/LoadProperties.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/LoadProperties.as
@@ -35,16 +35,27 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["loadproperties"] = LoadProperties;
}
-
+
public function LoadProperties()
{
}
override public function execute(callbackMode:Boolean, context:Object):Boolean
{
- super.execute(callbackMode, context);
-
- var f:File = new File(fileName);
+ super.execute(callbackMode, context);
+
+ try {
+ var f:File = new File(fileName);
+ }
+ catch (e:Error)
+ {
+ ant.output(fileName);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return true;
+ }
+
var fs:FileStream = new FileStream();
fs.open(f, FileMode.READ);
var data:String = fs.readUTFBytes(fs.bytesAvailable);
@@ -73,9 +84,9 @@ package org.apache.flex.ant.tags
}
private function get fileName():String
- {
- return getAttributeValue("@srcFile");
- }
-
+ {
+ return getAttributeValue("@srcFile");
+ }
+
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/Mkdir.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Mkdir.as b/ant_on_air/src/org/apache/flex/ant/tags/Mkdir.as
index 2751e45..a817a45 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/Mkdir.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/Mkdir.as
@@ -49,7 +49,19 @@ package org.apache.flex.ant.tags
{
super.execute(callbackMode, context);
- var dir:File = new File(_dir);
+ try
+ {
+ var dir:File = new File(_dir);
+ }
+ catch (e:Error)
+ {
+ ant.output(_dir);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return true;
+ }
+
dir.createDirectory();
var s:String = ResourceManager.getInstance().getString('ant', 'MKDIR');
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/PatternSet.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/PatternSet.as b/ant_on_air/src/org/apache/flex/ant/tags/PatternSet.as
index ea66e65..4540de8 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/PatternSet.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/PatternSet.as
@@ -33,63 +33,64 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["patternset"] = PatternSet;
}
-
+
public function PatternSet()
{
super();
}
-
- private var includes:Vector.<String>;
- private var excludes:Vector.<String>;
-
- private var processedChildren:Boolean;
-
+
+ private var includes:Vector.<String>;
+ private var excludes:Vector.<String>;
+
+ private var processedChildren:Boolean;
+
public function matches(path:String):Boolean
{
- if (!processedChildren)
- {
- ant.processChildren(xml, this);
- processedChildren = true;
- }
-
- if (numChildren == 0)
- return true;
-
- if (includes == null)
- {
- var n:int = numChildren;
- var includes:Vector.<String> = new Vector.<String>();
- var excludes:Vector.<String> = new Vector.<String>();
- for (var i:int = 0; i < n; i++)
- {
- var tag:NamedTagHandler = getChildAt(i) as NamedTagHandler;
- if (tag is FileSetInclude)
- includes.push(tag.name);
- else if (tag is FileSetExclude)
- excludes.push(tag.name);
- else
- throw new BuildException("Unsupported Tag at index " + i);
- }
- }
- var result:Boolean = false;
- for each (var inc:String in includes)
- {
- if (SelectorUtils.match(inc, path))
- {
- result = true;
- break;
- }
- }
- for each (var exc:String in excludes)
- {
- if (SelectorUtils.match(exc, path))
- {
- result = false;
- break;
- }
- }
+ if (!processedChildren)
+ {
+ ant.processChildren(xml, this);
+ processedChildren = true;
+ }
+
+ if (numChildren == 0)
+ return true;
+
+ if (includes == null)
+ {
+ var n:int = numChildren;
+ var includes:Vector.<String> = new Vector.<String>();
+ var excludes:Vector.<String> = new Vector.<String>();
+ for (var i:int = 0; i < n; i++)
+ {
+ var tag:NamedTagHandler = getChildAt(i) as NamedTagHandler;
+ tag.setContext(context);
+ if (tag is FileSetInclude)
+ includes.push(tag.name);
+ else if (tag is FileSetExclude)
+ excludes.push(tag.name);
+ else
+ throw new BuildException("Unsupported Tag at index " + i);
+ }
+ }
+ var result:Boolean = false;
+ for each (var inc:String in includes)
+ {
+ if (SelectorUtils.match(inc, path))
+ {
+ result = true;
+ break;
+ }
+ }
+ for each (var exc:String in excludes)
+ {
+ if (SelectorUtils.match(exc, path))
+ {
+ result = false;
+ break;
+ }
+ }
return result;
}
-
+
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/Project.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Project.as b/ant_on_air/src/org/apache/flex/ant/tags/Project.as
index f7a9903..a5596ae 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/Project.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/Project.as
@@ -46,31 +46,31 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["project"] = Project;
}
-
+
public function Project()
{
}
- private var _status:Boolean;
+ private var _status:Boolean;
/**
* true if tasks completed successfully.
* Do not monitor this property to determine if the project is done executing.
* This property is set to true and a failing task sets it to false.
*/
public function get status():Boolean
- {
- return _status;
- }
-
- public function set status(value:Boolean):void
- {
- if (_status != value)
- {
- _status = value;
- ant.dispatchEvent(new Event("statusChanged"));
- }
- }
-
+ {
+ return _status;
+ }
+
+ public function set status(value:Boolean):void
+ {
+ if (_status != value)
+ {
+ _status = value;
+ ant.dispatchEvent(new Event("statusChanged"));
+ }
+ }
+
public function get basedir():String
{
return getAttributeValue("@basedir");
@@ -81,16 +81,16 @@ package org.apache.flex.ant.tags
return getAttributeValue("@default");
}
+ public var refids:Object = {};
+
private var targets:Array;
override public function execute(callbackMode:Boolean, context:Object):Boolean
{
- super.execute(callbackMode, context);
-
+ super.execute(callbackMode, context);
+
this.callbackMode = callbackMode;
-
- context.basedir = basedir;
-
+
status = true;
if (context.targets == null)
@@ -150,7 +150,7 @@ package org.apache.flex.ant.tags
dispatchEvent(new Event(Event.COMPLETE));
return true;
}
-
+
}
if (targets.length == 0)
dispatchEvent(new Event(Event.COMPLETE));
@@ -192,11 +192,13 @@ package org.apache.flex.ant.tags
private function completeHandler(event:Event):void
{
+ event.target.removeEventListener(Event.COMPLETE, completeHandler);
executeTargets();
}
private function childCompleteHandler(event:Event):void
{
+ event.target.removeEventListener(Event.COMPLETE, childCompleteHandler);
executeChildren();
}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/Property.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Property.as b/ant_on_air/src/org/apache/flex/ant/tags/Property.as
index 9e77fd8..d6076c3 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/Property.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/Property.as
@@ -42,44 +42,89 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["property"] = Property;
}
-
+
public function Property()
{
}
override public function execute(callbackMode:Boolean, context:Object):Boolean
{
- super.execute(callbackMode, context);
-
- if (name && value && !context.hasOwnProperty(name))
- context[name] = value;
+ super.execute(callbackMode, context);
+
+ if (name && (value || location || refid) && !context.hasOwnProperty(name))
+ {
+ if (value)
+ context[name] = value;
+ else if (refid)
+ context[name] = context[ant.project.refids[refid]];
+ else
+ context[name] = location;
+ }
else if (fileName != null)
{
- var f:File = new File(fileName);
- var fs:FileStream = new FileStream();
- fs.open(f, FileMode.READ);
- var data:String = fs.readUTFBytes(fs.bytesAvailable);
- var propLines:Array = data.split("\n");
- for each (var line:String in propLines)
+ try {
+ var f:File = new File(fileName);
+ }
+ catch (e:Error)
+ {
+ ant.output(fileName);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return true;
+ }
+
+ if (f.exists)
{
- var parts:Array = line.split("=");
- if (parts.length >= 2)
+ var fs:FileStream = new FileStream();
+ fs.open(f, FileMode.READ);
+ var data:String = fs.readUTFBytes(fs.bytesAvailable);
+ var propLines:Array = data.split("\n");
+ var collectingParts:Boolean;
+ var val:String;
+ var key:String;
+ for each (var line:String in propLines)
{
- var key:String = StringUtil.trim(parts[0]);
- var val:String;
- if (parts.length == 2)
- val = parts[1];
- else
+ if (line.charAt(line.length - 1) == "\r")
+ line = line.substr(0, line.length - 1);
+ if (collectingParts)
{
- parts.shift();
- val = parts.join("=");
+ if (line.charAt(line.length - 1) == "\\")
+ val += line.substr(0, line.length - 1);
+ else
+ {
+ collectingParts = false;
+ val += line;
+ val = StringUtil.trim(val);
+ val = val.replace(/\\n/g, "\n");
+ if (!context.hasOwnProperty(key))
+ context[key] = val;
+ }
+ continue;
}
- if (!context.hasOwnProperty(key))
- context[key] = val;
+ var parts:Array = line.split("=");
+ if (parts.length >= 2)
+ {
+ key = StringUtil.trim(parts[0]);
+ if (parts.length == 2)
+ val = parts[1];
+ else
+ {
+ parts.shift();
+ val = parts.join("=");
+ }
+ if (val.charAt(val.length - 1) == "\\")
+ {
+ collectingParts = true;
+ val = val.substr(0, val.length - 1);
+ }
+ else if (!context.hasOwnProperty(key))
+ context[key] = StringUtil.trim(val);
+ }
+
}
-
+ fs.close();
}
- fs.close();
}
else if (envPrefix != null)
{
@@ -90,20 +135,30 @@ package org.apache.flex.ant.tags
}
private function get fileName():String
- {
- return getNullOrAttributeValue("@file");
- }
-
+ {
+ return getNullOrAttributeValue("@file");
+ }
+
+ private function get refid():String
+ {
+ return getNullOrAttributeValue("@refid");
+ }
+
private function get value():String
- {
- return getAttributeValue("@value");
- }
-
+ {
+ return getNullOrAttributeValue("@value");
+ }
+
+ private function get location():String
+ {
+ return getNullOrAttributeValue("@location");
+ }
+
private function get envPrefix():String
- {
- return getNullOrAttributeValue("@environment");
- }
-
+ {
+ return getNullOrAttributeValue("@environment");
+ }
+
private var process:NativeProcess;
public function requestEnvironmentVariables():void
@@ -118,8 +173,8 @@ package org.apache.flex.ant.tags
var args:Vector.<String> = new Vector.<String>();
if (Capabilities.os.toLowerCase().indexOf('win') == -1)
args.push("-c");
- else
- args.push("/c");
+ else
+ args.push("/c");
args.push("set");
nativeProcessStartupInfo.arguments = args;
process = new NativeProcess();
@@ -128,12 +183,12 @@ package org.apache.flex.ant.tags
process.start(nativeProcessStartupInfo);
process.addEventListener(NativeProcessExitEvent.EXIT, exitHandler);
}
-
+
private function exitHandler(event:NativeProcessExitEvent):void
{
dispatchEvent(new Event(Event.COMPLETE));
}
-
+
private function onOutputErrorData(event:ProgressEvent):void
{
var stdError:IDataInput = process.standardError;
@@ -147,16 +202,17 @@ package org.apache.flex.ant.tags
var data:String = stdOut.readUTFBytes(process.standardOutput.bytesAvailable);
trace("Got: ", data);
var propLines:Array;
- if (Capabilities.os.indexOf('Mac OS') > -1)
- propLines = data.split("\n");
- else
- propLines = data.split("\r\n");
+ if (Capabilities.os.indexOf('Mac OS') > -1)
+ propLines = data.split("\n");
+ else
+ propLines = data.split("\r\n");
+ var prefix:String = envPrefix;
for each (var line:String in propLines)
{
var parts:Array = line.split("=");
if (parts.length >= 2)
{
- var key:String = StringUtil.trim(parts[0]);
+ var key:String = envPrefix + "." + StringUtil.trim(parts[0]);
var val:String;
if (parts.length == 2)
val = parts[1];
@@ -170,6 +226,6 @@ package org.apache.flex.ant.tags
}
}
}
-
+
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/PropertyFile.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/PropertyFile.as b/ant_on_air/src/org/apache/flex/ant/tags/PropertyFile.as
index 7217524..aab0246 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/PropertyFile.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/PropertyFile.as
@@ -34,7 +34,7 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["propertyfile"] = PropertyFile;
}
-
+
public function PropertyFile()
{
}
@@ -42,14 +42,26 @@ package org.apache.flex.ant.tags
override public function execute(callbackMode:Boolean, context:Object):Boolean
{
super.execute(callbackMode, context);
-
- var f:File = new File(fileName);
+
+ try {
+ var f:File = new File(fileName);
+ }
+ catch (e:Error)
+ {
+ ant.output(fileName);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return true;
+ }
+
var fs:FileStream = new FileStream();
fs.open(f, FileMode.WRITE);
var n:int = numChildren;
for (var i:int = 0; i < n; i++)
{
var entry:Entry = getChildAt(i) as Entry;
+ entry.setContext(context);
if (entry)
{
var s:String = entry.key + "=" + entry.value + "\n";
@@ -61,9 +73,9 @@ package org.apache.flex.ant.tags
}
private function get fileName():String
- {
- return getAttributeValue("@file");
- }
-
+ {
+ return getAttributeValue("@file");
+ }
+
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/Replace.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Replace.as b/ant_on_air/src/org/apache/flex/ant/tags/Replace.as
index 81e418f..dc39b5d 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/Replace.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/Replace.as
@@ -34,64 +34,76 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["replace"] = Replace;
}
-
+
public function Replace()
{
super();
}
private function get file():String
- {
- return getAttributeValue("@file");
- }
-
+ {
+ return getAttributeValue("@file");
+ }
+
private function get token():String
- {
- return getNullOrAttributeValue("@token");
- }
-
+ {
+ return getNullOrAttributeValue("@token");
+ }
+
private function get value():String
- {
- return getAttributeValue("@value");
- }
+ {
+ return getAttributeValue("@value");
+ }
override public function execute(callbackMode:Boolean, context:Object):Boolean
{
super.execute(callbackMode, context);
-
- var f:File = File.applicationDirectory.resolvePath(file);
+
+ try {
+ var f:File = File.applicationDirectory.resolvePath(file);
+ }
+ catch (e:Error)
+ {
+ ant.output(file);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return true;
+ }
+
var fs:FileStream = new FileStream();
fs.open(f, FileMode.READ);
var s:String = fs.readUTFBytes(fs.bytesAvailable);
fs.close();
- var tokens:Vector.<RegExp> = new Vector.<RegExp>();
- var reps:Vector.<String> = new Vector.<String>();
+ var tokens:Vector.<RegExp> = new Vector.<RegExp>();
+ var reps:Vector.<String> = new Vector.<String>();
var regex:RegExp;
- if (token != null)
- {
- regex = new RegExp(token, "g");
- tokens.push(regex);
- reps.push(value);
- }
- if (numChildren > 0)
- {
- for (var i:int = 0; i < numChildren; i++)
- {
- var rf:ReplaceFilter = getChildAt(i) as ReplaceFilter;
- regex = new RegExp(rf.token, "g");
- tokens.push(regex);
- reps.push(rf.value);
- }
- }
- var n:int = tokens.length;
- for (i = 0; i < n; i++)
- {
- s = s.replace(tokens[i], reps[i]);
- }
+ if (token != null)
+ {
+ regex = new RegExp(token, "g");
+ tokens.push(regex);
+ reps.push(value);
+ }
+ if (numChildren > 0)
+ {
+ for (var i:int = 0; i < numChildren; i++)
+ {
+ var rf:ReplaceFilter = getChildAt(i) as ReplaceFilter;
+ rf.setContext(context);
+ regex = new RegExp(rf.token, "g");
+ tokens.push(regex);
+ reps.push(rf.value);
+ }
+ }
+ var n:int = tokens.length;
+ for (i = 0; i < n; i++)
+ {
+ s = s.replace(tokens[i], reps[i]);
+ }
fs.open(f, FileMode.WRITE);
fs.writeUTFBytes(s);
fs.close();
return true;
}
- }
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/Target.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Target.as b/ant_on_air/src/org/apache/flex/ant/tags/Target.as
index 327760e..e730cbe 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/Target.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/Target.as
@@ -36,22 +36,22 @@ package org.apache.flex.ant.tags
public function Target()
{
}
-
- private function get ifProperty():String
- {
- return getNullOrAttributeValue("@if");
- }
-
- private function get unlessProperty():String
- {
- return getNullOrAttributeValue("@unless");
- }
-
+
+ private function get ifProperty():String
+ {
+ return getNullOrAttributeValue("@if");
+ }
+
+ private function get unlessProperty():String
+ {
+ return getNullOrAttributeValue("@unless");
+ }
+
public function get depends():String
{
return getNullOrAttributeValue("@depends");
}
-
+
private var dependsList:Array;
private function processDepends():Boolean
@@ -61,7 +61,7 @@ package org.apache.flex.ant.tags
continueOnToSteps();
return true;
}
-
+
while (dependsList.length > 0)
{
var depend:String = dependsList.shift();
@@ -78,12 +78,13 @@ package org.apache.flex.ant.tags
private function dependCompleteHandler(event:Event):void
{
- if (!ant.project.status)
- {
- if (!inExecute)
- dispatchEvent(new Event(Event.COMPLETE));
- return;
- }
+ event.target.removeEventListener(Event.COMPLETE, dependCompleteHandler);
+ if (!ant.project.status)
+ {
+ if (!inExecute)
+ dispatchEvent(new Event(Event.COMPLETE));
+ return;
+ }
processDepends();
}
@@ -91,8 +92,8 @@ package org.apache.flex.ant.tags
override public function execute(callbackMode:Boolean, context:Object):Boolean
{
- super.execute(callbackMode, context);
-
+ super.execute(callbackMode, context);
+
inExecute = true;
this.callbackMode = callbackMode;
if (depends)
@@ -114,7 +115,7 @@ package org.apache.flex.ant.tags
{
if (!ant.project.status)
return true;
- ant.output("\n" + name + ":");
+ ant.output("\n" + name + ":");
return processSteps();
}
@@ -122,24 +123,24 @@ package org.apache.flex.ant.tags
private function processSteps():Boolean
{
- if (ifProperty != null)
- {
- if (!context.hasOwnProperty(ifProperty))
- {
- dispatchEvent(new Event(Event.COMPLETE));
- return true;
- }
- }
-
- if (unlessProperty != null)
- {
- if (context.hasOwnProperty(unlessProperty))
- {
- dispatchEvent(new Event(Event.COMPLETE));
- return true;
- }
- }
-
+ if (ifProperty != null)
+ {
+ if (!context.hasOwnProperty(ifProperty))
+ {
+ dispatchEvent(new Event(Event.COMPLETE));
+ return true;
+ }
+ }
+
+ if (unlessProperty != null)
+ {
+ if (context.hasOwnProperty(unlessProperty))
+ {
+ dispatchEvent(new Event(Event.COMPLETE));
+ return true;
+ }
+ }
+
if (current == numChildren)
{
dispatchEvent(new Event(Event.COMPLETE));
@@ -169,9 +170,10 @@ package org.apache.flex.ant.tags
dispatchEvent(new Event(Event.COMPLETE));
return true;
}
-
+
private function completeHandler(event:Event):void
{
+ event.target.removeEventListener(Event.COMPLETE, completeHandler);
if (!ant.project.status)
{
dispatchEvent(new Event(Event.COMPLETE));
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/Touch.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Touch.as b/ant_on_air/src/org/apache/flex/ant/tags/Touch.as
index 8ee1a0c..6d6e4a8 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/Touch.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/Touch.as
@@ -28,7 +28,7 @@ package org.apache.flex.ant.tags
import org.apache.flex.ant.Ant;
import org.apache.flex.ant.tags.supportClasses.TaskHandler;
- [ResourceBundle("ant")]
+ [ResourceBundle("ant")]
[Mixin]
public class Touch extends TaskHandler
{
@@ -36,7 +36,7 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["touch"] = Touch;
}
-
+
public function Touch()
{
}
@@ -44,22 +44,33 @@ package org.apache.flex.ant.tags
override public function execute(callbackMode:Boolean, context:Object):Boolean
{
super.execute(callbackMode, context);
-
- var f:File = new File(fileName);
- var s:String = ResourceManager.getInstance().getString('ant', 'TOUCH');
- s = s.replace("%1", f.nativePath);
- ant.output(ant.formatOutput("touch", s));
-
- var fs:FileStream = new FileStream();
+
+ try {
+ var f:File = new File(fileName);
+ }
+ catch (e:Error)
+ {
+ ant.output(fileName);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return true;
+ }
+
+ var s:String = ResourceManager.getInstance().getString('ant', 'TOUCH');
+ s = s.replace("%1", f.nativePath);
+ ant.output(ant.formatOutput("touch", s));
+
+ var fs:FileStream = new FileStream();
fs.open(f, FileMode.APPEND);
fs.close();
return true;
}
private function get fileName():String
- {
- return getAttributeValue("@file");
- }
-
+ {
+ return getAttributeValue("@file");
+ }
+
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/0dace696/ant_on_air/src/org/apache/flex/ant/tags/Untar.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Untar.as b/ant_on_air/src/org/apache/flex/ant/tags/Untar.as
index dd228fb..86d6225 100644
--- a/ant_on_air/src/org/apache/flex/ant/tags/Untar.as
+++ b/ant_on_air/src/org/apache/flex/ant/tags/Untar.as
@@ -32,7 +32,7 @@ package org.apache.flex.ant.tags
import org.apache.flex.ant.Ant;
import org.apache.flex.ant.tags.supportClasses.TaskHandler;
- [ResourceBundle("ant")]
+ [ResourceBundle("ant")]
[Mixin]
public class Untar extends TaskHandler
{
@@ -40,36 +40,59 @@ package org.apache.flex.ant.tags
{
Ant.antTagProcessors["untar"] = Untar;
}
-
+
public function Untar()
{
super();
}
private function get src():String
- {
- return getAttributeValue("@src");
- }
-
+ {
+ return getAttributeValue("@src");
+ }
+
private function get dest():String
- {
- return getAttributeValue("@dest");
- }
-
+ {
+ return getAttributeValue("@dest");
+ }
+
private function get overwrite():Boolean
- {
- return getAttributeValue("@overwrite") == "true";
- }
-
- private var destFile:File;
+ {
+ return getAttributeValue("@overwrite") == "true";
+ }
+
+ private var destFile:File;
override public function execute(callbackMode:Boolean, context:Object):Boolean
{
super.execute(callbackMode, context);
-
- var srcFile:File = File.applicationDirectory.resolvePath(src);
- destFile = File.applicationDirectory.resolvePath(dest);
-
+
+ try {
+ var srcFile:File = File.applicationDirectory.resolvePath(src);
+ }
+ catch (e:Error)
+ {
+ ant.output(src);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return true;
+ }
+
+ try {
+ destFile = File.applicationDirectory.resolvePath(dest);
+ if (!destFile.exists)
+ destFile.createDirectory();
+ }
+ catch (e:Error)
+ {
+ ant.output(dest);
+ ant.output(e.message);
+ if (failonerror)
+ ant.project.status = false;
+ return true;
+ }
+
untar(srcFile);
return false;
}
@@ -95,12 +118,12 @@ package org.apache.flex.ant.tags
startupInfo.executable = tar;
startupInfo.arguments = arguments;
- var s:String = ResourceManager.getInstance().getString('ant', 'UNZIP');
- s = s.replace("%1", source.nativePath);
- s = s.replace("%2", destFile.nativePath);
- ant.output(ant.formatOutput("untar", s));
-
- _process = new NativeProcess();
+ var s:String = ResourceManager.getInstance().getString('ant', 'UNZIP');
+ s = s.replace("%1", source.nativePath);
+ s = s.replace("%2", destFile.nativePath);
+ ant.output(ant.formatOutput("untar", s));
+
+ _process = new NativeProcess();
_process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, unTarFileProgress);
_process.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, unTarError);
_process.addEventListener(NativeProcessExitEvent.EXIT, unTarComplete);
@@ -125,6 +148,6 @@ package org.apache.flex.ant.tags
_process.exit(true);
dispatchEvent(new Event(Event.COMPLETE));
}
-
+
}
}
\ No newline at end of file