Author: hibou
Date: Wed Jun 20 14:04:04 2012
New Revision: 1352113
URL: http://svn.apache.org/viewvc?rev=1352113&view=rev
Log:
Add support of local variable
Added:
ant/sandbox/antdsl/org.apache.ant.antdsl/src/org/apache/ant/antdsl/AssignLocalTask.java
(with props)
Added:
ant/sandbox/antdsl/org.apache.ant.antdsl/src/org/apache/ant/antdsl/AssignLocalTask.java
URL:
http://svn.apache.org/viewvc/ant/sandbox/antdsl/org.apache.ant.antdsl/src/org/apache/ant/antdsl/AssignLocalTask.java?rev=1352113&view=auto
==============================================================================
---
ant/sandbox/antdsl/org.apache.ant.antdsl/src/org/apache/ant/antdsl/AssignLocalTask.java
(added)
+++
ant/sandbox/antdsl/org.apache.ant.antdsl/src/org/apache/ant/antdsl/AssignLocalTask.java
Wed Jun 20 14:04:04 2012
@@ -0,0 +1,44 @@
+/*
+ * 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.ant.antdsl;
+
+import org.apache.ant.antdsl.expr.AntExpression;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.PropertyHelper;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.property.LocalProperties;
+
+public class AssignLocalTask extends Task {
+
+ private String name;
+
+ private AntExpression value;
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setValue(AntExpression value) {
+ this.value = value;
+ }
+
+ @Override
+ public void execute() throws BuildException {
+ LocalProperties.get(getProject()).set(name, value.eval(),
PropertyHelper.getPropertyHelper(getProject()));
+ }
+}
Propchange:
ant/sandbox/antdsl/org.apache.ant.antdsl/src/org/apache/ant/antdsl/AssignLocalTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
ant/sandbox/antdsl/org.apache.ant.antdsl/src/org/apache/ant/antdsl/AssignLocalTask.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange:
ant/sandbox/antdsl/org.apache.ant.antdsl/src/org/apache/ant/antdsl/AssignLocalTask.java
------------------------------------------------------------------------------
svn:mime-type = text/plain