+++ /dev/null
-/*\r
- * \r
- * Copyright 2001-2005 The Ant-Contrib project\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package net.sf.antcontrib.cpptasks.devstudio;\r
-\r
-import java.io.File;\r
-import java.util.Vector;\r
-\r
-import net.sf.antcontrib.cpptasks.CUtil;\r
-import net.sf.antcontrib.cpptasks.compiler.CommandLineAssembler;\r
-import net.sf.antcontrib.cpptasks.compiler.LinkType;\r
-import net.sf.antcontrib.cpptasks.compiler.Linker;\r
-\r
-/**\r
- * Adaptor for Microsoft MASM\r
- * \r
- */\r
-public final class DevStudioAssembler extends CommandLineAssembler {\r
- private final static String[] sourceExtensions = new String[] { ".asm" };\r
-\r
- private final static String[] headerExtensions = new String[] { ".h",\r
- ".inc" };\r
-\r
- private final static String[] defaultflags = new String[] { "/nologo", "/c" };\r
-\r
- private static final DevStudioAssembler instance = new DevStudioAssembler(\r
- "ml", sourceExtensions, headerExtensions, false);\r
-\r
- /**\r
- * Gets masm adapter\r
- */\r
- public static DevStudioAssembler getInstance() {\r
- return instance;\r
- }\r
-\r
- /**\r
- * Private constructor. Use DevStudioAssembler.getInstance() to get\r
- * singleton instance of this class.\r
- */\r
- private DevStudioAssembler (String command, String[] sourceExtensions,\r
- String[] headerExtensions, boolean isLibtool) {\r
- super(command, null, sourceExtensions, headerExtensions, ".obj");\r
- }\r
-\r
- public void addImpliedArgs(Vector args, boolean debug, Boolean defaultflag) {\r
- if (defaultflag != null && defaultflag.booleanValue()) {\r
- for (int i = 0; i < defaultflags.length; i++) {\r
- args.addElement(defaultflags[i]);\r
- }\r
- }\r
- if (debug) {\r
- args.addElement("Zi");\r
- }\r
- }\r
-\r
- public int getMaximumCommandLength() {\r
- return Integer.MAX_VALUE;\r
- }\r
-\r
- public Linker getLinker(LinkType linkType) {\r
- return DevStudioLinker.getInstance().getLinker(linkType);\r
- }\r
-\r
- protected File[] getEnvironmentIncludePath() {\r
- return CUtil.getPathFromEnvironment("INCLUDE", ";");\r
- }\r
-\r
- protected String getIncludeDirSwitch(String includeDir) {\r
- return "/I" + includeDir.replace('/', '\\');\r
- }\r
-}\r