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 2015/06/15 08:30:47 UTC
[13/48] git commit: [flex-utilities] [refs/heads/develop] - move
ant_on_air into flex-installer
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/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
deleted file mode 100644
index 9493e2c..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/Echo.as
+++ /dev/null
@@ -1,93 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import flash.filesystem.File;
- import flash.filesystem.FileMode;
- import flash.filesystem.FileStream;
-
- import mx.core.IFlexModuleFactory;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.TaskHandler;
- import org.apache.flex.xml.ITextTagHandler;
-
- [Mixin]
- public class Echo extends TaskHandler implements ITextTagHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["echo"] = Echo;
- }
-
- public function Echo()
- {
- super();
- }
-
- private var _text:String;
-
- private function get text():String
- {
- if (_text != null)
- return _text;
-
- return getAttributeValue("@message");
- }
- private function get fileName():String
- {
- return getNullOrAttributeValue("@file");
- }
-
- public function setText(text:String):void
- {
- _text = text;
- }
-
- override public function execute(callbackMode:Boolean, context:Object):Boolean
- {
- super.execute(callbackMode, 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.failureMessage = e.message;
- 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;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/ant_on_air/src/org/apache/flex/ant/tags/Entry.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Entry.as b/ant_on_air/src/org/apache/flex/ant/tags/Entry.as
deleted file mode 100644
index 7f56457..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/Entry.as
+++ /dev/null
@@ -1,50 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import mx.core.IFlexModuleFactory;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.TagHandler;
-
- [Mixin]
- public class Entry extends TagHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["entry"] = Entry;
- }
-
- public function Entry()
- {
- super();
- }
-
- public function get key():String
- {
- return getAttributeValue("@key");
- }
-
- public function get value():String
- {
- return getNullOrAttributeValue("@value");
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/ant_on_air/src/org/apache/flex/ant/tags/Equals.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Equals.as b/ant_on_air/src/org/apache/flex/ant/tags/Equals.as
deleted file mode 100644
index 2ff7dc1..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/Equals.as
+++ /dev/null
@@ -1,80 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import mx.core.IFlexModuleFactory;
- import mx.utils.StringUtil;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.IValueTagHandler;
- import org.apache.flex.ant.tags.supportClasses.TagHandler;
-
- [Mixin]
- public class Equals extends TagHandler implements IValueTagHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["equals"] = Equals;
- }
-
- public function Equals()
- {
- super();
- }
-
- private function get arg1():String
- {
- return getAttributeValue("@arg1");
- }
-
- private function get arg2():String
- {
- return getAttributeValue("@arg2");
- }
-
- private function get casesensitive():Boolean
- {
- return getAttributeValue("@casesensitive") == "true";
- }
-
- private function get trim():Boolean
- {
- return getAttributeValue("@trim") == "true";
- }
-
- public function getValue(context:Object):Object
- {
- this.context = context;
- var val1:String = arg1;
- var val2:String = arg2;
- if (casesensitive)
- {
- val1 = val1.toLowerCase();
- val2 = val2.toLowerCase();
- }
- if (trim)
- {
- val1 = StringUtil.trim(val1 as String);
- val2 = StringUtil.trim(val2 as String);
- }
- return val1 == val2;
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/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
deleted file mode 100644
index bc503a6..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/Exec.as
+++ /dev/null
@@ -1,161 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import flash.desktop.NativeProcess;
- import flash.desktop.NativeProcessStartupInfo;
- import flash.events.Event;
- import flash.events.NativeProcessExitEvent;
- import flash.events.ProgressEvent;
- import flash.filesystem.File;
- import flash.system.Capabilities;
- import flash.utils.IDataInput;
-
- import mx.core.IFlexModuleFactory;
- import mx.utils.StringUtil;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.TaskHandler;
-
- [Mixin]
- public class Exec extends TaskHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- 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 (p.toLowerCase() == "windows")
- p = "win";
- 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 cmdline:String = fileName;
- for (var i:int = 0; i < numChildren; i++)
- {
- var arg:Arg = getChildAt(i) as Arg;
- arg.setContext(context);
- cmdline += " " + quoteIfNeeded(arg.value);
- }
- args.push(cmdline);
- }
- else
- args.push(fileName);
- nativeProcessStartupInfo.arguments = args;
- if (dir)
- {
- var wd:File;
- wd = File.applicationDirectory;
- wd = wd.resolvePath(dir);
- nativeProcessStartupInfo.workingDirectory = wd;
- }
-
- 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 dir():String
- {
- return getNullOrAttributeValue("@dir");
- }
-
- private function get fileName():String
- {
- return getAttributeValue("@executable");
- }
-
- private function get osFamily():String
- {
- return getAttributeValue("@osfamily");
- }
-
- private function get outputProperty():String
- {
- return getAttributeValue("@outputproperty");
- }
-
- private var process:NativeProcess;
-
- private function exitHandler(event:NativeProcessExitEvent):void
- {
- dispatchEvent(new Event(Event.COMPLETE));
- }
-
- private function onOutputErrorData(event:ProgressEvent):void
- {
- var stdError:IDataInput = process.standardError;
- var data:String = stdError.readUTFBytes(process.standardError.bytesAvailable);
- trace("Got Error Output: ", data);
- }
-
- private function onOutputData(event:ProgressEvent):void
- {
- var stdOut:IDataInput = process.standardOutput;
- var data:String = stdOut.readUTFBytes(process.standardOutput.bytesAvailable);
- trace("Got: ", data);
- if (outputProperty)
- context[outputProperty] = StringUtil.trim(data);
- }
-
- private function quoteIfNeeded(s:String):String
- {
- // has spaces but no quotes
- if (s.indexOf(" ") != -1 && s.indexOf('"') == -1)
- return '"' + s + '"';
- return s;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/ant_on_air/src/org/apache/flex/ant/tags/Fail.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Fail.as b/ant_on_air/src/org/apache/flex/ant/tags/Fail.as
deleted file mode 100644
index 6dd9b30..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/Fail.as
+++ /dev/null
@@ -1,78 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import mx.core.IFlexModuleFactory;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.TaskHandler;
-
- [Mixin]
- public class Fail extends TaskHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["fail"] = Fail;
- }
-
- public function Fail()
- {
- super();
- }
-
- private var _text:String;
- private function get text():String
- {
- if (_text != null)
- return _text;
-
- return getAttributeValue("@message");
- }
-
- public function setText(text:String):void
- {
- _text = text;
- }
-
- override public function execute(callbackMode:Boolean, context:Object):Boolean
- {
- super.execute(callbackMode, context);
- if (numChildren == 1)
- {
- var child:Condition = getChildAt(0) as Condition;
- if (child)
- {
- child.execute(false, context);
- var val:Object = child.computedValue;
- if (!(val == "true" || val == true))
- {
- return true;
- }
- }
- }
- if (text)
- {
- ant.output(ant.getValue(text, context));
- ant.project.failureMessage = ant.getValue(text, context);
- }
- ant.project.status = false;
- return true;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/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
deleted file mode 100644
index 41f80d5..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/FileSet.as
+++ /dev/null
@@ -1,81 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import mx.core.IFlexModuleFactory;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.filesetClasses.DirectoryScanner;
- import org.apache.flex.ant.tags.filesetClasses.exceptions.BuildException;
- import org.apache.flex.ant.tags.supportClasses.IValueTagHandler;
- import org.apache.flex.ant.tags.supportClasses.NamedTagHandler;
- import org.apache.flex.ant.tags.supportClasses.ParentTagHandler;
-
- [Mixin]
- public class FileSet extends ParentTagHandler implements IValueTagHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["fileset"] = FileSet;
- }
-
- public function FileSet()
- {
- super();
- }
-
- public function get dir():String
- {
- return getNullOrAttributeValue("@dir");
- }
-
- private var _value:Vector.<String>;
-
- public function getValue(context:Object):Object
- {
- if (_value) return _value;
- this.context = context;
-
- ant.processChildren(xml, this);
- var ds:DirectoryScanner = new DirectoryScanner();
- 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);
- }
- ds.setIncludes(includes);
- ds.setExcludes(excludes);
- if (dir != null)
- ds.setBasedir(dir);
- ds.scan();
- _value = ds.getIncludedFiles();
- return _value;
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/ant_on_air/src/org/apache/flex/ant/tags/FileSetExclude.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/FileSetExclude.as b/ant_on_air/src/org/apache/flex/ant/tags/FileSetExclude.as
deleted file mode 100644
index e2c0f02..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/FileSetExclude.as
+++ /dev/null
@@ -1,40 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import mx.core.IFlexModuleFactory;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.NamedTagHandler;
-
- [Mixin]
- public class FileSetExclude extends NamedTagHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["exclude"] = FileSetExclude;
- }
-
- public function FileSetExclude()
- {
- super();
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/ant_on_air/src/org/apache/flex/ant/tags/FileSetInclude.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/FileSetInclude.as b/ant_on_air/src/org/apache/flex/ant/tags/FileSetInclude.as
deleted file mode 100644
index 8c6f98f..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/FileSetInclude.as
+++ /dev/null
@@ -1,40 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import mx.core.IFlexModuleFactory;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.NamedTagHandler;
-
- [Mixin]
- public class FileSetInclude extends NamedTagHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["include"] = FileSetInclude;
- }
-
- public function FileSetInclude()
- {
- super();
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/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
deleted file mode 100644
index 2042d32..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/Get.as
+++ /dev/null
@@ -1,265 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-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;
- import flash.filesystem.File;
- import flash.filesystem.FileMode;
- import flash.filesystem.FileStream;
- import flash.net.URLLoader;
- import flash.net.URLLoaderDataFormat;
- import flash.net.URLRequest;
- import flash.net.URLRequestHeader;
- import flash.utils.ByteArray;
-
- import mx.core.IFlexModuleFactory;
- import mx.resources.ResourceManager;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.TaskHandler;
-
- [ResourceBundle("ant")]
- [Mixin]
- public class Get extends TaskHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["get"] = Get;
- }
-
- private static const DOWNLOADS_SOURCEFORGE_NET:String = "http://downloads.sourceforge.net/";
- private static const SOURCEFORGE_NET:String = "http://sourceforge.net/";
- private static const DL_SOURCEFORGE_NET:String = ".dl.sourceforge.net/";
- private static const USE_MIRROR:String = "use_mirror=";
-
- public function Get()
- {
- super();
- }
-
- private function get src():String
- {
- return getAttributeValue("@src");
- }
-
- private function get dest():String
- {
- return getAttributeValue("@dest");
- }
-
- private function get skipexisting():Boolean
- {
- return getAttributeValue("@skipexisting") == "true";
- }
-
- private function get ignoreerrors():Boolean
- {
- return getAttributeValue("@ignoreerrors") == "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 actualSrc:String = src;
- var urlRequest:URLRequest = new URLRequest(actualSrc);
- urlRequest.followRedirects = false;
- urlRequest.manageCookies = 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);
- 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)
- {
- var srcIndex:int = src.indexOf(DOWNLOADS_SOURCEFORGE_NET);
- var sfIndex:int = newlocation.indexOf(SOURCEFORGE_NET);
- var mirrorIndex:int = newlocation.indexOf(USE_MIRROR);
- if (srcIndex == 0 && sfIndex == 0 && mirrorIndex != -1 && event.status == 307)
- {
- // SourceForge redirects AIR requests differently from Ant requests.
- // We can't control some of the additional headers that are sent
- // but that appears to make the difference. Just pick out the
- // mirror and use it against dl.sourceforge.net
- var mirror:String = newlocation.substring(mirrorIndex + USE_MIRROR.length);
- newlocation = "http://" + mirror + DL_SOURCEFORGE_NET;
- newlocation += src.substring(DOWNLOADS_SOURCEFORGE_NET.length);
- }
- 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.manageCookies = false;
- 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());
- if (!ignoreerrors)
- {
- ant.project.failureMessage = ant.formatOutput("get", event.toString());
- ant.project.status = false;
- }
- dispatchEvent(new Event(Event.COMPLETE));
- event.preventDefault();
- urlLoader = null;
- }
-
- private function securityErrorHandler(event:SecurityErrorEvent):void
- {
- ant.output(event.toString());
- if (!ignoreerrors)
- {
- ant.project.failureMessage = ant.formatOutput("get", event.toString());
- ant.project.status = false;
- }
- dispatchEvent(new Event(Event.COMPLETE));
- event.preventDefault();
- urlLoader = null;
- }
-
- private function progressHandler(event:ProgressEvent):void
- {
- ant.progressClass = this;
- ant.dispatchEvent(event);
- }
-
- private function completeHandler(event:Event):void
- {
- var destFile:File = getDestFile();
- 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));
- urlLoader = null;
- }
-
- private function getDestFile():File
- {
- try {
- var destFile:File = File.applicationDirectory.resolvePath(dest);
- }
- catch (e:Error)
- {
- ant.output(dest);
- ant.output(e.message);
- if (failonerror)
- {
- ant.project.failureMessage = ant.formatOutput("get", e.message);
- ant.project.status = false;
- }
- return null;
- }
-
- if (destFile.isDirectory)
- {
- var fileName:String = src;
- var c:int = fileName.indexOf("?");
- if (c != -1)
- fileName = fileName.substring(0, c);
- c = fileName.lastIndexOf("/");
- if (c != -1)
- fileName = fileName.substr(c + 1);
- try {
- destFile = destFile.resolvePath(fileName);
- }
- catch (e:Error)
- {
- ant.output(fileName);
- ant.output(e.message);
- if (failonerror)
- {
- ant.project.failureMessage = ant.formatOutput("get", e.message);
- 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/f954e6f6/ant_on_air/src/org/apache/flex/ant/tags/GlobMapper.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/GlobMapper.as b/ant_on_air/src/org/apache/flex/ant/tags/GlobMapper.as
deleted file mode 100644
index dfedeb8..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/GlobMapper.as
+++ /dev/null
@@ -1,50 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import mx.core.IFlexModuleFactory;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.TagHandler;
-
- [Mixin]
- public class GlobMapper extends TagHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["globmapper"] = GlobMapper;
- }
-
- public function GlobMapper()
- {
- super();
- }
-
- public function get from():String
- {
- return getAttributeValue("@from");
- }
-
- public function get to():String
- {
- return getAttributeValue("@to");
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/ant_on_air/src/org/apache/flex/ant/tags/HasFreeSpace.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/HasFreeSpace.as b/ant_on_air/src/org/apache/flex/ant/tags/HasFreeSpace.as
deleted file mode 100644
index 11e7564..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/HasFreeSpace.as
+++ /dev/null
@@ -1,70 +0,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.
- */
-package org.apache.flex.ant.tags
-{
- import flash.filesystem.File;
-
- import mx.core.IFlexModuleFactory;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.IValueTagHandler;
- import org.apache.flex.ant.tags.supportClasses.TagHandler;
-
- [Mixin]
- public class HasFreeSpace extends TagHandler implements IValueTagHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["hasfreespace"] = HasFreeSpace;
- }
-
- public function HasFreeSpace()
- {
- super();
- }
-
- private function get partition():String
- {
- return getAttributeValue("@partition");
- }
-
- private function get needed():String
- {
- return getAttributeValue("@needed");
- }
-
- public function getValue(context:Object):Object
- {
- this.context = context;
-
- var file:File = new File(partition);
- var space:Number = file.spaceAvailable;
- var postfix:String = needed.substr(-1,1);
- var amount:Number = Number(needed.substr(0, needed.length-1));
-
- for each (var modifier:String in ["K","M","G","T","P"]) {
- amount *= 1024;
- if (postfix == modifier) {
- break;
- }
- }
-
- return (space >= amount);
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/ant_on_air/src/org/apache/flex/ant/tags/Input.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Input.as b/ant_on_air/src/org/apache/flex/ant/tags/Input.as
deleted file mode 100644
index f5808f4..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/Input.as
+++ /dev/null
@@ -1,96 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import flash.events.Event;
- import flash.events.KeyboardEvent;
- import flash.ui.Keyboard;
-
- import mx.core.IFlexModuleFactory;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.TaskHandler;
-
- [Mixin]
- public class Input extends TaskHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["input"] = Input;
- }
-
- public function Input()
- {
- super();
- }
-
- private function get text():String
- {
- return getAttributeValue("@message");
- }
-
- private function get validArgs():Array
- {
- var val:String = getNullOrAttributeValue("@validargs");
- return val == null ? null : val.split(",");
- }
-
- private function get property():String
- {
- return getAttributeValue("@addproperty");
- }
-
- private function get defaultValue():String
- {
- return getAttributeValue("@defaultvalue");
- }
-
- override public function execute(callbackMode:Boolean, context:Object):Boolean
- {
- super.execute(callbackMode, context);
- var s:String = "";
- if (text)
- s += ant.getValue(text, context);
- if (validArgs)
- s += " (" + validArgs + ")";
- ant.output(ant.formatOutput("input", s));
- ant.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
- return false;
- }
-
- // consumer should re-dispatch keyboard events from ant instance
- private function keyDownHandler(event:KeyboardEvent):void
- {
- var val:String;
-
- if (validArgs == null && event.keyCode == Keyboard.ENTER)
- val = defaultValue;
- else if (validArgs.indexOf(String.fromCharCode(event.charCode)) != -1)
- val = String.fromCharCode(event.charCode);
-
- if (val != null)
- {
- ant.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
- if (!context.hasOwnProperty(property))
- context[property] = val;
- dispatchEvent(new Event(Event.COMPLETE));
- }
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/ant_on_air/src/org/apache/flex/ant/tags/IsFalse.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/IsFalse.as b/ant_on_air/src/org/apache/flex/ant/tags/IsFalse.as
deleted file mode 100644
index 7019d35..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/IsFalse.as
+++ /dev/null
@@ -1,53 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import mx.core.IFlexModuleFactory;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.IValueTagHandler;
- import org.apache.flex.ant.tags.supportClasses.TagHandler;
-
- [Mixin]
- public class IsFalse extends TagHandler implements IValueTagHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["isfalse"] = IsFalse;
- }
-
- public function IsFalse()
- {
- super();
- }
-
- private function get value():String
- {
- return getAttributeValue("@value");
- }
-
- public function getValue(context:Object):Object
- {
- this.context = context;
-
- return !(value == "true" || value == "on" || value == "yes");
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/ant_on_air/src/org/apache/flex/ant/tags/IsReference.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/IsReference.as b/ant_on_air/src/org/apache/flex/ant/tags/IsReference.as
deleted file mode 100644
index 99a2222..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/IsReference.as
+++ /dev/null
@@ -1,54 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import mx.core.IFlexModuleFactory;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.IValueTagHandler;
- import org.apache.flex.ant.tags.supportClasses.TagHandler;
-
- [Mixin]
- public class IsReference extends TagHandler implements IValueTagHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["isreference"] = IsReference;
- }
-
- public function IsReference()
- {
- super();
- }
-
- private function get refid():String
- {
- return getNullOrAttributeValue("@refid");
- }
-
- public function getValue(context:Object):Object
- {
- this.context = context;
- if (refid == null) return false;
-
- return ant.project.refids.hasOwnProperty(refid);
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/ant_on_air/src/org/apache/flex/ant/tags/IsSet.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/IsSet.as b/ant_on_air/src/org/apache/flex/ant/tags/IsSet.as
deleted file mode 100644
index 7fb0199..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/IsSet.as
+++ /dev/null
@@ -1,54 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import mx.core.IFlexModuleFactory;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.IValueTagHandler;
- import org.apache.flex.ant.tags.supportClasses.TagHandler;
-
- [Mixin]
- public class IsSet extends TagHandler implements IValueTagHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["isset"] = IsSet;
- }
-
- public function IsSet()
- {
- super();
- }
-
- private function get property():String
- {
- return getNullOrAttributeValue("@property");
- }
-
- public function getValue(context:Object):Object
- {
- this.context = context;
- if (property == null) return false;
-
- return context.hasOwnProperty(property);
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/ant_on_air/src/org/apache/flex/ant/tags/IsTrue.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/IsTrue.as b/ant_on_air/src/org/apache/flex/ant/tags/IsTrue.as
deleted file mode 100644
index 9234be4..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/IsTrue.as
+++ /dev/null
@@ -1,53 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import mx.core.IFlexModuleFactory;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.IValueTagHandler;
- import org.apache.flex.ant.tags.supportClasses.TagHandler;
-
- [Mixin]
- public class IsTrue extends TagHandler implements IValueTagHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["istrue"] = IsTrue;
- }
-
- public function IsTrue()
- {
- super();
- }
-
- private function get value():String
- {
- return getAttributeValue("@value");
- }
-
- public function getValue(context:Object):Object
- {
- this.context = context;
-
- return (value == "true" || value == "on" || value == "yes");
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/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
deleted file mode 100644
index 6db0c68..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/LoadProperties.as
+++ /dev/null
@@ -1,95 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import flash.filesystem.File;
- import flash.filesystem.FileMode;
- import flash.filesystem.FileStream;
-
- import mx.core.IFlexModuleFactory;
- import mx.utils.StringUtil;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.TaskHandler;
-
- [Mixin]
- public class LoadProperties extends TaskHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["loadproperties"] = LoadProperties;
- }
-
- public function LoadProperties()
- {
- }
-
- override public function execute(callbackMode:Boolean, context:Object):Boolean
- {
- 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.failureMessage = e.message;
- ant.project.status = false;
- }
- return true;
- }
-
- 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)
- {
- var parts:Array = line.split("=");
- if (parts.length >= 2)
- {
- var key:String = StringUtil.trim(parts[0]);
- var val:String;
- if (parts.length == 2)
- val = parts[1];
- else
- {
- parts.shift();
- val = parts.join("=");
- }
- if (!context.hasOwnProperty(key))
- context[key] = val;
- }
-
- }
- fs.close();
- return true;
- }
-
- private function get fileName():String
- {
- return getAttributeValue("@srcFile");
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/ant_on_air/src/org/apache/flex/ant/tags/Matches.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Matches.as b/ant_on_air/src/org/apache/flex/ant/tags/Matches.as
deleted file mode 100644
index ce38d98..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/Matches.as
+++ /dev/null
@@ -1,62 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import mx.core.IFlexModuleFactory;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.IValueTagHandler;
- import org.apache.flex.ant.tags.supportClasses.TagHandler;
-
- [Mixin]
- public class Matches extends TagHandler implements IValueTagHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["matches"] = Matches;
- }
-
- public function Matches()
- {
- super();
- }
-
- private function get string():String
- {
- return getAttributeValue("@string");
- }
-
- private function get pattern():String
- {
- return getAttributeValue("@pattern");
- }
-
- public function getValue(context:Object):Object
- {
- this.context = context;
- var pat:String = pattern;
- if (pat.indexOf(".*") == -1)
- pat = pat.replace("*", ".*");
- var regex:RegExp = new RegExp(pat);
- var results:Array = string.match(regex);
- return results && results.length > 0;
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/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
deleted file mode 100644
index 9ce69dc..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/Mkdir.as
+++ /dev/null
@@ -1,77 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import flash.filesystem.File;
-
- import mx.core.IFlexModuleFactory;
- import mx.resources.ResourceManager;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.TaskHandler;
-
- [ResourceBundle("ant")]
- [Mixin]
- public class Mkdir extends TaskHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["mkdir"] = Mkdir;
- }
-
- public function Mkdir()
- {
- super();
- }
-
- private function get _dir():String
- {
- return getAttributeValue("@dir");
- }
-
- override public function execute(callbackMode:Boolean, context:Object):Boolean
- {
- super.execute(callbackMode, context);
-
- try
- {
- var dir:File = new File(_dir);
- }
- catch (e:Error)
- {
- ant.output(_dir);
- ant.output(e.message);
- if (failonerror)
- {
- ant.project.failureMessage = e.message;
- ant.project.status = false;
- }
- return true;
- }
-
- dir.createDirectory();
-
- var s:String = ResourceManager.getInstance().getString('ant', 'MKDIR');
- s = s.replace("%1", dir.nativePath);
- ant.output(ant.formatOutput("mkdir", s));
- return true;
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/ant_on_air/src/org/apache/flex/ant/tags/Move.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Move.as b/ant_on_air/src/org/apache/flex/ant/tags/Move.as
deleted file mode 100644
index 9e6a0d3..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/Move.as
+++ /dev/null
@@ -1,237 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import flash.events.Event;
- import flash.filesystem.File;
-
- import mx.core.IFlexModuleFactory;
- import mx.resources.ResourceManager;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.FileSetTaskHandler;
- import org.apache.flex.xml.ITagHandler;
-
- [ResourceBundle("ant")]
- [Mixin]
- public class Move extends FileSetTaskHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["move"] = Move;
- }
-
- public function Move()
- {
- super();
- }
-
- private function get fileName():String
- {
- return getAttributeValue("@file");
- }
-
- private function get toFileName():String
- {
- var val:String = getNullOrAttributeValue("@toFile");
- if (val != null)
- return val;
- return getNullOrAttributeValue("@tofile");
-
- }
-
- private function get toDirName():String
- {
- return getAttributeValue("@todir");
- }
-
- private function get overwrite():Boolean
- {
- 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;
-
- 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;
- mapper.setContext(context);
- break;
- }
- }
- searchedForMapper = true;
- }
-
- var srcName:String;
- if (dir)
- srcName = dir + File.separator + fileName;
- else
- srcName = fileName;
- try {
- var srcFile:File = File.applicationDirectory.resolvePath(srcName);
- }
- catch (e:Error)
- {
- ant.output(srcName);
- ant.output(e.message);
- if (failonerror)
- {
- ant.project.failureMessage = e.message;
- ant.project.status = false;
- }
- return;
- }
-
-
- if (mapper)
- {
- fileName = mapFileName(fileName);
- if (fileName == null)
- return;
- }
-
- var destName:String;
- if (toDirName)
- destName = toDirName + File.separator + fileName;
- else
- destName = toFileName;
- try {
- var destFile:File = File.applicationDirectory.resolvePath(destName);
- }
- catch (e:Error)
- {
- ant.output(destName);
- ant.output(e.message);
- if (failonerror)
- {
- ant.project.failureMessage = e.message;
- ant.project.status = false;
- }
- return;
- }
-
- srcFile.moveTo(destFile, overwrite);
- }
-
- override protected function outputTotal(total:int):void
- {
- var s:String = ResourceManager.getInstance().getString('ant', 'MOVEFILES');
- s = s.replace("%1", total.toString());
- s = s.replace("%2", toDirName);
- ant.output(ant.formatOutput("move", s));
- }
-
- private var srcFile:File;
- private var destFile:File;
-
- override public function execute(callbackMode:Boolean, context:Object):Boolean
- {
- var retVal:Boolean = super.execute(callbackMode, context);
- if (numChildren > 0)
- return retVal;
-
- try {
- srcFile = File.applicationDirectory.resolvePath(fileName);
- }
- catch (e:Error)
- {
- ant.output(fileName);
- ant.output(e.message);
- if (failonerror)
- {
- ant.project.failureMessage = e.message;
- ant.project.status = false;
- }
- return true;
- }
-
- var destFileName:String;
- if (toDirName)
- {
- var stem:String = srcFile.nativePath.substr(srcFile.parent.nativePath.length);
- destFileName = toDirName + stem;
- }
- else
- destFileName = toFileName;
-
- try {
- destFile = File.applicationDirectory.resolvePath(destFileName);
- }
- catch (e:Error)
- {
- ant.output(destFileName);
- ant.output(e.message);
- if (failonerror)
- {
- ant.project.failureMessage = e.message;
- 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', 'MOVE');
- s = s.replace("%1", "1");
- s = s.replace("%2", destFile.nativePath);
- ant.output(ant.formatOutput("move", s));
- if (callbackMode)
- {
- ant.functionToCall = doMove;
- return false;
- }
-
- doMove();
- return true;
- }
-
- protected function doMove():void
- {
- srcFile.moveTo(destFile, overwrite);
- dispatchEvent(new Event(Event.COMPLETE));
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/ant_on_air/src/org/apache/flex/ant/tags/Not.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Not.as b/ant_on_air/src/org/apache/flex/ant/tags/Not.as
deleted file mode 100644
index f4273d3..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/Not.as
+++ /dev/null
@@ -1,57 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import mx.core.IFlexModuleFactory;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.IValueTagHandler;
- import org.apache.flex.ant.tags.supportClasses.ParentTagHandler;
-
- [Mixin]
- public class Not extends ParentTagHandler implements IValueTagHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["not"] = Not;
- }
-
- public function Not()
- {
- super();
- }
-
- public function getValue(context:Object):Object
- {
- this.context = context;
- ant.processChildren(xml, this);
- if (numChildren == 1)
- {
- var value:IValueTagHandler = getChildAt(0) as IValueTagHandler;
- // get the value from the children
- var val:Object = IValueTagHandler(value).getValue(context);
- if (!(val == "true" || val == true))
- {
- return true;
- }
- }
- return false;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/ant_on_air/src/org/apache/flex/ant/tags/OS.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/OS.as b/ant_on_air/src/org/apache/flex/ant/tags/OS.as
deleted file mode 100644
index 5074573..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/OS.as
+++ /dev/null
@@ -1,57 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import flash.system.Capabilities;
-
- import mx.core.IFlexModuleFactory;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.IValueTagHandler;
- import org.apache.flex.ant.tags.supportClasses.TagHandler;
-
- [Mixin]
- public class OS extends TagHandler implements IValueTagHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["os"] = OS;
- }
-
- public function OS()
- {
- super();
- }
-
- private function get family():String
- {
- return getNullOrAttributeValue("@family");
- }
-
- public function getValue(context:Object):Object
- {
- this.context = context;
-
- if (family == null) return false;
-
- return Capabilities.os.toLowerCase().indexOf(family.toLowerCase()) != -1;
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/ant_on_air/src/org/apache/flex/ant/tags/Or.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Or.as b/ant_on_air/src/org/apache/flex/ant/tags/Or.as
deleted file mode 100644
index 35e8890..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/Or.as
+++ /dev/null
@@ -1,65 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import mx.core.IFlexModuleFactory;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.IValueTagHandler;
- import org.apache.flex.ant.tags.supportClasses.ParentTagHandler;
-
- [Mixin]
- public class Or extends ParentTagHandler implements IValueTagHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["or"] = Or;
- }
-
- public function Or()
- {
- super();
- }
-
- public function getValue(context:Object):Object
- {
- ant.processChildren(xml, this);
-
- if (numChildren > 0)
- {
- var n:int = numChildren;
- var result:Boolean;
-
- for (var i:int = 0; i < n; i++)
- {
- var value:IValueTagHandler = getChildAt(i) as IValueTagHandler;
- // get the value from the children
- var val:Object = IValueTagHandler(value).getValue(context);
-
- result = result || (val == "true" || val == true);
-
- if (result)
- return true;
- }
- }
-
- return false;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/ant_on_air/src/org/apache/flex/ant/tags/Param.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Param.as b/ant_on_air/src/org/apache/flex/ant/tags/Param.as
deleted file mode 100644
index 6e68c98..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/Param.as
+++ /dev/null
@@ -1,50 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import mx.core.IFlexModuleFactory;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.supportClasses.TagHandler;
-
- [Mixin]
- public class Param extends TagHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["param"] = Param;
- }
-
- public function Param()
- {
- super();
- }
-
- public function get name():String
- {
- return getAttributeValue("@name");
- }
-
- public function get value():String
- {
- return getAttributeValue("@value");
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/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
deleted file mode 100644
index 4540de8..0000000
--- a/ant_on_air/src/org/apache/flex/ant/tags/PatternSet.as
+++ /dev/null
@@ -1,96 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.ant.tags
-{
- import mx.core.IFlexModuleFactory;
-
- import org.apache.flex.ant.Ant;
- import org.apache.flex.ant.tags.filesetClasses.SelectorUtils;
- import org.apache.flex.ant.tags.filesetClasses.exceptions.BuildException;
- import org.apache.flex.ant.tags.supportClasses.NamedTagHandler;
- import org.apache.flex.ant.tags.supportClasses.ParentTagHandler;
-
- [Mixin]
- public class PatternSet extends ParentTagHandler
- {
- public static function init(mf:IFlexModuleFactory):void
- {
- Ant.antTagProcessors["patternset"] = PatternSet;
- }
-
- public function PatternSet()
- {
- super();
- }
-
- 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;
- 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