Update of /cvsroot/ant-contrib/cpptasks/src/net/sf/antcontrib/cpptasks/compiler
In directory usw-pr-cvs1:/tmp/cvs-serv1660/src/net/sf/antcontrib/cpptasks/compiler
Modified Files:
AbstractCompiler.java AbstractLinker.java
AbstractProcessor.java CommandLineCCompiler.java
CommandLineCompiler.java CommandLineFortranCompiler.java
CommandLineLinker.java Linker.java Processor.java
Removed Files:
AbstractNamingScheme.java NamingScheme.java PlatformInfo.java
Log Message:
Removed PlatformInfo and NamingScheme
Index: AbstractCompiler.java
===================================================================
RCS file: /cvsroot/ant-contrib/cpptasks/src/net/sf/antcontrib/cpptasks/compiler/AbstractCompiler.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** AbstractCompiler.java 17 Apr 2002 00:56:16 -0000 1.9
--- AbstractCompiler.java 18 Apr 2002 08:41:05 -0000 1.10
***************
*** 56,60 ****
import net.sf.antcontrib.cpptasks.*;
import net.sf.antcontrib.cpptasks.parser.Parser;
- import net.sf.antcontrib.cpptasks.os.*;
import org.apache.tools.ant.Task;
import java.util.Vector;
--- 56,59 ----
***************
*** 73,79 ****
public abstract class AbstractCompiler extends AbstractProcessor implements Compiler
{
protected AbstractCompiler(String[] sourceExtensions,
! String[] headerExtensions) {
super(sourceExtensions, headerExtensions);
}
--- 72,81 ----
public abstract class AbstractCompiler extends AbstractProcessor implements Compiler
{
+ private String outputSuffix;
+
protected AbstractCompiler(String[] sourceExtensions,
! String[] headerExtensions, String outputSuffix) {
super(sourceExtensions, headerExtensions);
+ this.outputSuffix = outputSuffix;
}
***************
*** 109,116 ****
public String getOutputFileName(String inputFile) {
- if(scheme == null) {
- throw new java.lang.IllegalStateException("setPlatformInfo must be called prior to any call to getOutputFileName");
- }
-
//
// if a recognized input file
--- 111,114 ----
***************
*** 118,122 ****
if(bid(inputFile) > 1) {
String baseName = getBaseOutputName(inputFile);
! return scheme.getObjectName(baseName);
}
return null;
--- 116,120 ----
if(bid(inputFile) > 1) {
String baseName = getBaseOutputName(inputFile);
! return baseName + outputSuffix;
}
return null;
Index: AbstractLinker.java
===================================================================
RCS file: /cvsroot/ant-contrib/cpptasks/src/net/sf/antcontrib/cpptasks/compiler/AbstractLinker.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** AbstractLinker.java 17 Apr 2002 00:56:16 -0000 1.14
--- AbstractLinker.java 18 Apr 2002 08:41:05 -0000 1.15
***************
*** 99,145 ****
- /**
- * Determines if a file is a library that can be passed to this linker.
- * This implementation uses {@link #usesStaticLibs} and {@link #usesSharedLibs}
- * to determine whether the file is a library.
- *
- *
- */
- public boolean isLibrary(String filename)
- {
- if ( usesStaticLibs() && scheme.isStaticLibraryName(filename) ) {
- // Use static libs
- return true;
- }
- if ( usesSharedLibs() && scheme.isSharedLibraryName(filename) ) {
- // Use shared libs
- return true;
- }
- // Nothing else is a library
- return false;
- }
-
- /**
- * Returns true if this linker can use static libraries. This implementation
- * returns true.
- */
- protected boolean usesStaticLibs()
- {
- return true;
- }
-
- /**
- * Returns true if this linker can use shared libraries. This implementation
- * returns true.
- */
- protected boolean usesSharedLibs()
- {
- return true;
- }
-
- public String getLibraryKey(File lib) {
- return scheme.getKey(lib.getName());
- }
public LinkType getLinkType() {
--- 99,103 ----
***************
*** 147,164 ****
}
! public String getOutputFileName(String fileName) {
! if(linkType == LinkType.DYNAMIC_LIBRARY) {
! return scheme.getSharedLibraryName(fileName);
! }
! if(linkType == LinkType.EXECUTABLE ||
! linkType == LinkType.GUI) {
! return scheme.getExecutableName(fileName);
! }
! if(linkType == LinkType.STATIC_LIBRARY) {
! return scheme.getStaticLibraryName(fileName);
! }
! return null;
! }
!
/**
--- 105,109 ----
}
! public abstract String getOutputFileName(String fileName);
/**
***************
*** 190,193 ****
--- 135,142 ----
}
+ public String getLibraryKey(File libfile) {
+ return libfile.getName();
+ }
+
}
Index: AbstractProcessor.java
===================================================================
RCS file: /cvsroot/ant-contrib/cpptasks/src/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** AbstractProcessor.java 11 Apr 2002 05:34:41 -0000 1.5
--- AbstractProcessor.java 18 Apr 2002 08:41:05 -0000 1.6
***************
*** 56,61 ****
import net.sf.antcontrib.cpptasks.CUtil;
import net.sf.antcontrib.cpptasks.CompilerDef;
- import net.sf.antcontrib.cpptasks.os.UnixInfo;
- import net.sf.antcontrib.cpptasks.os.WindowsInfo;
import net.sf.antcontrib.cpptasks.parser.CParser;
import org.apache.tools.ant.Task;
--- 56,59 ----
***************
*** 75,80 ****
public abstract class AbstractProcessor implements Processor
{
- protected NamingScheme scheme;
- protected PlatformInfo info;
private /* final */ String[] sourceExtensions;
private /* final */ String[] headerExtensions;
--- 73,76 ----
***************
*** 85,123 ****
this.sourceExtensions = (String[]) sourceExtensions.clone();
this.headerExtensions = (String[]) headerExtensions.clone();
- info = defaultPlatformInfo();
- scheme = info.getDefaultNamingScheme();
}
abstract public String getIdentifier();
-
- /**
- * Sets the naming scheme for this compiler to use.
- */
- public void setPlatformInfo(PlatformInfo info)
- {
- if(info == null) {
- throw new NullPointerException("info");
- }
- this.info = info;
- scheme = info.getDefaultNamingScheme();
- }
-
- public PlatformInfo getPlatformInfo() {
- return info;
- }
-
- private static PlatformInfo defaultPlatformInfo() {
- // Determine if we're on Windows
- boolean win = ( System.getProperty("os.name").toLowerCase().indexOf("windows") >= 0 );
-
- // Create the platform info for this OS
- if ( win ) {
- // Running on Windows
- return WindowsInfo.getInstance();
- }
- // Assume UNIX platform
- return UnixInfo.getInstance();
- }
-
--- 81,87 ----
Index: CommandLineCCompiler.java
===================================================================
RCS file: /cvsroot/ant-contrib/cpptasks/src/net/sf/antcontrib/cpptasks/compiler/CommandLineCCompiler.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** CommandLineCCompiler.java 11 Apr 2002 05:34:41 -0000 1.7
--- CommandLineCCompiler.java 18 Apr 2002 08:41:05 -0000 1.8
***************
*** 76,81 ****
public abstract class CommandLineCCompiler extends CommandLineCompiler
{
! protected CommandLineCCompiler(String[] sourceExtensions, String[] headerExtensions) {
! super(sourceExtensions, headerExtensions);
}
--- 76,82 ----
public abstract class CommandLineCCompiler extends CommandLineCompiler
{
! protected CommandLineCCompiler(String[] sourceExtensions,
! String[] headerExtensions, String outputSuffix) {
! super(sourceExtensions, headerExtensions, outputSuffix);
}
Index: CommandLineCompiler.java
===================================================================
RCS file: /cvsroot/ant-contrib/cpptasks/src/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** CommandLineCompiler.java 18 Apr 2002 05:45:43 -0000 1.9
--- CommandLineCompiler.java 18 Apr 2002 08:41:05 -0000 1.10
***************
*** 81,86 ****
public abstract class CommandLineCompiler extends AbstractCompiler
{
! protected CommandLineCompiler(String[] sourceExtensions, String[] headerExtensions) {
! super(sourceExtensions, headerExtensions);
}
--- 81,87 ----
public abstract class CommandLineCompiler extends AbstractCompiler
{
! protected CommandLineCompiler(String[] sourceExtensions,
! String[] headerExtensions, String outputSuffix) {
! super(sourceExtensions, headerExtensions, outputSuffix);
}
***************
*** 93,97 ****
abstract protected void getDefineSwitch(StringBuffer buffer,String define, String value);
abstract protected void getUndefineSwitch(StringBuffer buffer, String define);
-
protected int getMaximumInputFilesPerCommand() {
--- 94,97 ----
Index: CommandLineFortranCompiler.java
===================================================================
RCS file: /cvsroot/ant-contrib/cpptasks/src/net/sf/antcontrib/cpptasks/compiler/CommandLineFortranCompiler.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CommandLineFortranCompiler.java 11 Apr 2002 05:34:41 -0000 1.1
--- CommandLineFortranCompiler.java 18 Apr 2002 08:41:05 -0000 1.2
***************
*** 66,71 ****
public abstract class CommandLineFortranCompiler extends CommandLineCompiler
{
! protected CommandLineFortranCompiler(String[] sourceExtensions, String[] headerExtensions) {
! super(sourceExtensions, headerExtensions);
}
--- 66,72 ----
public abstract class CommandLineFortranCompiler extends CommandLineCompiler
{
! protected CommandLineFortranCompiler(String[] sourceExtensions,
! String[] headerExtensions, String outputSuffix) {
! super(sourceExtensions, headerExtensions, outputSuffix);
}
Index: CommandLineLinker.java
===================================================================
RCS file: /cvsroot/ant-contrib/cpptasks/src/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** CommandLineLinker.java 17 Apr 2002 00:56:16 -0000 1.19
--- CommandLineLinker.java 18 Apr 2002 08:41:05 -0000 1.20
***************
*** 82,90 ****
{
private String[] librarySets;
/** Creates a comand line linker invocation */
! public CommandLineLinker(LinkType linkType,String[] extensions, String[] ignoredExtensions)
{
super(linkType, extensions, ignoredExtensions);
}
--- 82,93 ----
{
private String[] librarySets;
+ private String outputSuffix;
/** Creates a comand line linker invocation */
! public CommandLineLinker(LinkType linkType,String[] extensions,
! String[] ignoredExtensions, String outputSuffix)
{
super(linkType, extensions, ignoredExtensions);
+ this.outputSuffix = outputSuffix;
}
***************
*** 109,112 ****
--- 112,118 ----
}
+ public String getOutputFileName(String baseName) {
+ return baseName + outputSuffix;
+ }
protected LinkerConfiguration createConfiguration(
Task task,
Index: Linker.java
===================================================================
RCS file: /cvsroot/ant-contrib/cpptasks/src/net/sf/antcontrib/cpptasks/compiler/Linker.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Linker.java 10 Apr 2002 04:31:53 -0000 1.10
--- Linker.java 18 Apr 2002 08:41:05 -0000 1.11
***************
*** 77,90 ****
File[] getLibraryPath();
- /**
- * Determines if a file is a library that can be passed to this linker.
- */
- boolean isLibrary(String filename);
-
- /**
- * Returns a string used as a hash table key to prevent multiple
- * conflicting
- */
- String getLibraryKey(File file);
--- 77,80 ----
***************
*** 117,119 ****
--- 107,115 ----
*/
boolean isCaseSensitive();
+
+ /**
+ * Extracts the significant part of a library name
+ * to ensure there aren't collisions
+ */
+ String getLibraryKey(File libname);
}
Index: Processor.java
===================================================================
RCS file: /cvsroot/ant-contrib/cpptasks/src/net/sf/antcontrib/cpptasks/compiler/Processor.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Processor.java 17 Apr 2002 00:56:16 -0000 1.5
--- Processor.java 18 Apr 2002 08:41:05 -0000 1.6
***************
*** 69,80 ****
{
/**
- * Sets the platform meta-info for this compiler to use. This is called
- * before any of the other methods are called.
- */
- void setPlatformInfo(PlatformInfo info);
-
- PlatformInfo getPlatformInfo();
-
- /**
* Output file name (no path components) corresponding to
* source file
--- 69,72 ----
--- AbstractNamingScheme.java DELETED ---
--- NamingScheme.java DELETED ---
--- PlatformInfo.java DELETED ---
|