Return-Path: X-Original-To: apmail-flex-commits-archive@www.apache.org Delivered-To: apmail-flex-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0686B10E18 for ; Fri, 30 May 2014 22:41:37 +0000 (UTC) Received: (qmail 51977 invoked by uid 500); 30 May 2014 22:41:36 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 51864 invoked by uid 500); 30 May 2014 22:41:36 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 51790 invoked by uid 99); 30 May 2014 22:41:36 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 May 2014 22:41:36 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 921D388195A; Fri, 30 May 2014 22:41:36 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aharui@apache.org To: commits@flex.apache.org Date: Fri, 30 May 2014 22:41:38 -0000 Message-Id: <81eabe6c1eac42f2aa8086f599c60979@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [3/3] git commit: [flex-utilities] [refs/heads/develop] - add contains and tstamp to support timestamping urls add contains and tstamp to support timestamping urls Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/e7db8ee8 Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/e7db8ee8 Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/e7db8ee8 Branch: refs/heads/develop Commit: e7db8ee87c1cb6368ba89cd10ed01fbbb0c8149c Parents: 9b3a6cf Author: Alex Harui Authored: Fri May 30 15:41:06 2014 -0700 Committer: Alex Harui Committed: Fri May 30 15:41:06 2014 -0700 ---------------------------------------------------------------------- ant_on_air/src/AntClasses.as | 2 + .../src/org/apache/flex/ant/tags/Contains.as | 58 +++++++++++++++++ .../src/org/apache/flex/ant/tags/TStamp.as | 67 ++++++++++++++++++++ ant_on_air/tests/test.xml | 4 ++ 4 files changed, 131 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e7db8ee8/ant_on_air/src/AntClasses.as ---------------------------------------------------------------------- diff --git a/ant_on_air/src/AntClasses.as b/ant_on_air/src/AntClasses.as index e291943..5626ddf 100644 --- a/ant_on_air/src/AntClasses.as +++ b/ant_on_air/src/AntClasses.as @@ -30,6 +30,7 @@ package import org.apache.flex.ant.tags.Available; Available; import org.apache.flex.ant.tags.Checksum; Checksum; import org.apache.flex.ant.tags.Condition; Condition; + import org.apache.flex.ant.tags.Contains; Contains; import org.apache.flex.ant.tags.Copy; Copy; import org.apache.flex.ant.tags.Delete; Delete; import org.apache.flex.ant.tags.Echo; Echo; @@ -54,6 +55,7 @@ package import org.apache.flex.ant.tags.PropertyFile; PropertyFile; import org.apache.flex.ant.tags.Replace; Replace; import org.apache.flex.ant.tags.Touch; Touch; + import org.apache.flex.ant.tags.TStamp; TStamp; import org.apache.flex.ant.tags.Untar; Untar; import org.apache.flex.ant.tags.Unzip; Unzip; import org.apache.flex.ant.tags.XmlProperty; XmlProperty; http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e7db8ee8/ant_on_air/src/org/apache/flex/ant/tags/Contains.as ---------------------------------------------------------------------- diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Contains.as b/ant_on_air/src/org/apache/flex/ant/tags/Contains.as new file mode 100644 index 0000000..64f8738 --- /dev/null +++ b/ant_on_air/src/org/apache/flex/ant/tags/Contains.as @@ -0,0 +1,58 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 Contains extends TagHandler implements IValueTagHandler + { + public static function init(mf:IFlexModuleFactory):void + { + Ant.antTagProcessors["contains"] = Contains; + } + + public function Contains() + { + super(); + } + + private function get string():String + { + return getAttributeValue("@string"); + } + + private function get substring():String + { + return getAttributeValue("@substring"); + } + + public function getValue(context:Object):Object + { + this.context = context; + var pat:String = substring; + return string.indexOf(substring) != -1; + } + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e7db8ee8/ant_on_air/src/org/apache/flex/ant/tags/TStamp.as ---------------------------------------------------------------------- diff --git a/ant_on_air/src/org/apache/flex/ant/tags/TStamp.as b/ant_on_air/src/org/apache/flex/ant/tags/TStamp.as new file mode 100644 index 0000000..8b7f88b --- /dev/null +++ b/ant_on_air/src/org/apache/flex/ant/tags/TStamp.as @@ -0,0 +1,67 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.resources.ResourceManager; + + import spark.formatters.DateTimeFormatter; + + import org.apache.flex.ant.Ant; + import org.apache.flex.ant.tags.supportClasses.TaskHandler; + + [ResourceBundle("ant")] + [Mixin] + public class TStamp extends TaskHandler + { + public static function init(mf:IFlexModuleFactory):void + { + Ant.antTagProcessors["tstamp"] = TStamp; + } + + public function TStamp() + { + } + + override public function execute(callbackMode:Boolean, context:Object):Boolean + { + super.execute(callbackMode, context); + + var d:Date = new Date(); + var df:DateTimeFormatter = new DateTimeFormatter(); + df.dateTimePattern = "yyyyMMdd"; + var dstamp:String = df.format(d); + context["DSTAMP"] = dstamp; + df.dateTimePattern = "hhmm"; + var tstamp:String = df.format(d); + context["TSTAMP"] = tstamp; + df.dateTimePattern = "MMMM dd yyyy"; + var today:String = df.format(d); + context["TODAY"] = today; + + return true; + } + + private function get prefix():String + { + return getAttributeValue("@prefix"); + } + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e7db8ee8/ant_on_air/tests/test.xml ---------------------------------------------------------------------- diff --git a/ant_on_air/tests/test.xml b/ant_on_air/tests/test.xml index ebf9d0f..244862a 100644 --- a/ant_on_air/tests/test.xml +++ b/ant_on_air/tests/test.xml @@ -50,6 +50,10 @@ + + ${DSTAMP} + ${TSTAMP} + ${TODAY}