Changeset 1197
- Timestamp:
- 06/25/08 03:25:26 (2 months ago)
- Files:
-
- trunk/descent.building/src/descent/building/BuilderLaunchDelegate.java (modified) (2 diffs)
- trunk/descent.building/src/descent/building/BuilderRegistry.java (modified) (1 diff)
- trunk/descent.building/src/descent/building/CompilerInterfaceRegistry.java (modified) (2 diffs)
- trunk/descent.building/src/descent/building/IDescentBuilderConstants.java (modified) (26 diffs)
- trunk/descent.building/src/descent/building/compiler/AbstractBuildCommand.java (deleted)
- trunk/descent.building/src/descent/building/compiler/AbstractCompileCommand.java (deleted)
- trunk/descent.building/src/descent/building/compiler/AbstractExecutableCommand.java (deleted)
- trunk/descent.building/src/descent/building/compiler/AbstractLinkCommand.java (deleted)
- trunk/descent.building/src/descent/building/compiler/BooleanOption.java (deleted)
- trunk/descent.building/src/descent/building/compiler/BuildError.java (deleted)
- trunk/descent.building/src/descent/building/compiler/BuildResponse.java (deleted)
- trunk/descent.building/src/descent/building/compiler/CompilerOption.java (deleted)
- trunk/descent.building/src/descent/building/compiler/EnumOption.java (deleted)
- trunk/descent.building/src/descent/building/compiler/FileOption.java (deleted)
- trunk/descent.building/src/descent/building/compiler/IBuildCommand.java (deleted)
- trunk/descent.building/src/descent/building/compiler/IBuildManager.java (added)
- trunk/descent.building/src/descent/building/compiler/ICompileCommand.java (deleted)
- trunk/descent.building/src/descent/building/compiler/ICompileManager.java (added)
- trunk/descent.building/src/descent/building/compiler/ICompilerInterface.java (modified) (3 diffs)
- trunk/descent.building/src/descent/building/compiler/IExecutableCommand.java (deleted)
- trunk/descent.building/src/descent/building/compiler/ILinkCommand.java (deleted)
- trunk/descent.building/src/descent/building/compiler/IResponseInterpreter.java (modified) (2 diffs)
- trunk/descent.building/src/descent/building/compiler/IValidatableOption.java (deleted)
- trunk/descent.building/src/descent/building/compiler/StringOption.java (deleted)
- trunk/descent.building/src/descent/building/compiler/ui (added)
- trunk/descent.building/src/descent/building/compiler/ui/BooleanOption.java (added)
- trunk/descent.building/src/descent/building/compiler/ui/CompilerOption.java (added)
- trunk/descent.building/src/descent/building/compiler/ui/EnumOption.java (added)
- trunk/descent.building/src/descent/building/compiler/ui/FileOption.java (added)
- trunk/descent.building/src/descent/building/compiler/ui/IValidatableOption.java (added)
- trunk/descent.building/src/descent/building/compiler/ui/StringOption.java (added)
- trunk/descent.building/src/descent/internal/building/BuilderUtil.java (modified) (6 diffs)
- trunk/descent.building/src/descent/internal/building/BuildingPlugin.java (modified) (1 diff)
- trunk/descent.building/src/descent/internal/building/compiler/DmdCompilerInterface.java (modified) (4 diffs)
- trunk/descent.building/src/descent/internal/building/compiler/DmdfeCompilerInterface.java (modified) (1 diff)
- trunk/descent.building/src/descent/internal/building/compiler/GdcCompilerInterface.java (modified) (1 diff)
- trunk/descent.building/src/descent/internal/building/compiler/IDmdCompilerConstants.java (modified) (1 diff)
- trunk/descent.building/src/descent/internal/building/compiler/IDmdfeCompilerConstants.java (modified) (1 diff)
- trunk/descent.building/src/descent/internal/building/compiler/IGdcCompilerConstants.java (modified) (1 diff)
- trunk/descent.building/src/descent/internal/building/compiler/ui/CompilerUIMessages.java (added)
- trunk/descent.building/src/descent/internal/building/compiler/ui/CompilerUIMessages.properties (added)
- trunk/descent.building/src/descent/internal/building/compiler/ui/CompilerUIOptions.java (modified) (11 diffs)
- trunk/descent.building/src/descent/internal/building/compiler/ui/DmdUIOptions.java (modified) (1 diff)
- trunk/descent.building/src/descent/internal/building/compiler/ui/DmdfeUIOptions.java (modified) (9 diffs)
- trunk/descent.building/src/descent/internal/building/compiler/ui/GdcUIOptions.java (modified) (7 diffs)
- trunk/descent.building/src/descent/internal/building/debuild/BuildRequest.java (modified) (4 diffs)
- trunk/descent.building/src/descent/internal/building/debuild/CompileOptions.java (deleted)
- trunk/descent.building/src/descent/internal/building/debuild/DebuildBuilder.java (modified) (8 diffs)
- trunk/descent.building/src/descent/internal/building/debuild/DebuildMessages.java (added)
- trunk/descent.building/src/descent/internal/building/debuild/DebuildMessages.properties (added)
- trunk/descent.building/src/descent/internal/building/debuild/DebuildOutputCleaner.java (deleted)
- trunk/descent.building/src/descent/internal/building/debuild/ErrorReporter.java (modified) (2 diffs)
- trunk/descent.building/src/descent/internal/building/debuild/GroupedCompile.java (deleted)
- trunk/descent.building/src/descent/internal/building/debuild/ObjectFile.java (deleted)
- trunk/descent.building/src/descent/internal/building/debuild/RecursiveDependancyCollector.java (deleted)
- trunk/descent.building/src/descent/internal/building/ui/AbstractBuilderTab.java (modified) (5 diffs)
- trunk/descent.building/src/descent/internal/building/ui/BuilderUIMessages.java (added)
- trunk/descent.building/src/descent/internal/building/ui/BuilderUIMessages.properties (added)
- trunk/descent.building/src/descent/internal/building/ui/CompilerTab.java (modified) (24 diffs)
- trunk/descent.building/src/descent/internal/building/ui/DebuildTabGroup.java (modified) (1 diff)
- trunk/descent.building/src/descent/internal/building/ui/GeneralTab.java (modified) (32 diffs)
- trunk/descent.building/src/descent/internal/building/ui/VersionTab.java (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/descent.building/src/descent/building/BuilderLaunchDelegate.java
r1174 r1197 9 9 import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; 10 10 11 import descent.internal.building.BuildingPlugin;; 11 import descent.internal.building.BuildingPlugin; 12 import descent.internal.building.debuild.DebuildMessages; 12 13 13 14 /** … … 28 29 IDBuilderType builderType = BuilderRegistry.getInstance().getBuilderForLaunchConfigurationType(configTypeId); 29 30 if(null == builderType) 30 throw error( "Could not find builder for launch configuration type " + configTypeId);31 throw error(String.format(DebuildMessages.BuilderLaunchDelegate_error_could_not_find_builder, configTypeId)); 31 32 32 33 IDBuilder builder = builderType.getBuilder(); 33 34 if(null == builder) 34 throw error( "Could not create builder for builder type " + builderType.getIdentifier());35 throw error(String.format(DebuildMessages.BuilderLaunchDelegate_error_could_not_instantiate_builder, builderType.getIdentifier())); 35 36 36 37 builder.build(config, pm); trunk/descent.building/src/descent/building/BuilderRegistry.java
r1187 r1197 22 22 { 23 23 // Attributes defined in the schema 24 private static final String ATTR_ID = "id"; 25 private static final String ATTR_CLASS = "class"; 26 private static final String ATTR_LAUNCH_CONFIGURATION_TYPE = "launchConfigurationType"; 24 private static final String ATTR_ID = "id"; //$NON-NLS-1$ 25 private static final String ATTR_CLASS = "class"; //$NON-NLS-1$ 26 private static final String ATTR_LAUNCH_CONFIGURATION_TYPE = "launchConfigurationType"; //$NON-NLS-1$ 27 27 28 28 private final IConfigurationElement info; trunk/descent.building/src/descent/building/CompilerInterfaceRegistry.java
r1187 r1197 24 24 implements ICompilerInterfaceType 25 25 { 26 private static final String ATTR_ID = "id"; 27 private static final String ATTR_CLASS = "class"; 28 private static final String ATTR_VM_INSTALL_TYPE = "vmInstallType"; 26 private static final String ATTR_ID = "id"; //$NON-NLS-1$ 27 private static final String ATTR_CLASS = "class"; //$NON-NLS-1$ 28 private static final String ATTR_VM_INSTALL_TYPE = "vmInstallType"; //$NON-NLS-1$ 29 29 30 30 private final IConfigurationElement info; … … 99 99 } 100 100 101 private void loadCompilerInterfaces()101 private synchronized void loadCompilerInterfaces() 102 102 { 103 103 if(null != compilerInterfaces) trunk/descent.building/src/descent/building/IDescentBuilderConstants.java
r1184 r1197 23 23 * The ID of the default descent builder. 24 24 */ 25 public static final String ID_DESCENT_BUILDER = "descent.building.builders.debuildBuilder"; 25 public static final String ID_DESCENT_BUILDER = "descent.building.builders.debuildBuilder"; //$NON-NLS-1$ 26 26 27 27 /** … … 30 30 * only. 31 31 */ 32 public static final String ID_LAUNCH_CONFIGURATION_TYPE = "descent.building.builders.debuild"; 32 public static final String ID_LAUNCH_CONFIGURATION_TYPE = "descent.building.builders.debuild"; //$NON-NLS-1$ 33 33 34 34 //-------------------------------------------------------------------------- … … 42 42 * Type: String 43 43 */ 44 public static final String ATTR_PROJECT_NAME = "descent.building.debuild.project_name"; 44 public static final String ATTR_PROJECT_NAME = "descent.building.debuild.project_name"; //$NON-NLS-1$ 45 45 46 46 /** … … 53 53 * Type: List<String> 54 54 */ 55 public static final String ATTR_MODULES_LIST = "descent.building.debuild.modules_list"; 55 public static final String ATTR_MODULES_LIST = "descent.building.debuild.modules_list"; //$NON-NLS-1$ 56 56 57 57 /** … … 62 62 * Type: String 63 63 */ 64 public static final String ATTR_COMPILER_TYPE_ID = "descent.building.debuild.compiler_type_id"; 64 public static final String ATTR_COMPILER_TYPE_ID = "descent.building.debuild.compiler_type_id"; //$NON-NLS-1$ 65 65 66 66 /** … … 70 70 * Type: String 71 71 */ 72 public static final String ATTR_COMPILER_ID = "descent.building.debuild.compiler_id"; 72 public static final String ATTR_COMPILER_ID = "descent.building.debuild.compiler_id"; //$NON-NLS-1$ 73 73 74 74 /** … … 79 79 * Type: String 80 80 */ 81 public static final String ATTR_OUTPUT_TYPE = "descent.building.debuild.output_type"; 81 public static final String ATTR_OUTPUT_TYPE = "descent.building.debuild.output_type"; //$NON-NLS-1$ 82 82 83 83 /** … … 86 86 * Type: String 87 87 */ 88 public static final String ATTR_OUTPUT_FILE = "descent.building.debuild.output_file"; 88 public static final String ATTR_OUTPUT_FILE = "descent.building.debuild.output_file"; //$NON-NLS-1$ 89 89 90 90 /** … … 93 93 * Type: String of "true" or "false" 94 94 */ 95 public static final String ATTR_ADD_UNITTESTS = "descent.building.debuild.add_unittests"; 95 public static final String ATTR_ADD_UNITTESTS = "descent.building.debuild.add_unittests"; //$NON-NLS-1$ 96 96 97 97 /** … … 109 109 * Type: String of "true" or "false" 110 110 */ 111 public static final String ATTR_DISABLE_ASSERTS = "descent.building.debuild.disable_asserts"; 111 public static final String ATTR_DISABLE_ASSERTS = "descent.building.debuild.disable_asserts"; //$NON-NLS-1$ 112 112 113 113 /** … … 120 120 * Type: String of "true" or "false" 121 121 */ 122 public static final String ATTR_ADD_DEBUG_INFO = "descent.building.debuild.add_debug_info"; 122 public static final String ATTR_ADD_DEBUG_INFO = "descent.building.debuild.add_debug_info"; //$NON-NLS-1$ 123 123 124 124 /** … … 130 130 * Type: String of "true" or "false" 131 131 */ 132 public static final String ATTR_INSTRUMENT_FOR_COVERAGE = "descent.building.debuild.instrument_for_coverage"; 132 public static final String ATTR_INSTRUMENT_FOR_COVERAGE = "descent.building.debuild.instrument_for_coverage"; //$NON-NLS-1$ 133 133 134 134 /** … … 141 141 * Type: String of "true" or "false" 142 142 */ 143 public static final String ATTR_INSTRUMENT_FOR_PROFILE = "descent.building.debuild.instrument_for_profile"; 143 public static final String ATTR_INSTRUMENT_FOR_PROFILE = "descent.building.debuild.instrument_for_profile"; //$NON-NLS-1$ 144 144 145 145 /** … … 149 149 * Type: String 150 150 */ 151 public static final String ATTR_ADDITIONAL_COMPILER_ARGS = "descent.building.debuild.compiler_args"; 151 public static final String ATTR_ADDITIONAL_COMPILER_ARGS = "descent.building.debuild.compiler_args"; //$NON-NLS-1$ 152 152 153 153 /** … … 157 157 * Type: String 158 158 */ 159 public static final String ATTR_ADDITIONAL_LINKER_ARGS = "descent.building.debuild.linker_args"; 159 public static final String ATTR_ADDITIONAL_LINKER_ARGS = "descent.building.debuild.linker_args"; //$NON-NLS-1$ 160 160 161 161 /** … … 169 169 * Type: String 170 170 */ 171 public static final String ATTR_VERSION_SOURCE = "descent.building.debuild.version_source"; 171 public static final String ATTR_VERSION_SOURCE = "descent.building.debuild.version_source"; //$NON-NLS-1$ 172 172 173 173 /** … … 177 177 * Type: Boolean 178 178 */ 179 public static final String ATTR_DEBUG_MODE = "descent.building.debuild.debug_mode"; 179 public static final String ATTR_DEBUG_MODE = "descent.building.debuild.debug_mode"; //$NON-NLS-1$ 180 180 181 181 /** … … 186 186 * Type: String 187 187 */ 188 public static final String ATTR_VERSION_LEVEL = "descent.building.debuild.version_level"; 188 public static final String ATTR_VERSION_LEVEL = "descent.building.debuild.version_level"; //$NON-NLS-1$ 189 189 190 190 /** … … 195 195 * Type: String 196 196 */ 197 public static final String ATTR_DEBUG_LEVEL = "descent.building.debuild.debug_level"; 197 public static final String ATTR_DEBUG_LEVEL = "descent.building.debuild.debug_level"; //$NON-NLS-1$ 198 198 199 199 /** … … 203 203 * Type: List<String> 204 204 */ 205 public static final String ATTR_VERSION_IDENTS = "descent.building.debuild.version_idents"; 205 public static final String ATTR_VERSION_IDENTS = "descent.building.debuild.version_idents"; //$NON-NLS-1$ 206 206 207 207 /** … … 211 211 * Type: List<String> 212 212 */ 213 public static final String ATTR_DEBUG_IDENTS = "descent.building.debuild.debug_idents"; 213 public static final String ATTR_DEBUG_IDENTS = "descent.building.debuild.debug_idents"; //$NON-NLS-1$ 214 214 215 215 //-------------------------------------------------------------------------- … … 220 220 * should be an executable file. 221 221 */ 222 public static final String OUTPUT_TYPE_EXECUTABLE = "executable"; 222 public static final String OUTPUT_TYPE_EXECUTABLE = "executable"; //$NON-NLS-1$ 223 223 224 224 /** … … 226 226 * should be a static library (.lib or .a) 227 227 */ 228 public static final String OUTPUT_TYPE_STATIC_LIBRARY = "static_library"; 228 public static final String OUTPUT_TYPE_STATIC_LIBRARY = "static_library"; //$NON-NLS-1$ 229 229 230 230 //-------------------------------------------------------------------------- … … 236 236 * launch configuration. 237 237 */ 238 public static final String SOURCE_SELECTED_PROJECT = "selected_project"; 238 public static final String SOURCE_SELECTED_PROJECT = "selected_project"; //$NON-NLS-1$ 239 239 240 240 /** … … 242 242 * be taken from the workspace active project and the launch configuration. 243 243 */ 244 public static final String SOURCE_ACTIVE_PROJECT = "active_project"; 244 public static final String SOURCE_ACTIVE_PROJECT = "active_project"; //$NON-NLS-1$ 245 245 246 246 /** … … 248 248 * only be taken from the launch configuration. 249 249 */ 250 public static final String SOURCE_LAUNCH_CONFIG = "launch_configuration"; 250 public static final String SOURCE_LAUNCH_CONFIG = "launch_configuration"; //$NON-NLS-1$ 251 251 } trunk/descent.building/src/descent/building/compiler/ICompilerInterface.java
r1177 r1197 1 1 package descent.building.compiler; 2 3 import descent.building.compiler.ui.CompilerOption; 4 2 5 3 6 /** … … 6 9 * for that particular compiler, how to parse the output, etc. Generally, 7 10 * implementations of this will be a singleton, since only one compiler of a 8 * given type exists. 11 * given type exists, and only a single instance of this will be constructed by 12 * the building plugin. 9 13 * 10 * Clients may discovr the compiler interface for a given compiler by calling 11 * {@link IVMInstall#getCompilerInterface()} 14 * To get the shared instances of compiler interfaces, use the 15 * {@link descent.building.CompilerInterfaceRegistry} class. 16 * 17 * TODO document how it is used 12 18 * 13 19 * @author Robert Fraser … … 15 21 public interface ICompilerInterface 16 22 { 17 /**18 * Creates a new compile command of the correct type for this compiler.19 */20 public ICompileCommand createCompileCommand();21 22 /**23 * Creates a new link command of the correct type for this compiler.24 */25 public ILinkCommand createLinkCommand();26 27 /**28 * Creates a new response interpreter of the correct type for29 * this compiler.30 */31 public IResponseInterpreter createCompileResponseInterpreter();32 33 /**34 * Creates a new response interpreter of the correct type for this35 * linker.36 */37 public IResponseInterpreter createLinkResponseInterpreter();38 39 23 /** 40 24 * Gets the compiler options which should be presented in the UI. trunk/descent.building/src/descent/building/compiler/IResponseInterpreter.java
r1174 r1197 3 3 /** 4 4 * A class that accepts incoming compiler messages line-by-line after the 5 * execution of a compiler and returns results about them after the compiler 6 * has completd execution. 7 * 8 * The builder will create a single response interpreter per execution of the 9 * compiler or linker, which should process each line rcieved in its 10 * {@link #interpret(String)} method. {@link #getResponse()} should be used 11 * to get the response, and is garunteed to be called after all input is sent. 5 * execution of a compiler. As messages come in, it is the duty of this class 6 * to make appropriate callbacks to the {@link IBuildManager} to, for example, 7 * report errors or other output. 12 8 * 13 9 * @author Robert Fraser … … 28 24 */ 29 25 public void interpretError(String line); 30 31 /**32 * Gets the result of the build command33 */34 public BuildResponse getResponse();35 26 } trunk/descent.building/src/descent/internal/building/BuilderUtil.java
r1187 r1197 1 1 package descent.internal.building; 2 2 3 import java.util.ArrayList; 3 4 import java.util.Arrays; 5 import java.util.List; 6 import java.util.Map; 7 import java.util.Set; 4 8 5 9 import org.eclipse.core.resources.IResource; 6 10 import org.eclipse.core.resources.ResourcesPlugin; 11 import org.eclipse.core.runtime.CoreException; 7 12 import org.eclipse.core.runtime.IPath; 13 import org.eclipse.debug.core.ILaunchConfiguration; 14 15 import descent.building.CompilerInterfaceRegistry; 16 import descent.building.ICompilerInterfaceType; 17 import descent.building.compiler.ICompilerInterface; 18 import descent.core.IJavaProject; 19 import descent.launching.IVMInstall; 20 import descent.launching.JavaRuntime; 8 21 9 22 /** … … 12 25 * @author Robert Fraser 13 26 */ 27 @SuppressWarnings("unchecked") 14 28 public class BuilderUtil 15 29 { … … 27 41 static 28 42 { 29 IS_WINDOWS = System.getProperty("os.name").startsWith("Windows"); 43 IS_WINDOWS = System.getProperty("os.name").startsWith("Windows"); //$NON-NLS-1$ //$NON-NLS-2$ 30 44 31 45 if(IS_WINDOWS) 32 46 { 33 EXTENSION_EXECUTABLE = ".exe"; 34 EXTENSION_STATIC_LIBRARY = ".lib"; 35 EXTENSION_DYNAMIC_LIBRARY = ".dll"; 36 EXTENSION_DDL = ".ddl"; 37 EXTENSION_OBJECT_FILE = ".obj"; 47 EXTENSION_EXECUTABLE = ".exe"; //$NON-NLS-1$ 48 EXTENSION_STATIC_LIBRARY = ".lib"; //$NON-NLS-1$ 49 EXTENSION_DYNAMIC_LIBRARY = ".dll"; //$NON-NLS-1$ 50 EXTENSION_DDL = ".ddl"; //$NON-NLS-1$ 51 EXTENSION_OBJECT_FILE = ".obj"; //$NON-NLS-1$ 38 52 } 39 53 else 40 54 { 41 EXTENSION_EXECUTABLE = ""; 42 EXTENSION_STATIC_LIBRARY = ".a"; 43 EXTENSION_DYNAMIC_LIBRARY = ".so"; 44 EXTENSION_DDL = ".ddl"; 45 EXTENSION_OBJECT_FILE = ".o"; 55 EXTENSION_EXECUTABLE = ""; //$NON-NLS-1$ 56 EXTENSION_STATIC_LIBRARY = ".a"; //$NON-NLS-1$ 57 EXTENSION_DYNAMIC_LIBRARY = ".so"; //$NON-NLS-1$ 58 EXTENSION_DDL = ".ddl"; //$NON-NLS-1$ 59 EXTENSION_OBJECT_FILE = ".o"; //$NON-NLS-1$ 46 60 } 47 61 } … … 54 68 public static final String[] PREDEFINED_VERSIONS = new String[] 55 69 { 56 "BigEndian", 57 "D_Coverage", 58 "D_InlineAsm", 59 "D_InlineAsm_X86", 60 "D_Version2", 61 "DigitalMars", 62 "LittleEndian", 63 "Win32", 64 "Win64", 65 "Windows", 66 "X86", 67 "X86_64", 68 "all", 69 "linux", 70 "none", 71 "unittest", 70 "BigEndian", //$NON-NLS-1$ 71 "D_Coverage", //$NON-NLS-1$ 72 "D_InlineAsm", //$NON-NLS-1$ 73 "D_InlineAsm_X86", //$NON-NLS-1$ 74 "D_Version2", //$NON-NLS-1$ 75 "DigitalMars", //$NON-NLS-1$ 76 "LittleEndian", //$NON-NLS-1$ 77 "Win32", //$NON-NLS-1$ 78 "Win64", //$NON-NLS-1$ 79 "Windows", //$NON-NLS-1$ 80 "X86", //$NON-NLS-1$ 81 "X86_64", //$NON-NLS-1$ 82 "all", //$NON-NLS-1$ 83 "linux", //$NON-NLS-1$ 84 "none", //$NON-NLS-1$ 85 "unittest", //$NON-NLS-1$ 72 86 }; 73 87 … … 113 127 } 114 128 129 private static final CompilerInterfaceRegistry registry = 130 CompilerInterfaceRegistry.getInstance(); 131 132 /** 133 * Gets the compielr interface for the given compiler. 134 * 135 * @param compiler the compiler to get the interface for 136 * @return the interface to the compiler or null if not such compiler 137 * interface could be found 138 */ 139 public static final ICompilerInterface getCompilerInterface(IVMInstall compiler) 140 { 141 if(null == compiler) 142 return null; 143 144 try 145 { 146 ICompilerInterfaceType type = registry. 147 getCompilerInterfaceByVMInstallType(compiler. 148 getVMInstallType()); 149 return null != type ? type.getCompilerInterface() : null; 150 } 151 catch(CoreException e) 152 { 153 BuildingPlugin.log(e); 154 return null; 155 } 156 } 157 115 158 private static boolean isValidIdChar(char c) 116 159 { … … 122 165 c >= 128; // Assume anything in unicode is OK 123 166 } 167 168 /** 169 * An empty list to use as a default for list-typed constants (there's no 170 * similar constant here for the empty string since the empty string is 171 * internalized by the JVM). 172 */ 173 public static final List EMPTY_LIST = new ArrayList(0); 174 175 /** 176 * An empty array object to be used by content providers for elements 177 * that are barren and childless. 178 */ 179 public static final Object[] EMPTY_ARRAY = new Object[] {}; 180 181 //-------------------------------------------------------------------------- 182 // Wrappers for ILaunchConfiguration methods which hide the exceptions, 183 // since the exception will never be thrown 184 185 public static String getAttribute(ILaunchConfiguration config, String id, 186 String defaultValue) 187 { 188 String value = defaultValue; 189 try 190 { 191 value = config.getAttribute(id, defaultValue); 192 } 193 catch(CoreException e) { } 194 return value; 195 } 196 197 public static boolean getAttribute(ILaunchConfiguration config, String id, 198 boolean defaultValue) 199 { 200 boolean value = defaultValue; 201 try 202 { 203 value = config.getAttribute(id, defaultValue); 204 } 205 catch(CoreException e) { } 206 return value; 207 } 208 209 public static int getAttribute(ILaunchConfiguration config, String id, 210 int defaultValue) 211 { 212 int value = defaultValue; 213 try 214 { 215 value = config.getAttribute(id, defaultValue); 216 } 217 catch(CoreException e) { } 218 return value; 219 } 220 221 public static List getAttribute(ILaunchConfiguration config, String id, 222 List defaultValue) 223 { 224 List value = defaultValue; 225 try 226 { 227 value = config.getAttribute(id, defaultValue); 228 } 229 catch(CoreException e) { } 230 return value; 231 } 232 233 public static Map getAttribute(ILaunchConfiguration config, String id, 234 Map defaultValue) 235 { 236 Map value = defaultValue; 237 try 238 { 239 value = config.getAttribute(id, defaultValue); 240 } 241 catch(CoreException e) { } 242 return value; 243 } 244 245 public static Set getAttribute(ILaunchConfiguration config, String id, 246 Set defaultValue) 247 { 248 Set value = defaultValue; 249 try 250 { 251 value = config.getAttribute(id, defaultValue); 252 } 253 catch(CoreException e) { } 254 return value; 255 } 256 257 public static IVMInstall getVMInstall(IJavaProject project) 258 throws CoreException 259 { 260 if(null == project) 261 return null; 262 return JavaRuntime.getVMInstall(project); 263 } 124 264 } trunk/descent.building/src/descent/internal/building/BuildingPlugin.java
r1187 r1197 22 22 * The plug-in ID 23 23 */ 24 public static final String PLUGIN_ID = "descent.building"; 24 public static final String PLUGIN_ID = "descent.building"; //$NON-NLS-1$ 25 25 26 26 /** 27 27 * Identifier for 'dBuilders' extension point 28 28 */ 29 public static final String ID_EXTENSION_POINT_D_BUILDERS = "dBuilders"; 29 public static final String ID_EXTENSION_POINT_D_BUILDERS = "dBuilders"; //$NON-NLS-1$ 30 30 31 31 /** 32 32 * Identifier for the 'compilerInterfaces' extension point 33 33 */ 34 public static final String ID_EXTENSION_POINT_COMPILER_INTERFACES = "compilerInterfaces"; 34 public static final String ID_EXTENSION_POINT_COMPILER_INTERFACES = "compilerInterfaces"; //$NON-NLS-1$ 35 35 36 36 /** 37 37 * The build group identifier 38 38 */ 39 public static final String ID_BUILD_GROUP = "descent.building.builders"; 39 public static final String ID_BUILD_GROUP = "descent.building.builders"; //$NON-NLS-1$ 40 40 41 41 /** trunk/descent.building/src/descent/internal/building/compiler/DmdCompilerInterface.java
r1187 r1197 1 1 package descent.internal.building.compiler; 2 2 3 import java.io.File;4 3 import java.util.ArrayList; 5 4 import java.util.List; 6 5 import java.util.regex.Pattern; 7 6 8 import descent.building.compiler.AbstractCompileCommand;9 import descent.building.compiler.AbstractLinkCommand;10 import descent.building.compiler.CompilerOption;11 import descent.building.compiler.ICompileCommand;12 import descent.building.compiler.ILinkCommand;13 7 import descent.building.compiler.IResponseInterpreter; 14 import descent.building.compiler. BuildResponse;8 import descent.building.compiler.ui.CompilerOption; 15 9 16 10 import static descent.internal.building.compiler.ui.DmdUIOptions.*; … … 21 15 22 16 //-------------------------------------------------------------------------- 23 // Compile Command24 protected static class DmdCompileCommand extends AbstractCompileCommand25 {26 DmdCompileCommand()27 {28 setDefaults();29 }30 31 /* (non-Javadoc)32 * @see descent.launching.compiler.IExecutableCommand#getCommand()33 */34 public final String getCommand()35 {36 StringBuffer buf = new StringBuffer();37 38 // Add the compler executable39 buf.append(executableFile.getPath());40 buf.append(" ");41 42 // Set options43 if(compileOnly)44 {45 buf.append("-c ");46 }47 if(null != outputDirectory)48 {49 buf.append("-od");50 buf.append(outputDirectory.getPath());51 buf.append(" ");52 }53 if(null != outputFilename)54 {55 buf.append("-of");56 buf.append(outputFilename.getPath());57 buf.append(" ");58 }59 if(null != importPaths)60 {61 for(File path : importPaths)62 {63 buf.append("-I");64 buf.append(path.getPath());65 buf.append(" ");66 }67 }68 if(null != importExpPaths)69 {70 for(File path : importExpPaths)71 {72 buf.append("-J");73 buf.append(path.getPath());74 buf.append(" ");75 }76 }77 if(allowDeprecated)78 {79 buf.append("-d ");80 }81 if(showWarnings)82 {83 buf.append("-w ");84 }85 if(addDebugInfo)86 {87 buf.append("-g ");88 }89 if(!addAssertsAndContracts)90 {91 buf.append("-release ");92 }93 if(addUnittests)94 {95 buf.append("-unittest ");96 }97 if(insertDebugCode)98 {99 buf.append("-debug ");100 }101 if(null != debugLevel)102 {103 buf.append("-debug=");104 buf.append(debugLevel.toString());105 buf.append(" ");106 }107 if(null != debugIdents)108 {109 for(String ident : debugIdents)110 {111 buf.append("-debug=");112 buf.append(ident);113 buf.append(" ");114 }115 }116 if(null != versionLevel)117 {118 buf.append("-version=");119 buf.append(versionLevel.toString());120 buf.append(" ");121 }122 if(null != versionIdents)123 {124 for(String ident : versionIdents)125 {126 buf.append("-version=");127 buf.append(ident);128 buf.append(" ");129 }130 }131 if(inlineFunctions)132 {133 buf.append("-inline ");134 }135 if(optimizeCode)136 {137 buf.append("-o ");138 }139 if(instrumentForCoverage)140 {141 buf.append("-cov ");142 }143 if(instrumentForProfile)144 {145 buf.append("-profile ");146 }147 148 // Add the files to compile149 for(File path : files)150 {151 buf.append(path.getPath());152 buf.append(" ");153 }154 155 // TODO if the buffer is over a certain length, use a response file156 // instead157 return buf.toString().trim();158 }159 }160 161 //--------------------------------------------------------------------------162 // Link Command163 protected static class DmdLinkCommand extends AbstractLinkCommand164 {165 DmdLinkCommand()166 {167 setDefaults();168 }169 170 /* (non-Javadoc)171 * @see descent.launching.compiler.IExecutableCommand#getCommand()172 */173 public String getCommand()174  
