commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r831243 - in /commons/sandbox/runtime/trunk: ./ src/main/java/org/apache/commons/runtime/ src/main/native/ src/main/native/build/org/apache/commons/runtime/ src/main/native/build/org/apache/commons/runtime/ant/
Date Fri, 30 Oct 2009 09:49:54 GMT
Author: mturk
Date: Fri Oct 30 09:49:53 2009
New Revision: 831243

URL: http://svn.apache.org/viewvc?rev=831243&view=rev
Log:
Add and subdir for Ant tasks

Added:
    commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/
    commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/ConditionalExecTask.java
      - copied, changed from r830908, commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ConditionalExecTask.java
    commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/ConditionalSequence.java
      - copied, changed from r830908, commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ConditionalSequence.java
    commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/ConditionalTask.java
      - copied, changed from r830908, commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ConditionalTask.java
    commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/FormattedEchoTask.java
      - copied, changed from r830908, commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/FormattedEchoTask.java
    commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/SystemIdTask.java
      - copied, changed from r830908, commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/SystemIdTask.java
    commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/UuidTask.java
      - copied, changed from r830908, commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/UuidTask.java
    commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/VolatileProperty.java
      - copied, changed from r830908, commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/VolatileProperty.java
Removed:
    commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ConditionalExecTask.java
    commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ConditionalSequence.java
    commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ConditionalTask.java
    commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/FormattedEchoTask.java
    commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/SystemIdTask.java
    commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/UuidTask.java
    commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/VolatileProperty.java
Modified:
    commons/sandbox/runtime/trunk/build.xml
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Os.java
    commons/sandbox/runtime/trunk/src/main/native/configure.xml

Modified: commons/sandbox/runtime/trunk/build.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/build.xml?rev=831243&r1=831242&r2=831243&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/build.xml (original)
+++ commons/sandbox/runtime/trunk/build.xml Fri Oct 30 09:49:53 2009
@@ -176,27 +176,27 @@
             <classpath refid="task.classpath"/>
         </javac>
         <taskdef name="systemid"
-            classname="${build.package.name}.SystemIdTask">
+            classname="${build.package.name}.ant.SystemIdTask">
             <classpath refid="task.classpath"/>
         </taskdef>
         <taskdef name="conditional"
-            classname="${build.package.name}.ConditionalTask">
+            classname="${build.package.name}.ant.ConditionalTask">
             <classpath refid="task.classpath"/>
         </taskdef>
         <taskdef name="uuid"
-            classname="${build.package.name}.UuidTask">
+            classname="${build.package.name}.ant.UuidTask">
             <classpath refid="task.classpath"/>
         </taskdef>
         <taskdef name="variable"
-            classname="${build.package.name}.VolatileProperty">
+            classname="${build.package.name}.ant.VolatileProperty">
             <classpath refid="task.classpath"/>
         </taskdef>
         <taskdef name="cexec"
-            classname="${build.package.name}.ConditionalExecTask">
+            classname="${build.package.name}.ant.ConditionalExecTask">
             <classpath refid="task.classpath"/>
         </taskdef>
         <taskdef name="print"
-            classname="${build.package.name}.FormattedEchoTask">
+            classname="${build.package.name}.ant.FormattedEchoTask">
             <classpath refid="task.classpath"/>
         </taskdef>
         <uuid property="build.uuid" />

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Os.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Os.java?rev=831243&r1=831242&r2=831243&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Os.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Os.java Fri Oct
30 09:49:53 2009
@@ -31,17 +31,19 @@
         // No class instance
     }
 
+    /**
+     * Operating system type {@code EnumSet}.
+     */
+    public static final EnumSet<OsType> TYPE;
+
     /*
      * Get OS type.
      * @param type OS type to test.
      */
     private static native int type();
-
-    /**
-     * Operating system type {@code EnumSet}.
-     */
-    public static final EnumSet<OsType> TYPE = OsType.valueOf(type());
-
+    static {
+        TYPE = OsType.valueOf(type());
+    }
     /**
      * Name of the operating system implementation.
      */

Copied: commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/ConditionalExecTask.java
(from r830908, commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ConditionalExecTask.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/ConditionalExecTask.java?p2=commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/ConditionalExecTask.java&p1=commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ConditionalExecTask.java&r1=830908&r2=831243&rev=831243&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ConditionalExecTask.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/ConditionalExecTask.java
Fri Oct 30 09:49:53 2009
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.commons.runtime;
+package org.apache.commons.runtime.ant;
 
 import java.util.Iterator;
 import java.util.Properties;

Copied: commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/ConditionalSequence.java
(from r830908, commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ConditionalSequence.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/ConditionalSequence.java?p2=commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/ConditionalSequence.java&p1=commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ConditionalSequence.java&r1=830908&r2=831243&rev=831243&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ConditionalSequence.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/ConditionalSequence.java
Fri Oct 30 09:49:53 2009
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.commons.runtime;
+package org.apache.commons.runtime.ant;
 
 import java.util.Properties;
 import org.apache.tools.ant.BuildException;

Copied: commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/ConditionalTask.java
(from r830908, commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ConditionalTask.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/ConditionalTask.java?p2=commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/ConditionalTask.java&p1=commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ConditionalTask.java&r1=830908&r2=831243&rev=831243&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ConditionalTask.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/ConditionalTask.java
Fri Oct 30 09:49:53 2009
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.commons.runtime;
+package org.apache.commons.runtime.ant;
 
 import java.util.Properties;
 import org.apache.tools.ant.BuildException;
@@ -109,7 +109,10 @@
             if (target != null)
                 getProject().executeTarget(alternative);
             else {
-                VolatileProperty.set(getProject(), property, alternative, add);
+                if (add != null)
+                    VolatileProperty.set(getProject(), property, null, alternative);
+                else
+                    VolatileProperty.set(getProject(), property, alternative, null);
             }
         }
     }

Copied: commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/FormattedEchoTask.java
(from r830908, commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/FormattedEchoTask.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/FormattedEchoTask.java?p2=commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/FormattedEchoTask.java&p1=commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/FormattedEchoTask.java&r1=830908&r2=831243&rev=831243&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/FormattedEchoTask.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/FormattedEchoTask.java
Fri Oct 30 09:49:53 2009
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.commons.runtime;
+package org.apache.commons.runtime.ant;
 
 import java.util.Properties;
 import java.util.Formatter;

Copied: commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/SystemIdTask.java
(from r830908, commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/SystemIdTask.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/SystemIdTask.java?p2=commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/SystemIdTask.java&p1=commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/SystemIdTask.java&r1=830908&r2=831243&rev=831243&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/SystemIdTask.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/SystemIdTask.java
Fri Oct 30 09:49:53 2009
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.commons.runtime;
+package org.apache.commons.runtime.ant;
 
 import java.util.Properties;
 import org.apache.tools.ant.Task;

Copied: commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/UuidTask.java
(from r830908, commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/UuidTask.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/UuidTask.java?p2=commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/UuidTask.java&p1=commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/UuidTask.java&r1=830908&r2=831243&rev=831243&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/UuidTask.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/UuidTask.java
Fri Oct 30 09:49:53 2009
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.commons.runtime;
+package org.apache.commons.runtime.ant;
 
 import java.util.Random;
 import org.apache.tools.ant.Task;

Copied: commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/VolatileProperty.java
(from r830908, commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/VolatileProperty.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/VolatileProperty.java?p2=commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/VolatileProperty.java&p1=commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/VolatileProperty.java&r1=830908&r2=831243&rev=831243&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/VolatileProperty.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/native/build/org/apache/commons/runtime/ant/VolatileProperty.java
Fri Oct 30 09:49:53 2009
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.commons.runtime;
+package org.apache.commons.runtime.ant;
 
 import java.lang.reflect.Field;
 import java.util.Hashtable;
@@ -34,12 +34,33 @@
     private String  add;
     private boolean del;
     private String  equ;
+    private String  val;
+    private boolean vss;
+
     public VolatileProperty()
     {
         super();
         add = null;
         equ = null;
+        val = null;
         del = false;
+        vss = false;
+
+    }
+
+    public void setValue(String value)
+    {
+        super.setValue(value);
+        val = value;
+        vss = true;
+    }
+
+    public String getValue()
+    {
+        if (vss)
+            return val;
+        else
+            return super.getValue();
     }
 
     public void setAdd(String value)

Modified: commons/sandbox/runtime/trunk/src/main/native/configure.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/configure.xml?rev=831243&r1=831242&r2=831243&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/configure.xml (original)
+++ commons/sandbox/runtime/trunk/src/main/native/configure.xml Fri Oct 30 09:49:53 2009
@@ -75,31 +75,31 @@
             <classpath refid="task.classpath"/>
         </javac>
         <taskdef name="systemid"
-            classname="${build.package.name}.SystemIdTask">
+            classname="${build.package.name}.ant.SystemIdTask">
             <classpath refid="task.classpath"/>
         </taskdef>
         <taskdef name="conditional"
-            classname="${build.package.name}.ConditionalTask">
+            classname="${build.package.name}.ant.ConditionalTask">
             <classpath refid="task.classpath"/>
         </taskdef>
         <taskdef name="sequence"
-            classname="${build.package.name}.ConditionalSequence">
+            classname="${build.package.name}.ant.ConditionalSequence">
             <classpath refid="task.classpath"/>
         </taskdef>
         <taskdef name="uuid"
-            classname="${build.package.name}.UuidTask">
+            classname="${build.package.name}.ant.UuidTask">
             <classpath refid="task.classpath"/>
         </taskdef>
         <taskdef name="variable"
-            classname="${build.package.name}.VolatileProperty">
+            classname="${build.package.name}.ant.VolatileProperty">
             <classpath refid="task.classpath"/>
         </taskdef>
         <taskdef name="cexec"
-            classname="${build.package.name}.ConditionalExecTask">
+            classname="${build.package.name}.ant.ConditionalExecTask">
             <classpath refid="task.classpath"/>
         </taskdef>
         <taskdef name="print"
-            classname="${build.package.name}.FormattedEchoTask">
+            classname="${build.package.name}.ant.FormattedEchoTask">
             <classpath refid="task.classpath"/>
         </taskdef>
         <uuid property="build.uuid" />
@@ -126,16 +126,23 @@
             <arg line="-nologo"/>
             <arg line="cc${build.tstamp}.c /link /out:cc${build.tstamp}.exe"/>
         </cexec>
-        <cexec dir="${src.native}" executable="cc${build.tstamp}" outputproperty="@{result}"
+        <cexec dir="${src.native}" executable="gcc"
+              resultproperty="sizeof.err">
+            <and>
+                <systemid equals="linux"/>
+            </and>
+            <arg line="-D_REENTRANT -fPIC -O3 -Wall -g"/>
+            <arg line="cc${build.tstamp}.c -lrt -lpthread -ldl -o cc${build.tstamp}"/>
+        </cexec>
+        <cexec dir="${src.native}" executable="./cc${build.tstamp}" outputproperty="@{result}"
               resultproperty="sizeof.err" error="cc${build.tstamp}.err">
             <and>
-                <systemid equals="windows"/>
                 <variable name="sizeof.err" equals="0"/>
             </and>
         </cexec>
         <delete>
             <fileset dir="${src.native}">
-                <filename name="cc${build.tstamp}*" />
+                <filename name="ac${build.tstamp}*" />
             </fileset>
         </delete>
         <property name="@{result}" value="0"/>
@@ -162,6 +169,14 @@
             <arg line="-nologo"/>
             <arg line="cc${build.tstamp}.c /link /out:cc${build.tstamp}.exe"/>
         </cexec>
+        <cexec dir="${src.native}" executable="gcc" output="cc${build.tstamp}.log"
+              resultproperty="have.err">
+            <and>
+                <systemid equals="linux"/>
+            </and>
+            <arg line="-c"/>
+            <arg line="cc${build.tstamp}.c -o cc${build.tstamp}.o"/>
+        </cexec>
         <conditional variable="@{result}" value="1" else="0">
             <variable name="have.err" equals="0"/>
         </conditional>
@@ -264,14 +279,16 @@
         <echo message="check1 = ${check1}"/>
         <sizeof type="int"/>
         <sizeof type="long long" result="config.sizeof.longlong"/>
+        <!--
         <sequence ifnot="systemid.os" equals="windows">
-            <have-include check="unistd"/>
+            <have-include file="unistd"/>
         </sequence>
         <sequence if="systemid.os" equals="windows">
             <have-include file="windows"/>
             <have-library file="bufferoverflow"/>
             <have-library file="ktmw32"/>
         </sequence>
+        -->
         <print format="#define HAVE_UNISTD_H    %1s" message="${config.have.unistd}"/>
         <print format="#define HAVE_WINDOWS_H   %1s" message="${config.have.windows}"/>
     </target>



Mime
View raw message