Changeset 1197

Show
Ignore:
Timestamp:
06/25/08 03:25:26 (2 months ago)
Author:
fraserofthenight
Message:

Random builder maintenance...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/descent.building/src/descent/building/BuilderLaunchDelegate.java

    r1174 r1197  
    99import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; 
    1010 
    11 import descent.internal.building.BuildingPlugin;; 
     11import descent.internal.building.BuildingPlugin; 
     12import descent.internal.building.debuild.DebuildMessages; 
    1213 
    1314/** 
     
    2829        IDBuilderType builderType = BuilderRegistry.getInstance().getBuilderForLaunchConfigurationType(configTypeId); 
    2930        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)); 
    3132         
    3233        IDBuilder builder = builderType.getBuilder(); 
    3334        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())); 
    3536         
    3637        builder.build(config, pm); 
  • trunk/descent.building/src/descent/building/BuilderRegistry.java

    r1187 r1197  
    2222    { 
    2323        // 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$ 
    2727         
    2828        private final IConfigurationElement info; 
  • trunk/descent.building/src/descent/building/CompilerInterfaceRegistry.java

    r1187 r1197  
    2424            implements ICompilerInterfaceType 
    2525    { 
    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$ 
    2929         
    3030        private final IConfigurationElement info; 
     
    9999    } 
    100100     
    101     private void loadCompilerInterfaces() 
     101    private synchronized void loadCompilerInterfaces() 
    102102    { 
    103103        if(null != compilerInterfaces) 
  • trunk/descent.building/src/descent/building/IDescentBuilderConstants.java

    r1184 r1197  
    2323     * The ID of the default descent builder. 
    2424     */ 
    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$ 
    2626     
    2727    /** 
     
    3030     * only. 
    3131     */ 
    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$ 
    3333     
    3434    //-------------------------------------------------------------------------- 
     
    4242     * Type: String 
    4343     */ 
    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$ 
    4545     
    4646    /** 
     
    5353     * Type: List<String> 
    5454     */ 
    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$ 
    5656     
    5757    /** 
     
    6262     * Type: String 
    6363     */ 
    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$ 
    6565     
    6666    /** 
     
    7070     * Type: String 
    7171     */ 
    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$ 
    7373     
    7474    /** 
     
    7979     * Type: String 
    8080     */ 
    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$ 
    8282     
    8383    /** 
     
    8686     * Type: String 
    8787     */ 
    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$ 
    8989     
    9090    /** 
     
    9393     * Type: String of "true" or "false" 
    9494     */ 
    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$ 
    9696     
    9797    /** 
     
    109109     * Type: String of "true" or "false" 
    110110     */ 
    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$ 
    112112     
    113113    /** 
     
    120120     * Type: String of "true" or "false" 
    121121     */ 
    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$ 
    123123     
    124124    /** 
     
    130130     * Type: String of "true" or "false" 
    131131     */ 
    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$ 
    133133     
    134134    /** 
     
    141141     * Type: String of "true" or "false" 
    142142     */ 
    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$ 
    144144     
    145145    /** 
     
    149149     * Type: String 
    150150     */ 
    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$ 
    152152     
    153153    /** 
     
    157157     * Type: String 
    158158     */ 
    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$ 
    160160     
    161161    /** 
     
    169169     * Type: String 
    170170     */ 
    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$ 
    172172     
    173173    /** 
     
    177177     * Type: Boolean 
    178178     */ 
    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$ 
    180180     
    181181    /** 
     
    186186     * Type: String 
    187187     */ 
    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$ 
    189189     
    190190    /** 
     
    195195     * Type: String 
    196196     */ 
    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$ 
    198198     
    199199    /** 
     
    203203     * Type: List<String> 
    204204     */ 
    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$ 
    206206     
    207207    /** 
     
    211211     * Type: List<String> 
    212212     */ 
    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$ 
    214214     
    215215    //-------------------------------------------------------------------------- 
     
    220220     * should be an executable file. 
    221221     */ 
    222     public static final String OUTPUT_TYPE_EXECUTABLE = "executable"; 
     222    public static final String OUTPUT_TYPE_EXECUTABLE = "executable"; //$NON-NLS-1$ 
    223223     
    224224    /** 
     
    226226     * should be a static library (.lib or .a) 
    227227     */ 
    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$ 
    229229     
    230230    //-------------------------------------------------------------------------- 
     
    236236     * launch configuration. 
    237237     */ 
    238     public static final String SOURCE_SELECTED_PROJECT = "selected_project"; 
     238    public static final String SOURCE_SELECTED_PROJECT = "selected_project"; //$NON-NLS-1$ 
    239239     
    240240    /** 
     
    242242     * be taken from the workspace active project and the launch configuration. 
    243243     */ 
    244     public static final String SOURCE_ACTIVE_PROJECT = "active_project"; 
     244    public static final String SOURCE_ACTIVE_PROJECT = "active_project"; //$NON-NLS-1$ 
    245245     
    246246    /** 
     
    248248     * only be taken from the launch configuration. 
    249249     */ 
    250     public static final String SOURCE_LAUNCH_CONFIG = "launch_configuration"; 
     250    public static final String SOURCE_LAUNCH_CONFIG = "launch_configuration"; //$NON-NLS-1$ 
    251251} 
  • trunk/descent.building/src/descent/building/compiler/ICompilerInterface.java

    r1177 r1197  
    11package descent.building.compiler; 
     2 
     3import descent.building.compiler.ui.CompilerOption; 
     4 
    25 
    36/** 
     
    69 * for that particular compiler, how to parse the output, etc. Generally, 
    710 * 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. 
    913 *  
    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 
    1218 *  
    1319 * @author Robert Fraser 
     
    1521public interface ICompilerInterface 
    1622{ 
    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 for 
    29      * this compiler. 
    30      */ 
    31     public IResponseInterpreter createCompileResponseInterpreter(); 
    32      
    33     /** 
    34      * Creates a new response interpreter of the correct type for this 
    35      * linker. 
    36      */ 
    37     public IResponseInterpreter createLinkResponseInterpreter(); 
    38      
    3923    /** 
    4024     * Gets the compiler options which should be presented in the UI. 
  • trunk/descent.building/src/descent/building/compiler/IResponseInterpreter.java

    r1174 r1197  
    33/** 
    44 * 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. 
    128 *  
    139 * @author Robert Fraser 
     
    2824     */ 
    2925    public void interpretError(String line); 
    30      
    31     /** 
    32      * Gets the result of the build command 
    33      */ 
    34     public BuildResponse getResponse(); 
    3526} 
  • trunk/descent.building/src/descent/internal/building/BuilderUtil.java

    r1187 r1197  
    11package descent.internal.building; 
    22 
     3import java.util.ArrayList; 
    34import java.util.Arrays; 
     5import java.util.List; 
     6import java.util.Map; 
     7import java.util.Set; 
    48 
    59import org.eclipse.core.resources.IResource; 
    610import org.eclipse.core.resources.ResourcesPlugin; 
     11import org.eclipse.core.runtime.CoreException; 
    712import org.eclipse.core.runtime.IPath; 
     13import org.eclipse.debug.core.ILaunchConfiguration; 
     14 
     15import descent.building.CompilerInterfaceRegistry; 
     16import descent.building.ICompilerInterfaceType; 
     17import descent.building.compiler.ICompilerInterface; 
     18import descent.core.IJavaProject; 
     19import descent.launching.IVMInstall; 
     20import descent.launching.JavaRuntime; 
    821 
    922/** 
     
    1225 * @author Robert Fraser 
    1326 */ 
     27@SuppressWarnings("unchecked") 
    1428public class BuilderUtil 
    1529{ 
     
    2741    static 
    2842    { 
    29         IS_WINDOWS = System.getProperty("os.name").startsWith("Windows"); 
     43        IS_WINDOWS = System.getProperty("os.name").startsWith("Windows"); //$NON-NLS-1$ //$NON-NLS-2$ 
    3044         
    3145        if(IS_WINDOWS) 
    3246        { 
    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$ 
    3852        } 
    3953        else 
    4054        { 
    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$ 
    4660        } 
    4761    } 
     
    5468    public static final String[] PREDEFINED_VERSIONS = new String[] 
    5569    { 
    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$ 
    7286    }; 
    7387     
     
    113127    } 
    114128     
     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     
    115158    private static boolean isValidIdChar(char c) 
    116159    { 
     
    122165            c >= 128; // Assume anything in unicode is OK 
    123166    } 
     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    } 
    124264} 
  • trunk/descent.building/src/descent/internal/building/BuildingPlugin.java

    r1187 r1197  
    2222     * The plug-in ID 
    2323     */ 
    24     public static final String PLUGIN_ID = "descent.building"; 
     24    public static final String PLUGIN_ID = "descent.building"; //$NON-NLS-1$ 
    2525     
    2626    /** 
    2727     * Identifier for 'dBuilders' extension point 
    2828     */ 
    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$ 
    3030     
    3131    /** 
    3232     * Identifier for the 'compilerInterfaces' extension point 
    3333     */ 
    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$ 
    3535     
    3636    /** 
    3737     * The build group identifier 
    3838     */ 
    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$ 
    4040     
    4141    /** 
  • trunk/descent.building/src/descent/internal/building/compiler/DmdCompilerInterface.java

    r1187 r1197  
    11package descent.internal.building.compiler; 
    22 
    3 import java.io.File; 
    43import java.util.ArrayList; 
    54import java.util.List; 
    65import java.util.regex.Pattern; 
    76 
    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; 
    137import descent.building.compiler.IResponseInterpreter; 
    14 import descent.building.compiler.BuildResponse
     8import descent.building.compiler.ui.CompilerOption
    159 
    1610import static descent.internal.building.compiler.ui.DmdUIOptions.*; 
     
    2115     
    2216    //-------------------------------------------------------------------------- 
    23     // Compile Command 
    24     protected static class DmdCompileCommand extends AbstractCompileCommand 
    25     { 
    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 executable 
    39             buf.append(executableFile.getPath()); 
    40             buf.append(" "); 
    41              
    42             // Set options 
    43             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 compile 
    149             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 file 
    156             // instead 
    157             return buf.toString().trim(); 
    158         } 
    159     } 
    160      
    161     //-------------------------------------------------------------------------- 
    162     // Link Command 
    163     protected static class DmdLinkCommand extends AbstractLinkCommand 
    164     { 
    165         DmdLinkCommand() 
    166         { 
    167             setDefaults(); 
    168         } 
    169          
    170         /* (non-Javadoc) 
    171          * @see descent.launching.compiler.IExecutableCommand#getCommand() 
    172          */ 
    173         public String getCommand() 
    174