SF.net SVN: ant-contrib: [139] cpptasks/trunk/src
[email protected] Wed, 22 Aug 2007 14:08:36 -0700
| Newsgroups | gmane.comp.java.ant-contrib.devel |
|---|---|
| Message-ID | <[email protected]> |
Revision: 139
http://ant-contrib.svn.sourceforge.net/ant-contrib/?rev=139&view=rev
Author: darius42
Date: 2007-08-22 14:08:36 -0700 (Wed, 22 Aug 2007)
Log Message:
-----------
Update for bug 1715475. Extended the file types that will be bid on by the CC, aCC, and xlC compilers so that it will include '.s' files.
Modified Paths:
--------------
cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/hp/aCCCompiler.java
cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/ibm/VisualAgeCCompiler.java
cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/sun/ForteCCCompiler.java
cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/TestAllClasses.java
Added Paths:
-----------
cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/hp/
cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/hp/TestaCCCompiler.java
cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/ibm/
cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/ibm/TestVisualAgeCCompiler.java
cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/sun/
cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/sun/TestForteCCCompiler.java
Modified: cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/hp/aCCCompiler.java
===================================================================
--- cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/hp/aCCCompiler.java 2007-08-22 20:29:06 UTC (rev 138)
+++ cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/hp/aCCCompiler.java 2007-08-22 21:08:36 UTC (rev 139)
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2001-2004 The Ant-Contrib project
+ * Copyright 2001-2007 The Ant-Contrib project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,8 +31,13 @@
* @author Curt Arnold
*/
public final class aCCCompiler extends GccCompatibleCCompiler {
- private static final aCCCompiler instance = new aCCCompiler("aCC", false,
- null);
+ private final static String[] headerExtensions = new String[]{".h", ".hpp",
+ ".inl"};
+ private final static String[] sourceExtensions = new String[]{".c", ".cc",
+ ".cxx", ".cpp", ".c++", ".i", ".s"};
+
+ private static final aCCCompiler instance = new aCCCompiler("aCC",
+ sourceExtensions, headerExtensions, false, null);
/**
* Gets singleton instance of this class
*/
@@ -45,8 +50,11 @@
* Private constructor. Use GccCCompiler.getInstance() to get singleton
* instance of this class.
*/
- private aCCCompiler(String command, boolean newEnvironment, Environment env) {
- super(command, "-help", false, null, newEnvironment, env);
+ private aCCCompiler(String command, String[] sourceExtensions,
+ String[] headerExtensions, boolean newEnvironment,
+ Environment env) {
+ super(command, "-help", sourceExtensions, headerExtensions, false,
+ null, newEnvironment, env);
}
public void addImpliedArgs(Vector args, boolean debug,
boolean multithreaded, boolean exceptions, LinkType linkType,
Modified: cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/ibm/VisualAgeCCompiler.java
===================================================================
--- cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/ibm/VisualAgeCCompiler.java 2007-08-22 20:29:06 UTC (rev 138)
+++ cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/ibm/VisualAgeCCompiler.java 2007-08-22 21:08:36 UTC (rev 139)
@@ -30,8 +30,13 @@
* @author Curt Arnold
*/
public final class VisualAgeCCompiler extends GccCompatibleCCompiler {
+ private final static String[] headerExtensions = new String[]{".h", ".hpp",
+ ".inl"};
+ private final static String[] sourceExtensions = new String[]{".c", ".cc",
+ ".cxx", ".cpp", ".i", ".s"};
+
private static final VisualAgeCCompiler instance = new VisualAgeCCompiler(
- "xlC", false, null);
+ "xlC", sourceExtensions, headerExtensions, false, null);
/**
* Gets singleton instance of this class
*/
@@ -44,9 +49,11 @@
* Private constructor. Use getInstance() to get singleton instance of this
* class.
*/
- private VisualAgeCCompiler(String command, boolean newEnvironment,
+ private VisualAgeCCompiler(String command, String[] sourceExtensions,
+ String[] headerExtensions, boolean newEnvironment,
Environment env) {
- super(command, "-help", false, null, newEnvironment, env);
+ super(command, "-help", sourceExtensions, headerExtensions, false,
+ null, newEnvironment, env);
}
public void addImpliedArgs(final Vector args,
final boolean debug,
Modified: cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/sun/ForteCCCompiler.java
===================================================================
--- cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/sun/ForteCCCompiler.java 2007-08-22 20:29:06 UTC (rev 138)
+++ cpptasks/trunk/src/main/java/net/sf/antcontrib/cpptasks/sun/ForteCCCompiler.java 2007-08-22 21:08:36 UTC (rev 139)
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2001-2004 The Ant-Contrib project
+ * Copyright 2001-2007 The Ant-Contrib project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,7 +29,13 @@
* @author Curt Arnold
*/
public final class ForteCCCompiler extends GccCompatibleCCompiler {
- private static final ForteCCCompiler instance = new ForteCCCompiler("CC");
+ private final static String[] headerExtensions = new String[]{".h", ".hpp",
+ ".inl"};
+ private final static String[] sourceExtensions = new String[]{".c", ".cc",
+ ".cxx", ".cpp", ".c++", ".i", ".s"};
+
+ private static final ForteCCCompiler instance = new ForteCCCompiler("CC",
+ sourceExtensions, headerExtensions);
/**
* Gets singleton instance of this class
*/
@@ -42,8 +48,10 @@
* Private constructor. Use ForteCCCompiler.getInstance() to get singleton
* instance of this class.
*/
- private ForteCCCompiler(String command) {
- super(command, "-V", false, null, false, null);
+ private ForteCCCompiler(String command, String[] sourceExtensions,
+ String[] headerExtensions) {
+ super(command, "-V", sourceExtensions, headerExtensions, false, null,
+ false, null);
}
public void addImpliedArgs(final Vector args,
final boolean debug,
Modified: cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/TestAllClasses.java
===================================================================
--- cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/TestAllClasses.java 2007-08-22 20:29:06 UTC (rev 138)
+++ cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/TestAllClasses.java 2007-08-22 21:08:36 UTC (rev 139)
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2002-2004 The Ant-Contrib project
+ * Copyright 2002-2007 The Ant-Contrib project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -56,5 +56,8 @@
addTestSuite(net.sf.antcontrib.cpptasks.gcc.TestAbstractArLibrarian.class);
addTestSuite(net.sf.antcontrib.cpptasks.gcc.TestGccLinker.class);
addTestSuite(net.sf.antcontrib.cpptasks.gcc.TestGccLinker.class);
+ addTestSuite(net.sf.antcontrib.cpptasks.sun.TestForteCCCompiler.class);
+ addTestSuite(net.sf.antcontrib.cpptasks.hp.TestaCCCompiler.class);
+ addTestSuite(net.sf.antcontrib.cpptasks.ibm.TestVisualAgeCCompiler.class);
}
}
Added: cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/hp/TestaCCCompiler.java
===================================================================
--- cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/hp/TestaCCCompiler.java (rev 0)
+++ cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/hp/TestaCCCompiler.java 2007-08-22 21:08:36 UTC (rev 139)
@@ -0,0 +1,93 @@
+/*
+ *
+ * Copyright 2002-2007 The Ant-Contrib project
+ *
+ * Licensed 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 net.sf.antcontrib.cpptasks.hp;
+import java.util.Vector;
+
+import junit.framework.TestCase;
+
+import net.sf.antcontrib.cpptasks.compiler.AbstractProcessor;
+/**
+ * Test HP aCC compiler adapter
+ *
+ */
+// TODO Since aCCCompiler extends GccCompatibleCCompiler, this test
+// should probably extend TestGccCompatibleCCompiler.
+public class TestaCCCompiler extends TestCase {
+ public TestaCCCompiler(String name) {
+ super(name);
+ }
+ public void testBidC() {
+ aCCCompiler compiler = aCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.c"));
+ }
+ public void testBidCpp() {
+ aCCCompiler compiler = aCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.C"));
+ }
+ public void testBidCpp2() {
+ aCCCompiler compiler = aCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.cc"));
+ }
+ public void testBidCpp3() {
+ aCCCompiler compiler = aCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.CC"));
+ }
+ public void testBidCpp4() {
+ aCCCompiler compiler = aCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.cxx"));
+ }
+ public void testBidCpp5() {
+ aCCCompiler compiler = aCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.CXX"));
+ }
+ public void testBidCpp6() {
+ aCCCompiler compiler = aCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.cpp"));
+ }
+ public void testBidCpp7() {
+ aCCCompiler compiler = aCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.CPP"));
+ }
+ public void testBidCpp8() {
+ aCCCompiler compiler = aCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.c++"));
+ }
+ public void testBidCpp9() {
+ aCCCompiler compiler = aCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.C++"));
+ }
+ public void testBidPreprocessed() {
+ aCCCompiler compiler = aCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.i"));
+ }
+ public void testBidAssembly() {
+ aCCCompiler compiler = aCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.s"));
+ }
+}
Added: cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/ibm/TestVisualAgeCCompiler.java
===================================================================
--- cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/ibm/TestVisualAgeCCompiler.java (rev 0)
+++ cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/ibm/TestVisualAgeCCompiler.java 2007-08-22 21:08:36 UTC (rev 139)
@@ -0,0 +1,68 @@
+/*
+ *
+ * Copyright 2002-2007 The Ant-Contrib project
+ *
+ * Licensed 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 net.sf.antcontrib.cpptasks.ibm;
+import java.util.Vector;
+
+import junit.framework.TestCase;
+
+import net.sf.antcontrib.cpptasks.compiler.AbstractProcessor;
+/**
+ * Test IBM Visual Age compiler adapter
+ *
+ */
+// TODO Since VisualAgeCCompiler extends GccCompatibleCCompiler, this test
+// should probably extend TestGccCompatibleCCompiler.
+public class TestVisualAgeCCompiler extends TestCase {
+ public TestVisualAgeCCompiler(String name) {
+ super(name);
+ }
+ public void testBidC() {
+ VisualAgeCCompiler compiler = VisualAgeCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.c"));
+ }
+ public void testBidCpp() {
+ VisualAgeCCompiler compiler = VisualAgeCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.C"));
+ }
+ public void testBidCpp2() {
+ VisualAgeCCompiler compiler = VisualAgeCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.cc"));
+ }
+ public void testBidCpp3() {
+ VisualAgeCCompiler compiler = VisualAgeCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.cxx"));
+ }
+ public void testBidCpp4() {
+ VisualAgeCCompiler compiler = VisualAgeCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.cpp"));
+ }
+ public void testBidPreprocessed() {
+ VisualAgeCCompiler compiler = VisualAgeCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.i"));
+ }
+ public void testBidAssembly() {
+ VisualAgeCCompiler compiler = VisualAgeCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.s"));
+ }
+}
Added: cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/sun/TestForteCCCompiler.java
===================================================================
--- cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/sun/TestForteCCCompiler.java (rev 0)
+++ cpptasks/trunk/src/test/java/net/sf/antcontrib/cpptasks/sun/TestForteCCCompiler.java 2007-08-22 21:08:36 UTC (rev 139)
@@ -0,0 +1,73 @@
+/*
+ *
+ * Copyright 2002-2007 The Ant-Contrib project
+ *
+ * Licensed 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 net.sf.antcontrib.cpptasks.sun;
+import java.util.Vector;
+
+import junit.framework.TestCase;
+
+import net.sf.antcontrib.cpptasks.compiler.AbstractProcessor;
+/**
+ * Test Sun Forte compiler adapter
+ *
+ */
+// TODO Since ForteCCCompiler extends GccCompatibleCCompiler, this test
+// should probably extend TestGccCompatibleCCompiler.
+public class TestForteCCCompiler extends TestCase {
+ public TestForteCCCompiler(String name) {
+ super(name);
+ }
+ public void testBidC() {
+ ForteCCCompiler compiler = ForteCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.c"));
+ }
+ public void testBidCpp() {
+ ForteCCCompiler compiler = ForteCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.C"));
+ }
+ public void testBidCpp2() {
+ ForteCCCompiler compiler = ForteCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.cc"));
+ }
+ public void testBidCpp3() {
+ ForteCCCompiler compiler = ForteCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.cxx"));
+ }
+ public void testBidCpp4() {
+ ForteCCCompiler compiler = ForteCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.cpp"));
+ }
+ public void testBidCpp5() {
+ ForteCCCompiler compiler = ForteCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.c++"));
+ }
+ public void testBidPreprocessed() {
+ ForteCCCompiler compiler = ForteCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.i"));
+ }
+ public void testBidAssembly() {
+ ForteCCCompiler compiler = ForteCCCompiler.getInstance();
+ assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler
+ .bid("foo.s"));
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/