diff options
Diffstat (limited to 'Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types')
16 files changed, 0 insertions, 1321 deletions
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/AslcompilerArgument.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/AslcompilerArgument.java deleted file mode 100644 index 87babcf740..0000000000 --- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/AslcompilerArgument.java +++ /dev/null @@ -1,30 +0,0 @@ -/*
- *
- * Copyright 2001-2005 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.types;
-
-/**
- * A aslcompiler command line argument.
- */
-public class AslcompilerArgument extends CommandLineArgument {
- public AslcompilerArgument () {
- }
-
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-}
\ No newline at end of file diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/AssemblerArgument.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/AssemblerArgument.java deleted file mode 100644 index 1b5f54d9a7..0000000000 --- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/AssemblerArgument.java +++ /dev/null @@ -1,30 +0,0 @@ -/*
- *
- * Copyright 2001-2005 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.types;
-
-/**
- * A assembler command line argument.
- */
-public class AssemblerArgument extends CommandLineArgument {
- public AssemblerArgument () {
- }
-
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/CommandLineArgument.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/CommandLineArgument.java deleted file mode 100644 index 91ab2f6327..0000000000 --- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/CommandLineArgument.java +++ /dev/null @@ -1,122 +0,0 @@ -/*
- *
- * Copyright 2001-2004 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.types;
-
-import org.apache.tools.ant.types.EnumeratedAttribute;
-import java.io.File;
-/**
- * An compiler/linker command line flag.
- */
-public class CommandLineArgument {
- /**
- * Enumerated attribute with the values "start", "mid" and "end",
- */
- public static class LocationEnum extends EnumeratedAttribute {
- public String[] getValues() {
- return new String[]{"start", "mid", "end"};
- }
- }
- private String ifCond;
- private int location;
- private String unlessCond;
- private String value;
- private File file;
- public CommandLineArgument() {
- }
- public int getLocation() {
- return location;
- }
- public String getValue() {
- return value;
- }
- public File getFile() {
- return file;
- }
- /**
- * Returns true if the define's if and unless conditions (if any) are
- * satisfied.
- */
- public boolean isActive(org.apache.tools.ant.Project p) {
- if (value == null) {
- return false;
- }
- if (ifCond != null && p.getProperty(ifCond) == null) {
- return false;
- } else if (unlessCond != null && p.getProperty(unlessCond) != null) {
- return false;
- }
- return true;
- }
- /**
- * Sets the property name for the 'if' condition.
- *
- * The argument will be ignored unless the property is defined.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") will throw an exception when
- * evaluated.
- */
- public void setIf(String propName) {
- ifCond = propName;
- }
- /**
- * Specifies relative location of argument on command line. "start" will
- * place argument at start of command line, "mid" will place argument after
- * all "start" arguments but before filenames, "end" will place argument
- * after filenames.
- *
- */
- public void setLocation(LocationEnum location) {
- this.location = location.getIndex();
- }
- /**
- * Set the property name for the 'unless' condition.
- *
- * If named property is set, the argument will be ignored.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") of the behavior will throw an
- * exception when evaluated.
- *
- * @param propName
- * name of property
- */
- public void setUnless(String propName) {
- unlessCond = propName;
- }
- /**
- * Specifies the string that should appear on the command line. The
- * argument will be quoted if it contains embedded blanks. Use multiple
- * arguments to avoid quoting.
- *
- */
- public void setValue(String value) {
- this.value = value;
- }
- /**
- * Specifies the file which lists many strings that should appear on
- * the command line. Each line is one argument. The argument will be
- * quated if it contains embedded blanks. Use multiple arguments in
- * file to avoid quating.
- *
- * @param file
- * name of the file
- */
- public void setFile(File file) {
- this.file = file;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/CompilerArgument.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/CompilerArgument.java deleted file mode 100644 index ca9e90e732..0000000000 --- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/CompilerArgument.java +++ /dev/null @@ -1,28 +0,0 @@ -/*
- *
- * Copyright 2001-2004 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.types;
-/**
- * A compiler command line argument.
- */
-public class CompilerArgument extends CommandLineArgument {
- public CompilerArgument() {
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/ConditionalFileSet.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/ConditionalFileSet.java deleted file mode 100644 index af2d141e99..0000000000 --- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/ConditionalFileSet.java +++ /dev/null @@ -1,84 +0,0 @@ -/*
- *
- * Copyright 2001-2004 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.types;
-import net.sf.antcontrib.cpptasks.CUtil;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.AbstractFileSet;
-import org.apache.tools.ant.types.FileSet;
-/**
- * An Ant FileSet object augmented with if and unless conditions.
- *
- * @author Curt Arnold
- */
-public class ConditionalFileSet extends FileSet {
- private String ifCond;
- private String unlessCond;
- public ConditionalFileSet() {
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
- /**
- * overrides FileSet's implementation which would throw an exception since
- * the referenced object isn't this type.
- */
- protected AbstractFileSet getRef(Project p) {
- return (AbstractFileSet) getRefid().getReferencedObject(p);
- }
- /**
- * Returns true if the Path's if and unless conditions (if any) are
- * satisfied.
- */
- public boolean isActive() throws BuildException {
- Project p = getProject();
- if (p == null) {
- throw new java.lang.IllegalStateException(
- "setProject() should have been called");
- }
- return CUtil.isActive(p, ifCond, unlessCond);
- }
- /**
- * Sets the property name for the 'if' condition.
- *
- * The fileset will be ignored unless the property is defined.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") will throw an exception when
- * evaluated.
- */
- public void setIf(String propName) {
- ifCond = propName;
- }
- /**
- * Set the property name for the 'unless' condition.
- *
- * If named property is set, the fileset will be ignored.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") of the behavior will throw an
- * exception when evaluated.
- *
- * @param propName
- * name of property
- */
- public void setUnless(String propName) {
- unlessCond = propName;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/ConditionalPath.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/ConditionalPath.java deleted file mode 100644 index dc21189c15..0000000000 --- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/ConditionalPath.java +++ /dev/null @@ -1,92 +0,0 @@ -/*
- *
- * Copyright 2001-2004 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.types;
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.Path;
-/**
- * An Ant Path object augmented with if and unless conditionals
- *
- * @author Curt Arnold
- */
-public class ConditionalPath extends Path {
- private String ifCond;
- private String unlessCond;
- private File file;
- public ConditionalPath(Project project) {
- super(project);
- }
- public ConditionalPath(Project p, String path) {
- super(p, path);
- }
- public File getFile() {
- return file;
- }
- /**
- * Returns true if the Path's if and unless conditions (if any) are
- * satisfied.
- */
- public boolean isActive(org.apache.tools.ant.Project p)
- throws BuildException {
- return CUtil.isActive(p, ifCond, unlessCond);
- }
- /**
- * Sets the property name for the 'if' condition.
- *
- * The path will be ignored unless the property is defined.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") will throw an exception when
- * evaluated.
- *
- * @param propName
- * property name
- */
- public void setIf(String propName) {
- ifCond = propName;
- }
- /**
- * Set the property name for the 'unless' condition.
- *
- * If named property is set, the path will be ignored.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") of the behavior will throw an
- * exception when evaluated.
- *
- * @param propName
- * name of property
- */
- public void setUnless(String propName) {
- unlessCond = propName;
- }
- /**
- * Specifies the file which lists many include paths that should appear on
- * the command line. Each line is an include path. The includepath will be
- * quated if it contains embedded blanks.
- *
- * @param file
- * name of the file
- */
- public void setFile(File file) {
- this.file = file;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/DefineArgument.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/DefineArgument.java deleted file mode 100644 index 824e939481..0000000000 --- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/DefineArgument.java +++ /dev/null @@ -1,38 +0,0 @@ -/*
- *
- * Copyright 2001-2004 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.types;
-/**
- * Preprocessor macro definition.
- *
- * @author Mark A Russell <a
- * href="mailto:mark_russell@csgsystems.com">mark_russell@csg_systems.com
- * </a>
- */
-public class DefineArgument extends UndefineArgument {
- private String value;
- public DefineArgument() {
- super(true);
- }
- /** Returns the value of the define */
- public final String getValue() {
- return value;
- }
- /** Set the value attribute */
- public final void setValue(String value) {
- this.value = value;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/DefineSet.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/DefineSet.java deleted file mode 100644 index 9d229fb0ff..0000000000 --- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/DefineSet.java +++ /dev/null @@ -1,199 +0,0 @@ -/*
- *
- * Copyright 2001-2004 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.types;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.Reference;
-/**
- * Set of preprocessor macro defines and undefines.
- *
- * @author Mark A Russell <a
- * href="mailto:mark_russell@csgsystems.com">mark_russell@csg_systems.com
- * </a>
- * @author Adam Murdoch
- */
-public class DefineSet extends DataType {
- private Vector defineList = new Vector();
- private String ifCond = null;
- private String unlessCond = null;
- /**
- *
- * Adds a define element.
- *
- * @throws BuildException
- * if reference
- */
- public void addDefine(DefineArgument arg) throws BuildException {
- if (isReference()) {
- throw noChildrenAllowed();
- }
- defineList.addElement(arg);
- }
- /** Adds defines/undefines. */
- private void addDefines(String[] defs, boolean isDefine) {
- for (int i = 0; i < defs.length; i++) {
- UndefineArgument def;
- if (isDefine) {
- def = new DefineArgument();
- } else {
- def = new UndefineArgument();
- }
- def.setName(defs[i]);
- defineList.addElement(def);
- }
- }
- /**
- *
- * Adds an undefine element.
- *
- * @throws BuildException
- * if reference
- */
- public void addUndefine(UndefineArgument arg) throws BuildException {
- if (isReference()) {
- throw noChildrenAllowed();
- }
- defineList.addElement(arg);
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
- /** Returns the defines and undefines in this set. */
- public UndefineArgument[] getDefines() throws BuildException {
- if (isReference()) {
- DefineSet defset = (DefineSet) getCheckedRef(DefineSet.class,
- "DefineSet");
- return defset.getDefines();
- } else {
- if (isActive()) {
- UndefineArgument[] defs = new UndefineArgument[defineList
- .size()];
- defineList.copyInto(defs);
- return defs;
- } else {
- return new UndefineArgument[0];
- }
- }
- }
- /**
- * Returns true if the define's if and unless conditions (if any) are
- * satisfied.
- *
- * @exception BuildException
- * throws build exception if name is not set
- */
- public final boolean isActive() throws BuildException {
- return CUtil.isActive(getProject(), ifCond, unlessCond);
- }
- /**
- * A comma-separated list of preprocessor macros to define. Use nested
- * define elements to define macro values.
- *
- * @param defList
- * comma-separated list of preprocessor macros
- * @throws BuildException
- * throw if defineset is a reference
- */
- public void setDefine(CUtil.StringArrayBuilder defList)
- throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- addDefines(defList.getValue(), true);
- }
- /**
- * Sets a description of the current data type.
- */
- public void setDescription(String desc) {
- super.setDescription(desc);
- }
- /**
- * Sets an id that can be used to reference this element.
- *
- * @param id
- * id
- */
- public void setId(String id) {
- //
- // this is actually accomplished by a different
- // mechanism, but we can document it
- //
- }
- /**
- * Sets the property name for the 'if' condition.
- *
- * The define will be ignored unless the property is defined.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") will throw an exception when
- * evaluated.
- *
- * @param propName
- * property name
- */
- public final void setIf(String propName) {
- ifCond = propName;
- }
- /**
- * Specifies that this element should behave as if the content of the
- * element with the matching id attribute was inserted at this location. If
- * specified, no other attributes or child content should be specified,
- * other than "description".
- *
- */
- public void setRefid(Reference r) throws BuildException {
- if (!defineList.isEmpty()) {
- throw tooManyAttributes();
- }
- super.setRefid(r);
- }
- /**
- * A comma-separated list of preprocessor macros to undefine.
- *
- * @param undefList
- * comma-separated list of preprocessor macros
- * @throws BuildException
- * throw if defineset is a reference
- */
- public void setUndefine(CUtil.StringArrayBuilder undefList)
- throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- addDefines(undefList.getValue(), false);
- }
- /**
- * Set the property name for the 'unless' condition.
- *
- * If named property is set, the define will be ignored.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") of the behavior will throw an
- * exception when evaluated.
- *
- * @param propName
- * name of property
- */
- public final void setUnless(String propName) {
- unlessCond = propName;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/FlexLong.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/FlexLong.java deleted file mode 100644 index d95959f631..0000000000 --- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/FlexLong.java +++ /dev/null @@ -1,59 +0,0 @@ -/*
- *
- * Copyright 2002-2004 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.types;
-import java.lang.reflect.Method;
-
-/**
- * Helper class which can be used for Ant task attribute setter methods to
- * allow the build file to specify a long in either decimal, octal, or
- * hexadecimal format.
- * // FlexInteger author
- * @author Erik Hatcher
- * @see org.apache.tools.ant.types.FlexInteger
- */
-public class FlexLong {
- private Long value;
- /**
- * Constructor used by Ant's introspection mechanism for attribute
- * population
- */
- public FlexLong(String value) {
- // Java 1.1 did not support Long.decode().. so we call it by
- // reflection.
- try {
- Method m = Long.class
- .getMethod("decode", new Class[]{String.class});
- Object rc = m.invoke(null, new Object[]{value});
- this.value = (Long) rc;
- } catch (Exception e) {
- // Try it the old fashioned way, we must be on a 1.1 jre
- this.value = new Long(value);
- }
- }
- /**
- * Returns the decimal integer value
- */
- public long longValue() {
- return value.longValue();
- }
- /**
- * Overridden method to return the decimal value for display
- */
- public String toString() {
- return value.toString();
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/IncludePath.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/IncludePath.java deleted file mode 100644 index edcc42103c..0000000000 --- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/IncludePath.java +++ /dev/null @@ -1,38 +0,0 @@ -/*
- *
- * Copyright 2001-2004 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.types;
-import org.apache.tools.ant.Project;
-/**
- * An include path.
- *
- * Works like other paths in Ant with with the addition of "if" and "unless"
- * conditions.
- *
- * @author Curt Arnold
- */
-public class IncludePath extends ConditionalPath {
- public IncludePath(Project project) {
- super(project);
- }
- public IncludePath(Project p, String path) {
- super(p, path);
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LibrarySet.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LibrarySet.java deleted file mode 100644 index d522ccc36f..0000000000 --- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LibrarySet.java +++ /dev/null @@ -1,290 +0,0 @@ -/*
- *
- * Copyright 2001-2004 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.types;
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.FileVisitor;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.DirectoryScanner;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.ProjectComponent;
-import org.apache.tools.ant.types.FileSet;
-import org.apache.tools.ant.types.PatternSet;
-/**
- * A set of library names. Libraries can also be added to a link by specifying
- * them in a fileset.
- *
- * For most Unix-like compilers, libset will result in a series of -l and -L
- * linker arguments. For Windows compilers, the library names will be used to
- * locate the appropriate library files which will be added to the linkers
- * input file list as if they had been specified in a fileset.
- *
- * @author Mark A Russell <a
- * href="mailto:mark_russell@csgsystems.com">mark_russell@csg_systems.com
- * </a>
- * @author Adam Murdoch
- * @author Curt Arnold
- */
-public class LibrarySet extends ProjectComponent {
- private String dataset;
- private boolean explicitCaseSensitive;
- private String ifCond;
- private String[] libnames;
- private final FileSet set = new FileSet();
- private String unlessCond;
- private LibraryTypeEnum libraryType;
- public LibrarySet() {
- libnames = new String[0];
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
- /**
- * Gets the dataset. Used on OS390 if the libs are in a dataset.
- *
- * @return Returns a String
- */
- public String getDataset() {
- return dataset;
- }
- public File getDir(Project project) {
- return set.getDir(project);
- }
- protected FileSet getFileSet() {
- return set;
- }
- public String[] getLibs() {
- String[] retval = (String[]) libnames.clone();
- return retval;
- }
-
- /**
- * Gets preferred library type
- *
- * @return library type, may be null.
- */
- public LibraryTypeEnum getType() {
- return libraryType;
- }
- /**
- * Returns true if the define's if and unless conditions (if any) are
- * satisfied.
- */
- public boolean isActive(org.apache.tools.ant.Project p) {
- if (p == null) {
- throw new NullPointerException("p");
- }
- if (ifCond != null) {
- String ifValue = p.getProperty(ifCond);
- if (ifValue != null) {
- if (ifValue.equals("no") || ifValue.equals("false")) {
- throw new BuildException(
- "property "
- + ifCond
- + " used as if condition has value "
- + ifValue
- + " which suggests a misunderstanding of if attributes");
- }
- } else {
- return false;
- }
- }
- if (unlessCond != null) {
- String unlessValue = p.getProperty(unlessCond);
- if (unlessValue != null) {
- if (unlessValue.equals("no") || unlessValue.equals("false")) {
- throw new BuildException(
- "property "
- + unlessCond
- + " used as unless condition has value "
- + unlessValue
- + " which suggests a misunderstanding of unless attributes");
- }
- return false;
- }
- }
- if (libnames.length == 0) {
- p.log("libnames not specified or empty.", Project.MSG_WARN);
- return false;
- }
- return true;
- }
- /**
- * Sets case sensitivity of the file system. If not set, will default to
- * the linker's case sensitivity.
- *
- * @param isCaseSensitive
- * "true"|"on"|"yes" if file system is case sensitive,
- * "false"|"off"|"no" when not.
- */
- public void setCaseSensitive(boolean isCaseSensitive) {
- explicitCaseSensitive = true;
- set.setCaseSensitive(isCaseSensitive);
- }
- /**
- * Sets the dataset. Used on OS390 if the libs are in a dataset.
- *
- * @param dataset
- * The dataset to set
- */
- public void setDataset(String dataset) {
- this.dataset = dataset;
- }
- /**
- * Library directory.
- *
- * @param dir
- * library directory
- *
- */
- public void setDir(File dir) throws BuildException {
- set.setDir(dir);
- }
- /**
- * Sets the property name for the 'if' condition.
- *
- * The library set will be ignored unless the property is defined.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") will throw an exception when
- * evaluated.
- *
- * @param propName
- * property name
- */
- public void setIf(String propName) {
- ifCond = propName;
- }
- /**
- * Comma-separated list of library names without leading prefixes, such as
- * "lib", or extensions, such as ".so" or ".a".
- *
- */
- public void setLibs(CUtil.StringArrayBuilder libs) throws BuildException {
- libnames = libs.getValue();
- // If this is not active.. then it's ok if the lib names are invalid.
- // so we can do a: <libset if="x.lib" dir="." libs="${x.lib}"/>
- if (!isActive(getProject()))
- return;
- for (int i = 0; i < libnames.length; i++) {
- int lastDot = libnames[i].lastIndexOf('.');
- if (lastDot >= 0) {
- String extension = libnames[i].substring(lastDot);
- if (extension.equalsIgnoreCase(".lib")
- || extension.equalsIgnoreCase(".so")
- || extension.equalsIgnoreCase(".a")) {
- getProject().log(
- "Suspicious library name ending with \""
- + extension + "\": " + libnames[i], Project.MSG_DEBUG );
- }
- }
- if (libnames[i].length() >= 3
- && libnames[i].substring(0, 3).equalsIgnoreCase("lib")) {
- getProject().log(
- "Suspicious library name starting with \"lib\": "
- + libnames[i], Project.MSG_DEBUG);
- }
- }
- }
- public void setProject(Project project) {
- set.setProject(project);
- super.setProject(project);
- }
- /**
- * Set the property name for the 'unless' condition.
- *
- * If named property is set, the library set will be ignored.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") of the behavior will throw an
- * exception when evaluated.
- *
- * @param propName
- * name of property
- */
- public void setUnless(String propName) {
- unlessCond = propName;
- }
-
- /**
- * Sets the preferred library type. Supported values "shared", "static", and
- * "framework". "framework" is equivalent to "shared" on non-Darwin platforms.
- */
- public void setType(LibraryTypeEnum type) {
- this.libraryType = type;
- }
-
- public void visitLibraries(Project project, Linker linker, File[] libpath,
- FileVisitor visitor) throws BuildException {
- FileSet localSet = (FileSet) set.clone();
- //
- // unless explicitly set
- // will default to the linker case sensitivity
- //
- if (!explicitCaseSensitive) {
- boolean linkerCaseSensitive = linker.isCaseSensitive();
- localSet.setCaseSensitive(linkerCaseSensitive);
- }
- //
- // if there was a libs attribute then
- // add the corresponding patterns to the FileSet
- //
- if (libnames != null && libnames.length > 0) {
- String[] patterns = linker.getLibraryPatterns(libnames, libraryType);
- //
- // if no patterns, then linker does not support libraries
- //
- if (patterns.length > 0) {
- for (int i = 0; i < patterns.length; i++) {
- PatternSet.NameEntry entry = localSet.createInclude();
- entry.setName(patterns[i]);
- }
- //
- // if there was no specified directory then
- // run through the libpath backwards
- //
- if (localSet.getDir(project) == null) {
- //
- // scan libpath in reverse order
- // to give earlier entries priority
- //
- for (int j = libpath.length - 1; j >= 0; j--) {
- FileSet clone = (FileSet) localSet.clone();
- clone.setDir(libpath[j]);
- DirectoryScanner scanner = clone.getDirectoryScanner(project);
- File basedir = scanner.getBasedir();
- String[] files = scanner.getIncludedFiles();
- for (int k = 0; k < files.length; k++) {
- visitor.visit(basedir, files[k]);
- }
- }
- } else {
- DirectoryScanner scanner = localSet.getDirectoryScanner(project);
- File basedir = scanner.getBasedir();
- String[] files = scanner.getIncludedFiles();
- for (int k = 0; k < files.length; k++) {
- visitor.visit(basedir, files[k]);
- }
- }
- }
- }
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LibraryTypeEnum.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LibraryTypeEnum.java deleted file mode 100644 index 82d7947bf2..0000000000 --- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LibraryTypeEnum.java +++ /dev/null @@ -1,48 +0,0 @@ -/*
- *
- * Copyright 2004 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.types;
-import org.apache.tools.ant.types.EnumeratedAttribute;
-/**
- * Enumeration of library types for LibrarySet
- *
- * @author Curt Arnold
- *
- */
-public class LibraryTypeEnum extends EnumeratedAttribute {
- /**
- * Constructor
- *
- * Set by default to "shared"
- *
- * @see java.lang.Object#Object()
- */
- public LibraryTypeEnum() {
- setValue("shared");
- }
- /**
- * Gets list of acceptable values
- *
- * @see org.apache.tools.ant.types.EnumeratedAttribute#getValues()
- */
- public String[] getValues() {
- return new String[]{"shared", // prefer shared libraries
- "static", // prefer static libraries
- "framework" // framework libraries (Mac OS/X)
- // equiv to shared on other platforms
- };
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LinkerArgument.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LinkerArgument.java deleted file mode 100644 index 89bff1881b..0000000000 --- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LinkerArgument.java +++ /dev/null @@ -1,28 +0,0 @@ -/*
- *
- * Copyright 2001-2004 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.types;
-/**
- * A linker command line argument.
- */
-public class LinkerArgument extends CommandLineArgument {
- public LinkerArgument() {
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/SystemIncludePath.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/SystemIncludePath.java deleted file mode 100644 index be0dbd537a..0000000000 --- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/SystemIncludePath.java +++ /dev/null @@ -1,45 +0,0 @@ -/*
- *
- * Copyright 2001-2004 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.types;
-import org.apache.tools.ant.Project;
-/**
- * A system include path.
- *
- * Files located using a system include path will not participate in dependency
- * analysis.
- *
- * Standard include paths for a compiler should not be specified since these
- * should be determined from environment variables or configuration files by
- * the compiler adapter.
- *
- * Works like other paths in Ant with with the addition of "if" and "unless"
- * conditions.
- *
- * @author Curt Arnold
- */
-public class SystemIncludePath extends ConditionalPath {
- public SystemIncludePath(Project project) {
- super(project);
- }
- public SystemIncludePath(Project p, String path) {
- super(p, path);
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/SystemLibrarySet.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/SystemLibrarySet.java deleted file mode 100644 index 02d08c8ac8..0000000000 --- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/SystemLibrarySet.java +++ /dev/null @@ -1,37 +0,0 @@ -/*
- *
- * Copyright 2001-2004 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.types;
-/**
- * A set of system library names. Timestamp or location of system libraries are
- * not considered in dependency analysis.
- *
- * Libraries can also be added to a link by specifying them in a fileset.
- *
- * For most Unix-like compilers, syslibset will result in a series of -l and -L
- * linker arguments. For Windows compilers, the library names will be used to
- * locate the appropriate library files which will be added to the linkers
- * input file list as if they had been specified in a fileset.
- */
-public class SystemLibrarySet extends LibrarySet {
- public SystemLibrarySet() {
- super();
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/UndefineArgument.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/UndefineArgument.java deleted file mode 100644 index 2a18fca6d1..0000000000 --- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/UndefineArgument.java +++ /dev/null @@ -1,153 +0,0 @@ -/*
- *
- * Copyright 2001-2004 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.types;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-
-import org.apache.tools.ant.BuildException;
-/**
- * Preprocessor macro undefinition.
- *
- * @author Mark A Russell <a
- * href="mailto:mark_russell@csgsystems.com">mark_russell@csg_systems.com
- * </a>
- */
-public class UndefineArgument {
- /**
- * This method returns an array of UndefineArgument and DefineArgument's by
- * merging a base list with an override list.
- *
- * Any define in the base list with a name that appears in the override
- * list is suppressed. All entries in the override list are preserved
- *
- */
- public static UndefineArgument[] merge(UndefineArgument[] base,
- UndefineArgument[] override) {
- if (base.length == 0) {
- UndefineArgument[] overrideClone = (UndefineArgument[]) override
- .clone();
- return overrideClone;
- }
- if (override.length == 0) {
- UndefineArgument[] baseClone = (UndefineArgument[]) base.clone();
- return baseClone;
- }
- Vector unduplicated = new Vector(base.length);
- for (int i = 0; i < base.length; i++) {
- UndefineArgument current = base[i];
- String currentName = current.getName();
- boolean match = false;
- if (currentName == null) {
- match = true;
- } else {
- for (int j = 0; j < override.length; j++) {
- UndefineArgument over = override[j];
- String overName = over.getName();
- if (overName != null && overName.equals(currentName)) {
- match = true;
- break;
- }
- }
- }
- if (!match) {
- unduplicated.addElement(current);
- }
- }
- UndefineArgument[] combined = new UndefineArgument[unduplicated.size()
- + override.length];
- unduplicated.copyInto(combined);
- int offset = unduplicated.size();
- for (int i = 0; i < override.length; i++) {
- combined[offset + i] = override[i];
- }
- return combined;
- }
- private boolean define = false;
- private String ifCond;
- private String name;
- private String unlessCond;
- public UndefineArgument() {
- }
- protected UndefineArgument(boolean isDefine) {
- this.define = isDefine;
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
- /** Returns the name of the define */
- public final String getName() {
- return name;
- }
- /** Returns the value of the define */
- public String getValue() {
- return null;
- }
- /**
- * Returns true if the define's if and unless conditions (if any) are
- * satisfied.
- *
- * @exception BuildException
- * throws build exception if name is not set
- */
- public final boolean isActive(org.apache.tools.ant.Project p)
- throws BuildException {
- if (name == null) {
- throw new BuildException("<define> is missing name attribute");
- }
- return CUtil.isActive(p, ifCond, unlessCond);
- }
- /** Returns true if this is a define, false if an undefine. */
- public final boolean isDefine() {
- return define;
- }
- /**
- * Sets the property name for the 'if' condition.
- *
- * The define will be ignored unless the property is defined.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") will throw an exception when
- * evaluated.
- *
- * @param propName
- * property name
- */
- public final void setIf(String propName) {
- ifCond = propName;
- }
- /** Set the name attribute */
- public final void setName(String name) {
- this.name = name;
- }
- /**
- * Set the property name for the 'unless' condition.
- *
- * If named property is set, the define will be ignored.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") of the behavior will throw an
- * exception when evaluated.
- *
- * @param propName
- * name of property
- */
- public final void setUnless(String propName) {
- unlessCond = propName;
- }
-}
|