Changeset 1187
- Timestamp:
- 06/10/08 06:00:42 (3 months ago)
- Files:
-
- trunk/descent.building/plugin.xml (modified) (2 diffs)
- trunk/descent.building/schema/compilerInterfaces.exsd (added)
- trunk/descent.building/src/descent/building/BuilderRegistry.java (modified) (1 diff)
- trunk/descent.building/src/descent/building/CompilerInterfaceRegistry.java (added)
- trunk/descent.building/src/descent/building/ICompilerInterfaceType.java (added)
- trunk/descent.building/src/descent/building/IDBuilderType.java (modified) (1 diff)
- trunk/descent.building/src/descent/building/compiler/BooleanOption.java (modified) (2 diffs)
- trunk/descent.building/src/descent/building/compiler/CompilerOption.java (modified) (3 diffs)
- trunk/descent.building/src/descent/building/compiler/EnumOption.java (modified) (2 diffs)
- trunk/descent.building/src/descent/building/compiler/FileOption.java (added)
- trunk/descent.building/src/descent/building/compiler/StringOption.java (modified) (1 diff)
- trunk/descent.building/src/descent/internal/building/BuilderUtil.java (modified) (3 diffs)
- trunk/descent.building/src/descent/internal/building/BuildingPlugin.java (modified) (1 diff)
- trunk/descent.building/src/descent/internal/building/compiler/DmdCompilerInterface.java (modified) (8 diffs)
- trunk/descent.building/src/descent/internal/building/compiler/DmdfeCompilerInterface.java (added)
- trunk/descent.building/src/descent/internal/building/compiler/GdcCompilerInterface.java (added)
- trunk/descent.building/src/descent/internal/building/compiler/ui/CompilerUIOptions.java (modified) (2 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 (added)
- trunk/descent.building/src/descent/internal/building/compiler/ui/GdcUIOptions.java (modified) (3 diffs)
- trunk/descent.building/src/descent/internal/building/ui/CompilerTab.java (modified) (18 diffs)
- trunk/descent.building/src/descent/internal/building/ui/GeneralTab.java (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/descent.building/plugin.xml
r1174 r1187 3 3 <plugin> 4 4 <extension-point id="dBuilders" name="%dBuilders" schema="schema/dBuilders.exsd"/> 5 <extension-point id="compilerInterfaces" name="%compilerInterfaces" schema="schema/compilerInterfaces.exsd"/> 5 6 6 7 <extension … … 113 114 </launchMode> 114 115 </extension> 116 <extension 117 point="descent.building.compilerInterfaces"> 118 <compilerInterface 119 class="descent.internal.building.compiler.DmdCompilerInterface" 120 id="descent.building.compiler.DmdCompilerInterface" 121 vmInstallType="descent.internal.debug.ui.launcher.DmdCompilerType"> 122 </compilerInterface> 123 <compilerInterface 124 class="descent.internal.building.compiler.GdcCompilerInterface" 125 id="descent.building.compiler.GdcCompilerInterface" 126 vmInstallType="descent.internal.debug.ui.launcher.GdcCompilerType"> 127 </compilerInterface> 128 </extension> 115 129 116 130 </plugin> trunk/descent.building/src/descent/building/BuilderRegistry.java
r1174 r1187 17 17 * @author Robert Fraser 18 18 */ 19 public class BuilderRegistry19 public final class BuilderRegistry 20 20 { 21 private class DBuilderType implements IDBuilderType21 private static final class DBuilderType implements IDBuilderType 22 22 { 23 23 // Attributes defined in the schema trunk/descent.building/src/descent/building/IDBuilderType.java
r1174 r1187 5 5 /** 6 6 * Defines an interface for getting info about a builder type registered with 7 * the plugin. 7 * the plugin. This is not intended to be subclasses outside the building 8 * framework (you should instead create classes of type {@link IDBuilder}. 8 9 * 9 10 * @author Robert Fraser trunk/descent.building/src/descent/building/compiler/BooleanOption.java
r1180 r1187 1 1 package descent.building.compiler; 2 2 3 public finalclass BooleanOption extends CompilerOption3 public abstract class BooleanOption extends CompilerOption 4 4 { 5 5 private final String onText; … … 7 7 8 8 public BooleanOption(String attributeId, boolean defaultValue, 9 String label, String groupLabel, String onText, String offText, 10 String helpText) 9 String label, String groupLabel, String onText, String offText) 11 10 { 12 super(attributeId, defaultValue ? "true" : "false", label, groupLabel , helpText);11 super(attributeId, defaultValue ? "true" : "false", label, groupLabel); 13 12 this.onText = onText; 14 13 this.offText = offText; trunk/descent.building/src/descent/building/compiler/CompilerOption.java
r1180 r1187 7 7 private final String label; 8 8 private final String groupLabel; 9 private final String helpText;10 9 11 10 public CompilerOption(String attributeId, String defaultValue, String label, 12 String groupLabel , String helpText)11 String groupLabel) 13 12 { 14 13 this.attributeId = attributeId; … … 16 15 this.label = label; 17 16 this.groupLabel = groupLabel; 18 this.helpText = helpText;19 17 } 20 18 … … 39 37 } 40 38 41 public finalString getHelpText()39 public String getHelpText() 42 40 { 43 return helpText;41 return "No description is available for this option."; 44 42 } 45 43 } trunk/descent.building/src/descent/building/compiler/EnumOption.java
r1184 r1187 1 1 package descent.building.compiler; 2 2 3 public finalclass EnumOption extends CompilerOption3 public abstract class EnumOption extends CompilerOption 4 4 { 5 5 private final String[] optionValues; … … 9 9 public EnumOption(String attributeId, String defaultValue, 10 10 String label, String groupLabel, String[] optionValues, 11 String[] optionEditLabels , String helpText)11 String[] optionEditLabels) 12 12 { 13 13 this(attributeId, defaultValue, label, groupLabel, 14 optionValues, optionEditLabels, null , helpText);14 optionValues, optionEditLabels, null); 15 15 } 16 16 17 17 public EnumOption(String attributeId, String defaultValue, 18 18 String label, String groupLabel, String[] optionValues, 19 String[] optionEditLabels, String[] optionViewLabels, 20 String helpText) 19 String[] optionEditLabels, String[] optionViewLabels) 21 20 { 22 super(attributeId, defaultValue, label, groupLabel , helpText);21 super(attributeId, defaultValue, label, groupLabel); 23 22 this.optionValues = optionValues; 24 23 this.optionEditLabels = optionEditLabels; trunk/descent.building/src/descent/building/compiler/StringOption.java
r1183 r1187 1 1 package descent.building.compiler; 2 2 3 public class StringOption extends CompilerOption implements IValidatableOption3 public abstract class StringOption extends CompilerOption implements IValidatableOption 4 4 { 5 5 public StringOption(String attributeId, String defaultValue, 6 String label, String groupLabel , String helpText)6 String label, String groupLabel) 7 7 { 8 super(attributeId, defaultValue, label, groupLabel , helpText);8 super(attributeId, defaultValue, label, groupLabel); 9 9 } 10 10 11 11 public String isValid(String value) 12 12 { trunk/descent.building/src/descent/internal/building/BuilderUtil.java
r1184 r1187 22 22 public static final String EXTENSION_STATIC_LIBRARY; 23 23 public static final String EXTENSION_DYNAMIC_LIBRARY; 24 public static final String EXTENSION_DDL; 24 25 public static final String EXTENSION_OBJECT_FILE; 25 26 … … 33 34 EXTENSION_STATIC_LIBRARY = ".lib"; 34 35 EXTENSION_DYNAMIC_LIBRARY = ".dll"; 36 EXTENSION_DDL = ".ddl"; 35 37 EXTENSION_OBJECT_FILE = ".obj"; 36 38 } … … 40 42 EXTENSION_STATIC_LIBRARY = ".a"; 41 43 EXTENSION_DYNAMIC_LIBRARY = ".so"; 44 EXTENSION_DDL = ".ddl"; 42 45 EXTENSION_OBJECT_FILE = ".o"; 43 46 } trunk/descent.building/src/descent/internal/building/BuildingPlugin.java
r1186 r1187 28 28 */ 29 29 public static final String ID_EXTENSION_POINT_D_BUILDERS = "dBuilders"; 30 31 /** 32 * Identifier for the 'compilerInterfaces' extension point 33 */ 34 public static final String ID_EXTENSION_POINT_COMPILER_INTERFACES = "compilerInterfaces"; 30 35 31 36 /** trunk/descent.building/src/descent/internal/building/compiler/DmdCompilerInterface.java
r1184 r1187 10 10 import descent.building.compiler.CompilerOption; 11 11 import descent.building.compiler.ICompileCommand; 12 import descent.building.compiler.ICompilerInterface;13 12 import descent.building.compiler.ILinkCommand; 14 13 import descent.building.compiler.IResponseInterpreter; 15 14 import descent.building.compiler.BuildResponse; 16 import descent.internal.building.compiler.ui.GdcUIOptions;17 15 18 16 import static descent.internal.building.compiler.ui.DmdUIOptions.*; 19 17 20 public class DmdCompilerInterface implements ICompilerInterface18 public final class DmdCompilerInterface extends DmdfeCompilerInterface 21 19 { 22 20 protected static final boolean DEBUG = true; … … 260 258 // UI Options 261 259 262 private static final CompilerOption[] uiOptions; 263 264 static 260 private CompilerOption[] uiOptions; 261 262 public synchronized final CompilerOption[] getOptions() 263 { 264 if(null == uiOptions) 265 initializeUIOptions(); 266 return uiOptions; 267 } 268 269 private final void initializeUIOptions() 265 270 { 266 271 List<CompilerOption> options = new ArrayList<CompilerOption>(); … … 273 278 options.add(OPTION_INSTRUMENT_FOR_PROFILE); 274 279 275 // Optimization280 // Generated code 276 281 options.add(OPTION_OPTIMIZE_CODE); 277 282 options.add(OPTION_INLINE_CODE); … … 282 287 options.add(OPTION_SHOW_WARNINGS); 283 288 284 // TODO testing285 options.add(GdcUIOptions.OPTION_EMIT_TEMPLATES);286 287 289 uiOptions = options.toArray(new CompilerOption[options.size()]); 288 290 } … … 294 296 * @see descent.launching.compiler.ICompilerInterface#createCompileCommand() 295 297 */ 296 public ICompileCommand createCompileCommand()298 public final ICompileCommand createCompileCommand() 297 299 { 298 300 return new DmdCompileCommand(); … … 302 304 * @see descent.launching.compiler.ICompilerInterface#createLinkCommand() 303 305 */ 304 public ILinkCommand createLinkCommand()306 public final ILinkCommand createLinkCommand() 305 307 { 306 308 return new DmdLinkCommand(); … … 310 312 * @see descent.launching.compiler.ICompilerInterface#createCompileResponseInterpreter() 311 313 */ 312 public IResponseInterpreter createCompileResponseInterpreter()314 public final IResponseInterpreter createCompileResponseInterpreter() 313 315 { 314 316 return new DmdResponseInterpreter(); … … 318 320 * @see descent.launching.compiler.ICompilerInterface#createLinkResponseInterpreter() 319 321 */ 320 public IResponseInterpreter createLinkResponseInterpreter()322 public final IResponseInterpreter createLinkResponseInterpreter() 321 323 { 322 324 return new DmdResponseInterpreter(); 323 325 } 324 325 public CompilerOption[] getOptions()326 {327 return uiOptions;328 }329 326 } trunk/descent.building/src/descent/internal/building/compiler/ui/CompilerUIOptions.java
r1184 r1187 1 1 package descent.internal.building.compiler.ui; 2 2 3 public abstract class CompilerUIOptions 3 import static descent.building.IDescentBuilderConstants.*; 4 import descent.building.compiler.BooleanOption; 5 6 /* package */ interface CompilerUIOptions 4 7 { 5 8 public static final String GROUP_FEATURES = "Features"; … … 8 11 public static final String GROUP_LINKER = "Linker"; 9 12 public static final String GROUP_COMPATABILITY = "Compatability"; 13 14 /* package */ static final class AddDebugInfoOption extends BooleanOption 15 { 16 protected AddDebugInfoOption(String onText) 17 { 18 super(ATTR_ADD_DEBUG_INFO, true, "Add debugging symbols", 19 GROUP_FEATURES, onText, ""); 20 } 21 22 @Override 23 public String getHelpText() 24 { 25 return "Adds debugging symbols. These make the generated objects " 26 + "slightly larger but is needed to use a debugger with the " 27 + "program."; 28 } 29 } 30 31 /* package */ static final class DisableAssertsOption extends BooleanOption 32 { 33 protected DisableAssertsOption(String onText) 34 { 35 super(ATTR_DISABLE_ASSERTS, false, "Release mode", GROUP_FEATURES, 36 onText, ""); 37 } 38 39 @Override 40 public String getHelpText() 41 { 42 return "Turns off assert() statements in the code, in {} and out {} " 43 + "blocks on functions, and checking for array bounds errors. This " 44 + "makes the code run faster, so is a good choice for releasing the " 45 + "application, but are often useful for development."; 46 } 47 } 48 49 /* package */ static final class AddUnittestsOption extends BooleanOption 50 { 51 protected AddUnittestsOption(String onText) 52 { 53 super(ATTR_ADD_UNITTESTS, false, "Add unit tests", GROUP_FEATURES, 54 onText, ""); 55 } 56 57 @Override 58 public String getHelpText() 59 { 60 return "Adds code so that unittest {} blocks in your code are run before " 61 + "the program launches and enables version(unitttest) {} blocks."; 62 } 63 } 64 65 /* package */ static final class InstrumentForCoverageOption extends BooleanOption 66 { 67 protected InstrumentForCoverageOption(String onText) 68 { 69 super(ATTR_INSTRUMENT_FOR_COVERAGE, false, 70 "Instrument for coverage analysis", GROUP_FEATURES, onText, 71 ""); 72 } 73 74 @Override 75 public String getHelpText() 76 { 77 return "Adds code to the generated objects so that they will generate " 78 + "a file containing code coverage information after the program " 79 + "has been run. This is useful for seeing if unit tests execute " 80 + "all paths in your code."; 81 } 82 } 83 84 /* package */ static final class InstrumentForProfileOption extends BooleanOption 85 { 86 protected InstrumentForProfileOption(String onText) 87 { 88 super(ATTR_INSTRUMENT_FOR_PROFILE, false, 89 "Instrument for profiling", GROUP_FEATURES, onText, ""); 90 } 91 92 @Override 93 public String getHelpText() 94 { 95 return "Adds code to the generated objects so they can be profiled. " 96 + "This helps find bottlenecks that could be slowing down your " 97 + "application."; 98 } 99 } 10 100 } trunk/descent.building/src/descent/internal/building/compiler/ui/DmdUIOptions.java
r1184 r1187 1 1 package descent.internal.building.compiler.ui; 2 2 3 import static descent.internal.building.compiler.IDmdCompilerConstants.ATTR_NOFLOAT; 3 4 import descent.building.compiler.BooleanOption; 4 5 import descent.building.compiler.CompilerOption; 5 6 6 import static descent.building.IDescentBuilderConstants.*; 7 import static descent.internal.building.compiler.IDmdCompilerConstants.*; 8 9 public final class DmdUIOptions extends CompilerUIOptions 7 public interface DmdUIOptions extends DmdfeUIOptions 10 8 { 11 public static final CompilerOption OPTION_ADD_DEBUG_INFO = 12 new BooleanOption 13 ( 14 ATTR_ADD_DEBUG_INFO, 15 true, 16 "Add debugging symbols", 17 GROUP_FEATURES, 18 "-g", 19 "", 20 "Adds debugging symbols. These make the generated objects " + 21 "slightly larger but is needed to use a debugger with the " + 22 "program." 23 ); 9 public static final CompilerOption OPTION_ADD_DEBUG_INFO = new AddDebugInfoOption("-g"); 10 public static final CompilerOption OPTION_DISABLE_ASSERTS = new DisableAssertsOption("-release"); 11 public static final CompilerOption OPTION_ADD_UNITTESTS = new AddUnittestsOption("-unittest"); 12 public static final CompilerOption OPTION_INSTRUMENT_FOR_COVERAGE = new InstrumentForCoverageOption("-cov"); 13 public static final CompilerOption OPTION_INSTRUMENT_FOR_PROFILE = new InstrumentForProfileOption("-profile"); 24 14 15 public static final CompilerOption OPTION_OPTIMIZE_CODE = new OptimizeCodeOption("-O"); 16 public static final CompilerOption OPTION_INLINE_CODE = new InlineCodeOption("-inline"); 17 public static final CompilerOption OPTION_NOFLOAT = new BooleanOption 18 (ATTR_NOFLOAT, false, "Don't generate __fltused reference", 19 GROUP_GENERATED_CODE, "-nofloat", "") 20 { 21 @Override 22 public String getHelpText() 23 { 24 return "Prevents the emission of the __fltused reference in object files, " 25 + "even if floating point code is present. This is useful in library " 26 + "files."; 27 } 28 }; 25 29 26 public static final CompilerOption OPTION_DISABLE_ASSERTS = 27 new BooleanOption 28 ( 29 ATTR_DISABLE_ASSERTS, 30 false, 31 "Release mode", 32 GROUP_FEATURES, 33 "-release", 34 "", 35 "Turns off assert() statements in the code, in {} and out {} " + 36 "blocks on functions, and checking for array bounds errors. This " + 37 "makes the code run faster, so is a good choice for releasing the " + 38 "application, but are often useful for development." 39 ); 40 41 public static final CompilerOption OPTION_ADD_UNITTESTS = 42 new BooleanOption 43 ( 44 ATTR_ADD_UNITTESTS, 45 false, 46 "Add unit tests", 47 GROUP_FEATURES, 48 "-unittest", 49 "", 50 "Adds code so that unittest {} blocks in your code are run before " + 51 "the program launches and enables version(unitttest) {} blocks." 52 ); 53 54 55 public static final CompilerOption OPTION_INSTRUMENT_FOR_COVERAGE = 56 new BooleanOption 57 ( 58 ATTR_INSTRUMENT_FOR_COVERAGE, 59 false, 60 "Instrument for coverage analysis", 61 GROUP_FEATURES, 62 "-cov", 63 "", 64 "Adds code to the generated objects so that they will generate " + 65 "a file containing code coverage information after the program " + 66 "has been run. This is useful for seeing if unit tests execute " + 67 "all paths in your code." 68 ); 69 70 public static final CompilerOption OPTION_INSTRUMENT_FOR_PROFILE = 71 new BooleanOption 72 ( 73 ATTR_INSTRUMENT_FOR_PROFILE, 74 false, 75 "Instrument for profiling", 76 GROUP_FEATURES, 77 "-profile", 78 "", 79 "Adds code to the generated objects so they can be profiled. " + 80 "This helps find bottlenecks that could be slowing down your " + 81 "application." 82 ); 83 84 public static final CompilerOption OPTION_ALLOW_DEPRECATED = 85 new BooleanOption 86 ( 87 ATTR_ALLOW_DEPRECATED, 88 true, 89 "Allow deprecated code", 90 GROUP_WARNINGS, 91 "-d", 92 "", 93 "Allows code marked with the \"deprecated\" tags to be included " + 94 "in your program." 95 ); 96 97 public static final CompilerOption OPTION_SHOW_WARNINGS = 98 new BooleanOption 99 ( 100 ATTR_SHOW_WARNINGS, 101 false, 102 "Show warnings", 103 GROUP_WARNINGS, 104 "-w", 105 "", 106 "Adds warnings for potentially unsafe or error-prone code. In " + 107 "DMD, if warnings are encountered, the program will not be " + 108 "compiled." 109 ); 110 111 public static final CompilerOption OPTION_OPTIMIZE_CODE = 112 new BooleanOption 113 ( 114 ATTR_OPTIMIZE_CODE, 115 false, 116 "Optimize code", 117 GROUP_GENERATED_CODE, 118 "-O", 119 "", 120 "Optimizes the generated code for best efficiency." 121 ); 122 123 public static final CompilerOption OPTION_INLINE_CODE = 124 new BooleanOption 125 ( 126 ATTR_INLINE_CODE, 127 false, 128 "Inline functions", 129 GROUP_GENERATED_CODE, 130 "-inline", 131 "", 132 "Allows inlining of short functions for increased code efficiency. " + 133 "This may cause issues with some debuggers." 134 ); 135 136 public static final CompilerOption OPTION_NOFLOAT = 137 new BooleanOption 138 ( 139 ATTR_NOFLOAT, 140 false, 141 "Don't generate __fltused reference", 142 GROUP_GENERATED_CODE, 143 "-nofloat", 144 "", 145 "Prevents the emission of the __fltused reference in object files, " + 146 "even if floating point code is present. This is useful in library " + 147 "files." 148 ); 30 public static final CompilerOption OPTION_ALLOW_DEPRECATED = new AllowDeprecatedOption("-d"); 31 public static final CompilerOption OPTION_SHOW_WARNINGS = new ShowWarningsOption("-w"); 149 32 } trunk/descent.building/src/descent/internal/building/compiler/ui/GdcUIOptions.java
r1186 r1187 5 5 import descent.building.compiler.EnumOption; 6 6 7 import static descent.building.IDescentBuilderConstants.*;8 7 import static descent.internal.building.compiler.IGdcCompilerConstants.*; 9 8 10 public class GdcUIOptions extends CompilerUIOptions9 public interface GdcUIOptions extends DmdfeUIOptions 11 10 { 12 public static final CompilerOption OPTION_ADD_DEBUG_INFO = 13 new BooleanOption 14 ( 15 ATTR_ADD_DEBUG_INFO, 16 true, 17 "Add debugging symbols", 18 GROUP_FEATURES, 19 "-g", 20 "", 21 "Adds debugging symbols. These make the generated objects " + 22 "slightly larger but is needed to use a debugger with the " + 23 "program." 24 ); 11 public static final CompilerOption OPTION_ADD_DEBUG_INFO = new AddDebugInfoOption("-g"); 12 public static final CompilerOption OPTION_DISABLE_ASSERTS = new DisableAssertsOption("-frelease"); 13 public static final CompilerOption OPTION_ADD_UNITTESTS = new AddUnittestsOption("-funittest"); 25 14 26 27 public static final CompilerOption OPTION_DISABLE_ASSERTS = 28 new BooleanOption 29 ( 30 ATTR_DISABLE_ASSERTS, 31 false, 32 "Release mode", 33 GROUP_FEATURES, 34 "-frelease", 35 "", 36 "Turns off assert() statements in the code, in {} and out {} " + 37 "blocks on functions, and checking for array bounds errors. This " + 38 "makes the code run faster, so is a good choice for releasing the " + 39 "application, but are often useful for development." 40 ); 41 42 public static final CompilerOption OPTION_ADD_UNITTESTS = 43 new BooleanOption 44 ( 45 ATTR_ADD_UNITTESTS, 46 false, 47 "Add unit tests", 48 GROUP_FEATURES, 49 "-funittest", 50 "", 51 "Adds code so that unittest {} blocks in your code are run before " + 52 "the program launches and enables version(unitttest) {} blocks." 53 ); 54 55 public static final CompilerOption OPTION_ALLOW_DEPRECATED = 56 new BooleanOption 57 ( 58 ATTR_ALLOW_DEPRECATED, 59 true, 60 "Allow deprecated code", 61 GROUP_WARNINGS, 62 "-fdeprecated", 63 "", 64 "Allows code marked with the \"deprecated\" tags to be included " + 65 "in your program." 66 ); 67 68 public static final CompilerOption OPTION_SHOW_WARNINGS = 69 new BooleanOption 70 ( 71 ATTR_SHOW_WARNINGS, 72 false, 73 "Show warnings", 74 GROUP_WARNINGS, 75 "-Wall", 76 "", 77 "Adds warnings for potentially unsafe or error-prone code. In " + 78 "DMD, if warnings are encountered, the program will not be " + 79 "compiled." 80 ); 81 82 public static final CompilerOption OPTION_OPTIMIZE_CODE = 83 new BooleanOption 84 ( 85 ATTR_OPTIMIZE_CODE, 86 false, 87 "Optimize code", 88 GROUP_GENERATED_CODE, 89 "-O3", 90 "", 91 "Optimizes the generated code for best efficiency." 92 ); 93 94 public static final CompilerOption OPTION_INLINE_CODE = 95 new BooleanOption 96 ( 97 ATTR_INLINE_CODE, 98 false, 99 "Inline functions", 100 GROUP_GENERATED_CODE, 101 "-finline-functions", 102 "", 103 "Allows inlining of short functions for increased code efficiency. " + 104 "This may cause issues with some debuggers." 105 ); 15 public static final CompilerOption OPTION_OPTIMIZE_CODE = new OptimizeCodeOption("-O3"); 16 public static final CompilerOption OPTION_INLINE_CODE = new InlineCodeOption("-finline-functions"); 17 public static final CompilerOption OPTION_ALLOW_DEPRECATED = new AllowDeprecatedOption("-fdeprecated"); 18 public static final CompilerOption OPTION_SHOW_WARNINGS = new ShowWarningsOption("-Wall"); 106 19 107 20 public static final CompilerOption OPTION_ALL_SOURCES = … … 113 26 GROUP_COMPATABILITY, 114 27 "-fall-sources", 115 "", 116 "For each source file on the command line, semantically process each " + 117 "file preceding it. Use this if compilation errors occur due to " + 118 "complicated circular module references. This will slow compilation " + 119 "noticeably." 120 ); 28 "" 29 ) 30 { 31 @Override 32 public String getHelpText() 33 { 34 return "For each source file on the command line, semantically process each " + 35 "file preceding it. Use this if compilation errors occur due to " + 36 "complicated circular module references. This will slow compilation " + 37 "noticeably."; 38 } 39 }; 121 40 122 41 public static final CompilerOption OPTION_EMIT_TEMPLATES = … … 142 61 "All", 143 62 "None" 144 }, 145 "<p>Controls whether or not template code is emitted:</p>" + 146 "<li>Normal -- Emit templates, expecting multiple copies to be merged by the linker.</li>" + 147 "<li>Auto -- For targets that support templates, the \"all\" mode is used. Otherwise, the \"private\" mode is used.</li>" + 148 "<li>Private -- Emit templates, but make them private to the translation unit. The executable will have multiple copies of code and data.</li>" + 149 "<li>All -- Emit all template instances with public visibility. Do this even if they would not normally be emitted.</li>" + 150 "<li>None -- Do not emit templates at all.</li>" 151 ); 63 } 64 ) 65 { 66 @Override 67 public String getHelpText() 68 { 69 return "<p>Controls whether or not template code is emitted:</p>" + 70 "<li>Normal -- Emit templates, expecting multiple copies to be merged by the linker.</li>" + 71 "<li>Auto -- For targets that support templates, the \"all\" mode is used. Otherwise, the \"private\" mode is used.</li>" + 72 "<li>Private -- Emit templates, but make them private to the translation unit. The executable will have multiple copies of code and data.</li>" + 73 "<li>All -- Emit all template instances with public visibility. Do this even if they would not normally be emitted.</li>" + 74 "<li>None -- Do not emit templates at all.</li>"; 75 } 76 }; 152 77 } trunk/descent.building/src/descent/internal/building/ui/CompilerTab.java
r1184 r1187 6 6 import java.util.TreeMap; 7 7 8 import org.eclipse.core.runtime.CoreException; 8 9 import org.eclipse.debug.core.ILaunchConfiguration; 9 10 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; … … 41 42 import org.eclipse.ui.forms.widgets.ScrolledFormText; 42 43 44 import descent.building.CompilerInterfaceRegistry; 45 import descent.building.ICompilerInterfaceType; 43 46 import descent.building.IDescentBuilderConstants; 44 47 import descent.building.compiler.BooleanOption; … … 48 51 import descent.building.compiler.IValidatableOption; 49 52 import descent.building.compiler.StringOption; 50 import descent.internal.building. compiler.DmdCompilerInterface;53 import descent.internal.building.BuildingPlugin; 51 54 import descent.launching.IVMInstall; 52 55 import descent.launching.IVMInstallType; 53 56 import descent.launching.JavaRuntime; 54 57 58 // TODO egads, the whole issue of synchronizing all this is CRAZY!!!! So 59 // this is in a NON-WORKING STATE right now 55 60 /* package */ final class CompilerTab extends AbstractBuilderTab 56 61 { … … 109 114 IVMInstall selectedCompiler = selectedIndex >= 0 ? 110 115 fCompilers[selectedIndex] : null; 111 compilerOptions. compilerModeChanged(selectedCompiler);116 compilerOptions.initializeInput(selectedCompiler); 112 117 113 118 validatePage(); … … 164 169 public void initializeFrom(ILaunchConfiguration config) 165 170 { 171 int i = getCompilerIndex(config); 172 if(-1 != i) 173 fCombo.select(i); 174 else if(fCompilers.length >= 0) 175 fCombo.select(0); 176 } 177 178 public IVMInstall getCompiler(ILaunchConfiguration config) 179 { 180 int i = getCompilerIndex(config); 181 return -1 == i ? null : fCompilers[i]; 182 } 183 184 private int getCompilerIndex(ILaunchConfiguration config) 185 { 186 initializeCompilers(); 166 187 String compilerTypeId = getAttribute(config, 167 188 IDescentBuilderConstants.ATTR_COMPILER_TYPE_ID, ""); … … 175 196 compiler.getId().equals(compilerId)) 176 197 { 177 fCombo.select(i); 178 return; 179 } 180 } 181 182 if(fCompilers.length >= 0) 183 fCombo.select(0); 198 return i; 199 } 200 } 201 202 return -1; 184 203 } 185 204 … … 202 221 public void setDefaults(ILaunchConfigurationWorkingCopy config) 203 222 { 204 initializeCompilers(); 205 if(fCompilers.length > 0) 206 { 207 IVMInstall first = fCompilers[0]; 208 config.setAttribute(IDescentBuilderConstants.ATTR_COMPILER_TYPE_ID, first.getVMInstallType().getId()); 209 config.setAttribute(IDescentBuilderConstants.ATTR_COMPILER_ID, first.getId()); 223 IVMInstall defaultCompiler = getDefault(); 224 if(null != defaultCompiler) 225 { 226 config.setAttribute(IDescentBuilderConstants.ATTR_COMPILER_TYPE_ID, defaultCompiler.getVMInstallType().getId()); 227 config.setAttribute(IDescentBuilderConstants.ATTR_COMPILER_ID, defaultCompiler.getId()); 210 228 } 211 229 else … … 215 233 } 216 234 } 235 236 public IVMInstall getDefault() 237 { 238 initializeCompilers(); 239 return fCompilers.length > 0 ? fCompilers[0] : null; 240 } 217 241 218 242 public String validate() 219 243 { 220 244 int selectedIndex = fCombo.getSelectionIndex(); 245 221 246 if(selectedIndex < 0) 222 247 return "You must select a compiler to use"; … … 428 453 } 429 454 455 // TODO file UI options 456 430 457 private final class TreeEntry 431 458 { … … 444 471 445 472 private final class OptionsContentProvider implements ITreeContentProvider 446 { 473 { 447 474
