Changeset 906

Show
Ignore:
Timestamp:
11/08/07 18:47:36 (1 year ago)
Author:
phoenix
Message:

0.2.2 release candidate

  • Fixed dependency on org.junit, and consequently JDT.
  • Fixed SWT debug colors left on.
  • Fixed Source Coloring preference page "Basic types" entry bug.
  • Removed unused DTLK project script builder (fix only applies to new projects).
  • Rethought and implemented the project builder, based on a mildly IDE-managed response file. It should be usable now.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dtool/META-INF/MANIFEST.MF

    r866 r906  
    11Manifest-Version: 1.0 
    22Bundle-ManifestVersion: 2 
    3 Bundle-Name: %pluginNames 
     3Bundle-Name: %pluginName 
    44Bundle-SymbolicName: dtool;singleton:=true 
    5 Bundle-Version: 0.2.0.qualifier 
     5Bundle-Version: 0.2.2.qualifier 
    66Bundle-ClassPath: DTool.jar 
    77Export-Package: dtool, 
  • trunk/dtool/build.properties

    r773 r906  
    11source.DTool.jar = src/,\ 
    2                    src-descent.core/src/,\ 
    3                    src-descent.core/src-util/,\ 
    42                   libs/ini4j-0.2.6/src/classes/ 
    53bin.includes = META-INF/,\ 
  • trunk/dtool/src/dtool/ast/ASTNeoNode.java

    r804 r906  
    138138    } 
    139139 
    140     public final void accept0(IASTVisitor visitor) { 
     140    public final void accept0(@SuppressWarnings("unused") IASTVisitor visitor) { 
    141141        Assert.fail("NEO AST elements should not use IASTVisitor"); 
    142142    } 
  • trunk/dtool/src/dtool/ast/definitions/DefUnit.java

    r866 r906  
    9898    /** Returns signature-oriented String representation. */ 
    9999    public String toStringForHoverSignature() { 
    100         String str = getArcheType().toString()  
    101             + "  " + getModuleScope().toStringAsElement() + "." + getName(); 
     100        String str = getModuleScope().toStringAsElement() + "." + getName(); 
    102101        //if(getMembersScope() != this)str += " : " + getMembersScope(); 
    103102        return str; 
  • trunk/dtool/src/dtool/descentadapter/CoreConverter.java

    r758 r906  
    77import descent.internal.compiler.parser.ast.IASTNode; 
    88 
     9@SuppressWarnings("unused") 
    910public abstract class CoreConverter extends ASTCommonConverter { 
    1011 
  • trunk/dtool/src/dtool/descentadapter/DescentASTConverter.java

    r758 r906  
    5757     
    5858    @SuppressWarnings("unchecked") 
    59     public static <T extends IASTNode> List<T> convertManyL(List<? extends ASTNode> children, List<T> dummy) { 
     59    public static <T extends IASTNode> List<T> convertManyL(List<? extends ASTNode> children,  
     60            @SuppressWarnings("unused") List<T> dummy) { 
    6061        StatementConverter conv = new StatementConverter(); 
    6162        if(children == null) 
     
    7172     
    7273    @SuppressWarnings("unchecked") 
    73     public static <T extends IASTNode> List<T> convertManyL(ASTNode[] children, List<T> dummy) { 
     74    public static <T extends IASTNode> List<T> convertManyL(ASTNode[] children,  
     75            @SuppressWarnings("unused") List<T> dummy) { 
    7476        StatementConverter conv = new StatementConverter(); 
    7577        List<T> rets = new ArrayList<T>(children.length); 
  • trunk/mmrnmhrm.core/META-INF/MANIFEST.MF

    r773 r906  
    33Bundle-Name: %pluginName 
    44Bundle-SymbolicName: mmrnmhrm.core;singleton:=true 
    5 Bundle-Version: 0.2.0.qualifier 
     5Bundle-Version: 0.2.2.qualifier 
    66Bundle-Activator: mmrnmhrm.core.DeeCore 
    77Bundle-Vendor: %pluginProvider 
     
    2121 org.eclipse.jface, 
    2222 org.eclipse.jface.text, 
    23  org.junit, 
    2423 org.eclipse.dltk.core, 
    2524 org.eclipse.dltk.launching, 
  • trunk/mmrnmhrm.core/plugin.xml

    r804 r906  
    9898      </interpreterInstallType> 
    9999   </extension> 
     100   <!-- 
    100101   <extension 
    101102         point="org.eclipse.dltk.core.builder"> 
     
    105106      </builder> 
    106107   </extension> 
     108   --> 
    107109   <extension 
    108110         point="org.eclipse.debug.core.launchConfigurationTypes"> 
  • trunk/mmrnmhrm.core/src/mmrnmhrm/core/DeeCore.java

    r749 r906  
    3535 
    3636    /** {@inheritDoc} */ 
     37    @Override 
    3738    public void start(BundleContext context) throws Exception { 
    3839        super.start(context); 
     
    4142 
    4243    /** {@inheritDoc} */ 
     44    @Override 
    4345    public void stop(BundleContext context) throws Exception { 
    4446        super.stop(context); 
  • trunk/mmrnmhrm.core/src/mmrnmhrm/core/build/DeeBuildOptions.java

    r773 r906  
    55import org.eclipse.core.runtime.Platform; 
    66 
    7 public class DeeCompilerOptions { 
     7public class DeeBuildOptions { 
    88 
    99    public static enum EBuildTypes { 
     
    1717    /** Project relative path */ 
    1818    public IPath outputDir; 
    19     public String buildTool
    20     public String extraOptions; 
     19    public String buildToolCmdLine
     20    public String buildCommands; 
    2121     
    22     public DeeCompilerOptions(String projname) { 
     22    public DeeBuildOptions(String projname) { 
    2323        buildType = EBuildTypes.EXECUTABLE; 
    2424        artifactName = projname + getOSExtension(); 
    2525        outputDir = new Path(defaultOutputFolder()); 
    26         buildTool = "bud"; 
    27         extraOptions = ""
     26        buildToolCmdLine = "build -rfbuild.rf"; 
     27        buildCommands = DeeBuilder.getDefaultRebuildBuildFileData()
    2828    } 
    2929 
     
    3939     
    4040    @Override 
    41     public DeeCompilerOptions clone() { 
    42         DeeCompilerOptions options = new DeeCompilerOptions(artifactName); 
     41    public DeeBuildOptions clone() { 
     42        DeeBuildOptions options = new DeeBuildOptions(artifactName); 
    4343        options.buildType = buildType; 
    4444        options.artifactName = artifactName; 
    4545        options.outputDir = outputDir; 
    46         options.buildTool = buildTool; 
    47         options.extraOptions = extraOptions; 
     46        options.buildToolCmdLine = buildToolCmdLine; 
     47        options.buildCommands = buildCommands; 
     48 
    4849        return options; 
    4950    } 
  • trunk/mmrnmhrm.core/src/mmrnmhrm/core/build/DeeBuilder.java

    r833 r906  
    11package mmrnmhrm.core.build; 
    22 
     3import static melnorme.miscutil.Assert.assertFail; 
     4 
    35import java.io.ByteArrayInputStream; 
     6import java.io.File; 
    47import java.io.IOException; 
    58import java.io.InputStream; 
    69import java.util.ArrayList; 
    7 import java.util.Collections; 
    810import java.util.List; 
     11import java.util.Map; 
    912 
    1013import melnorme.miscutil.StringUtil; 
    1114import mmrnmhrm.core.DeeCore; 
     15import mmrnmhrm.core.launch.DeeDmdInstallType; 
    1216import mmrnmhrm.core.model.DeeModel; 
    1317import mmrnmhrm.core.model.DeeNameRules; 
     
    2327import org.eclipse.core.runtime.IProgressMonitor; 
    2428import org.eclipse.dltk.core.IBuildpathEntry; 
    25 import org.eclipse.dltk.core.IProjectFragment; 
    2629import org.eclipse.dltk.core.IScriptProject; 
    2730 
     
    2932 
    3033public class DeeBuilder { 
    31  
    32     private List<String> buildModules; 
    33     private List<String> buildElements; 
    34     private IPath compilerPath; 
    35  
    36     public DeeBuilder() { 
    37         buildElements = new ArrayList<String>(); 
    38         buildModules = new ArrayList<String>(); 
    39         compilerPath = null; 
    40     } 
    41  
    42     public static List<String> getDemoCmdLine(IScriptProject deeProj, 
     34     
     35    public static String getDemoBuildCommands(IScriptProject deeProj, 
    4336            DeeProjectOptions overlayOptions, IProgressMonitor monitor) { 
    4437        DeeBuilder builder = new DeeBuilder(); 
    4538        try { 
    46             builder.collectBuildUnits(deeProj, true, monitor); 
     39            //builder.dontCollectModules = true; 
     40            builder.collectBuildUnits(deeProj, monitor); 
    4741        } catch (CoreException e) { 
    4842            DeeCore.log(e); 
    49             return Collections.singletonList( 
    50                     "Cannot determine preview: " + e) ; 
    51         } 
    52         builder.buildModules = Collections.singletonList("<<files.d>>"); 
     43            return "Cannot determine preview: " + e ; 
     44        } 
     45        //builder.buildModules = Collections.singletonList("<<files.d>>"); 
    5346        //DeeProjectOptions options = DeeModel.getDeeProjectInfo(deeProj); 
    54         return builder.createCommandLine(deeProj, overlayOptions); 
    55     } 
    56      
    57     public void collectBuildUnits(IScriptProject deeProj, 
    58             IProgressMonitor monitor) throws CoreException  { 
    59         collectBuildUnits(deeProj, false, monitor); 
    60     } 
    61      
    62     private void collectBuildUnits(IScriptProject deeProj, boolean entriesOnly, 
    63             IProgressMonitor monitor) throws CoreException  { 
    64          
    65         IProject project = deeProj.getProject(); 
    66          
     47         
     48        //buildCommands = buildCommands.replace("$DEEBUILDER.SRCMODULES", "#DEEBUILDER.SRCMODULES#"); 
     49        String buildCommands = builder.postProcessBuildCommands(overlayOptions); 
     50        //buildCommands.replace("#DEEBUILDER.SRCMODULES#", "$DEEBUILDER.SRCMODULES"); 
     51        return buildCommands; 
     52    } 
     53     
     54    public static String getDefaultRebuildBuildFileData() { 
     55        return  
     56        "-oq$DEEBUILDER.OUTPUTPATH\n" 
     57        +"-of$DEEBUILDER.OUTPUTEXE\n" 
     58        //+"$DEEBUILDER.EXTRAOPTS\n" 
     59        +"$DEEBUILDER.SRCLIBS.-I\n" 
     60        +"$DEEBUILDER.SRCFOLDERS.-I\n" 
     61        +"$DEEBUILDER.SRCMODULES\n"; 
     62    } 
     63 
     64     
     65    private boolean dontCollectModules; 
     66     
     67    private List<String> libraryEntries; 
     68    private List<String> folderEntries; 
     69    private List<String> buildModules; 
     70    private IPath compilerPath; 
     71    private IPath standardLibPath; 
     72 
     73    public DeeBuilder() { 
     74        dontCollectModules = false; 
     75 
     76        buildModules = new ArrayList<String>(); 
     77        libraryEntries = new ArrayList<String>(); 
     78        folderEntries = new ArrayList<String>(); 
     79    } 
     80     
     81 
     82    private DeeProjectOptions getProjectOptions(IScriptProject deeProj) { 
     83        return DeeModel.getDeeProjectInfo(deeProj); 
     84    } 
     85 
     86 
     87    public void collectBuildUnits(IScriptProject deeProj, IProgressMonitor monitor) throws CoreException  { 
     88         
     89     
    6790        IBuildpathEntry[] buildpathEntries = deeProj.getResolvedBuildpath(true); 
    6891 
     
    7396             
    7497            if(entry.getEntryKind() == IBuildpathEntry.BPE_SOURCE) { 
    75                 //fixme, what if external 
    76                 IPath entrypath; 
    77                 IContainer entryResource = null; 
    78                 if(!entry.isExternal()) { 
    79                     IPath localpath = entry.getPath().removeFirstSegments(1); 
    80                     entryResource = (IContainer) project.findMember(localpath); 
    81                     entrypath = entryResource.getLocation(); 
    82                 } else { 
    83                     entrypath = entry.getPath(); 
    84                 } 
    85                 buildElements.add("-I"+entrypath.toOSString()); 
    86                 if(entriesOnly)  
    87                     continue; 
    88  
    89                 if(entryResource != null) 
    90                     proccessContainer(entrypath, entryResource, monitor); 
     98                processSourceEntry(deeProj, entry, monitor); 
    9199            } else if(entry.getEntryKind() == IBuildpathEntry.BPE_LIBRARY) { 
    92                 if(!entry.isExternal()) { 
    93                     IPath entryFullPath = entry.getPath(); 
    94                     IProjectFragment projFrag = deeProj.findProjectFragment(entryFullPath); 
    95                     if(projFrag != null) 
    96                         Logg.main.println(StringUtil.collToString(projFrag.getChildren(), ",")); 
    97                     else 
    98                         Logg.main.println("No proj fragment for: " + entryFullPath); 
    99                 } else if (entry.getPath().lastSegment().matches("phobos")) { 
    100                     buildElements.add("-I"+entry.getPath().toOSString()); 
    101                     // FIXME: BUILDER: Support other kinds of install locations 
    102                     IPath path = entry.getPath().removeLastSegments(2); 
    103                     compilerPath = path.append("bin"); 
    104                 } 
     100                processLibraryEntry(entry); 
    105101            } 
    106102        } 
    107103    } 
    108104 
    109     protected void proccessContainer(IPath entrypath, IContainer container, 
     105    private void processLibraryEntry(IBuildpathEntry entry) throws CoreException { 
     106         
     107        if(entry.getPath().matchingFirstSegments(IBuildpathEntry.BUILTIN_EXTERNAL_ENTRY) == 1) { 
     108            // XXX: This entry has the compiler path, but has a bug in which the path device is lost 
     109            //compilerPath = standardLibPath.removeLastSegments(2).append("bin"); 
     110        } else if (DeeDmdInstallType.isStandardLibraryEntry(entry)) { 
     111            // FIXME: BUILDER: Support other kinds of install locations 
     112            standardLibPath = entry.getPath(); 
     113            compilerPath = standardLibPath.removeLastSegments(2).append("bin"); 
     114 
     115        } else if(!entry.isExternal()) { 
     116            IPath projectBasedPath = entry.getPath().removeFirstSegments(1); 
     117            libraryEntries.add(projectBasedPath.toOSString()); 
     118        } 
     119    } 
     120 
     121    private void processSourceEntry(IScriptProject deeProj, IBuildpathEntry entry, IProgressMonitor monitor) 
     122            throws CoreException { 
     123        IProject project = deeProj.getProject(); 
     124 
     125        if(entry.isExternal()) { 
     126            throw DeeCore.createCoreException("Unsupported external source entry" + entry, null); 
     127        } 
     128         
     129        IPath projectBasedPath = entry.getPath().removeFirstSegments(1); 
     130        IContainer entryContainer = (IContainer) project.findMember(projectBasedPath); 
     131 
     132         
     133        String containerPathStr = entryContainer.isLinked(IResource.CHECK_ANCESTORS) ? 
     134                entryContainer.getLocation().toOSString() 
     135                : projectBasedPath.toOSString(); 
     136         
     137        folderEntries.add(containerPathStr); 
     138        if(dontCollectModules)   
     139            return; 
     140 
     141        if(entryContainer != null) 
     142            proccessSourceFolder(entryContainer, monitor); 
     143         
     144    } 
     145 
     146    protected void proccessSourceFolder(IContainer container, 
    110147            IProgressMonitor monitor) throws CoreException { 
    111148         
     
    113150        for (int i = 0; i < members.length; i++) { 
    114151            IResource resource = members[i]; 
    115             processResource(entrypath, resource); 
    116152            if(resource.getType() == IResource.FOLDER) { 
    117                 proccessContainer(entrypath, (IFolder) resource, monitor); 
    118             }  
    119         } 
    120  
    121     } 
    122  
    123      
    124     protected void processResource(IPath entrypath, IResource resource) { 
    125         if(resource.getType() == IResource.FILE) { 
    126             String modUnitName = resource.getName(); 
    127             IPath path = resource.getProjectRelativePath(); 
    128             String extName = path.getFileExtension(); 
    129             String modName = path.removeFileExtension().lastSegment(); 
    130             if(DeeNameRules.isValidCompilationUnitName(modUnitName)) { 
    131                 buildModules.add(resource.getLocation().toOSString()); 
    132                 //addCompileBuildUnit(resource); 
     153                proccessSourceFolder((IFolder) resource, monitor); 
     154            } else if(resource.getType() == IResource.FILE) { 
     155                processResource((IFile) resource); 
    133156            } else { 
     157                assertFail(); 
    134158            } 
    135159        } 
    136160    } 
    137161 
    138     protected void compileModules(IScriptProject deeProj, 
    139             IProgressMonitor monitor) throws CoreException { 
    140          
    141         DeeProjectOptions options = DeeModel.getDeeProjectInfo(deeProj); 
    142         IFolder outputFolder = options.getOutputFolder(); 
    143          
    144         List<String> cmdlineParams = createCommandLine(deeProj, options); 
    145          
    146         IFile file = outputFolder.getFile(options.getArtifactNameNoExt()+".brf"); 
    147          
    148         byte[] buf = StringUtil.collToString(cmdlineParams, "\n").getBytes(); 
     162     
     163    protected void processResource(IFile file) { 
     164        String modUnitName = file.getName(); 
     165        IPath projectRelativePath = file.getProjectRelativePath(); 
     166        if(DeeNameRules.isValidCompilationUnitName(modUnitName)) { 
     167            String resourcePathStr = file.isLinked(IResource.CHECK_ANCESTORS) ? 
     168                    file.getLocation().toOSString() 
     169                    : projectRelativePath.toOSString(); 
     170             
     171            buildModules.add(resourcePathStr); 
     172            //addCompileBuildUnit(resource); 
     173        } else { 
     174        } 
     175        //String extName = projectRelativePath.getFileExtension(); 
     176        //String modName = projectRelativePath.removeFileExtension().lastSegment(); 
     177    } 
     178 
     179    protected void compileModules(IScriptProject deeProj) throws CoreException { 
     180         
     181        DeeProjectOptions options = getProjectOptions(deeProj); 
     182        //IFolder outputFolder = options.getOutputFolder(); 
     183         
     184        String buildCommands = postProcessBuildCommands(options); 
     185 
     186        Logg.main.println("--------  Build Commands:  --------\n" + buildCommands); 
     187        DeeProjectBuilder.buildListener.clear(); // This will wait some ms due to race 
     188        DeeProjectBuilder.buildListener.println("--------  Build Commands:  --------\n" + buildCommands); 
     189 
     190         
     191        IFile file = deeProj.getProject().getFile(options.getBuildFile()); 
     192         
     193        byte[] buf = buildCommands.getBytes(); 
    149194        InputStream is = new ByteArrayInputStream(buf); 
    150195        if(file.exists() == false) { 
     
    153198            file.setContents(is, IResource.NONE, null); 
    154199        } 
    155  
    156         Logg.main.println(">>> " + cmdlineParams); 
    157         DeeProjectBuilder.buildListener.clear(); 
    158         DeeProjectBuilder.buildListener.println(">>> " + cmdlineParams); 
    159  
    160         String exe = options.compilerOptions.buildTool; 
    161         String rspfile = "@" + file.getProjectRelativePath().toOSString(); 
    162          
     200    } 
     201 
     202    private String postProcessBuildCommands(DeeProjectOptions options) { 
     203        StringBuilder strb = new StringBuilder(options.getBuildCommands()); 
     204         
     205        IPath outputPath = options.getOutputFolder().getProjectRelativePath(); 
     206        String outputDir = outputPath.toOSString(); 
     207        while(StringUtil.replace(strb, "$DEEBUILDER.OUTPUTPATH", outputDir)); 
     208         
     209        String outputExe = outputPath.append(options.getArtifactName()).toOSString(); 
     210        while(StringUtil.replace(strb, "$DEEBUILDER.OUTPUTEXE", outputExe)); 
     211         
     212         
     213/*      { 
     214        String optionsStr = ""; 
     215        String[] extrasOpts = options.getBuildCommands().split("\r\n|\n"); 
     216        for (String opt : extrasOpts) { 
     217            optionsStr += opt + "\n"; 
     218        } 
     219        while(StringUtil.replace(strb, "$DEEBUILDER.EXTRAOPTS", optionsStr)); 
     220        } 
     221*/ 
     222        { 
     223        String srcLibs = ""; 
     224        for (String srcLib : libraryEntries) { 
     225            srcLibs += "-I" + srcLib + "\n"; 
     226        } 
     227        while(StringUtil.replace(strb, "$DEEBUILDER.SRCLIBS.-I", srcLibs)); 
     228        } 
     229         
     230        { 
     231        String srcFolders = ""; 
     232        for (String srcfolder : folderEntries) { 
     233            srcFolders += "-I" + srcfolder + "\n"; 
     234        } 
     235        while(StringUtil.replace(strb, "$DEEBUILDER.SRCFOLDERS.-I", srcFolders)); 
     236        } 
     237 
     238 
     239        { 
     240        String srcModules = ""; 
     241        for (String srcModule : buildModules) { 
     242            srcModules += srcModule + "\n"; 
     243        } 
     244        while(StringUtil.replace(strb, "$DEEBUILDER.SRCMODULES", srcModules)); 
     245        } 
     246         
     247        return strb.toString(); 
     248    } 
     249 
     250     
     251    public void runBuilder(IScriptProject deeProj, IProgressMonitor monitor) 
     252            throws CoreException { 
     253 
     254        DeeProjectOptions options = getProjectOptions(deeProj); 
    163255        IPath workDir = deeProj.getProject().getLocation(); 
    164         runBuildProcess(monitor, workDir , exe, rspfile); 
    165  
    166     } 
    167  
    168     protected List<String> createCommandLine(IScriptProject deeProj, 
    169             DeeProjectOptions options) { 
    170          
    171         List<String> cmdline = new ArrayList<String>(); 
    172          
    173         cmdline.addAll(buildElements); 
    174          
    175         if(compilerPath != null) 
    176             cmdline.add("-DCPATH"+compilerPath.toOSString()); 
    177          
    178  
    179         IPath outputPath = options.getOutputFolder().getProjectRelativePath(); 
    180         cmdline.add("-od"+outputPath); 
    181  
    182         cmdline.add("-Rn"); 
    183         String appname; 
    184         appname = outputPath.append(options.getArtifactName()).toOSString(); 
    185         cmdline.add("-T"+appname); 
    186         if(options.getExtraOptions().length() != 0) { 
    187             String[] extrasOpts = options.getExtraOptions().split("\r\n|\n"); 
    188             for (int i = 0; i < extrasOpts.length; i++) { 
    189                 cmdline.add(extrasOpts[i]); 
    190             } 
    191         } 
    192          
    193         cmdline.addAll(buildModules); 
    194  
    195         return cmdline; 
    196     } 
    197  
    198  
    199     private void runBuildProcess(IProgressMonitor monitor, 
    200             IPath workDir, String... cmdLine) 
    201             throws CoreException { 
     256 
     257        //String buildToolExePath = splitSpaces(options.compilerOptions.buildToolCmdLine); 
     258        //String[] cmdLine = { buildToolExePath, options.getBuilderCommandLine() }; 
     259         
     260        String[] cmdLine = options.getBuilderFullCommandLine(); 
     261 
     262         
    202263        final ProcessBuilder builder = new ProcessBuilder(cmdLine); 
    203         builder.directory(workDir.toFile()); 
     264 
     265        Map<String, String> env = builder.environment(); 
     266        String pathName = "PATH"; 
     267        String pathStr = env.get(pathName); 
     268        if(pathStr == null) { 
     269            pathName = "Path"; 
     270            pathStr = env.get(pathName); 
     271        } 
     272        if(pathStr == null) { 
     273            pathName = "path"; 
     274            pathStr = env.get(pathName); 
     275        } 
     276        pathStr = compilerPath.toOSString() + File.pathSeparator + pathStr; 
     277        env.put(pathName, pathStr); 
     278 
    204279        if(cmdLine.toString().length() > 30000) 
    205280            throw DeeCore.createCoreException( 
    206281                    "D Build: Error cannot build: cmd-line too big", null); 
    207282 
     283         
     284        builder.directory(workDir.toFile()); 
     285         
    208286        try { 
    209287            Process proc = builder.start(); 
  • trunk/mmrnmhrm.core/src/mmrnmhrm/core/build/DeeDLTKScriptBuilder.java

    r749 r906  
    1313import dtool.Logg; 
    1414 
     15@Deprecated 
    1516public class DeeDLTKScriptBuilder implements IScriptBuilder { 
    1617 
  • trunk/mmrnmhrm.core/src/mmrnmhrm/core/build/DeeProjectBuilder.java

    r804 r906  
    3434    private IFolder outputFolder; 
    3535     
     36    @Override 
    3637    protected void startupOnInitialize() { 
    3738        assertTrue(getModelProject() != null); 
     
    4950     
    5051 
     52    @Override 
    5153    protected void clean(IProgressMonitor monitor) throws CoreException { 
    5254        IPath outputPath = getProjectOptions().compilerOptions.outputDir; 
    5355        outputFolder = getProject().getFolder(outputPath); 
    5456        if(outputFolder.exists()) { 
    55             outputFolder.delete(true, null); 
    56             outputFolder.create(true, true, monitor); 
     57            for(IResource res : outputFolder.members()) { 
     58                res.delete(true, monitor); 
     59            } 
    5760        } 
     61    } 
     62     
     63    private IFolder prepOutputFolder(DeeProjectOptions options) throws CoreException { 
     64        IPath outputPath = options.compilerOptions.outputDir; 
     65        IFolder outputFolder = getProject().getFolder(outputPath); 
     66 
     67        if(!outputFolder.exists()) 
     68            outputFolder.create(IResource.DERIVED, true, null); 
     69        return outputFolder; 
    5870    } 
    5971 
     
    6678 
    6779        IScriptProject deeProj = getModelProject(); 
    68         DeeBuilder compiler = new DeeBuilder(); 
     80        DeeBuilder deeBuilder = new DeeBuilder(); 
    6981 
    7082        monitor.beginTask("Building D project", 5); 
     
    7385        monitor.worked(1); 
    7486         
    75         compiler.collectBuildUnits(deeProj, monitor); 
     87        deeBuilder.collectBuildUnits(deeProj, monitor); 
    7688        monitor.worked(1); 
    7789         
    78         compiler.compileModules(deeProj, monitor); 
     90        deeBuilder.compileModules(deeProj); 
    7991        monitor.worked(1); 
     92 
     93        deeBuilder.runBuilder(deeProj, monitor); 
     94        monitor.worked(1); 
     95         
    8096         
    8197        outputFolder.refreshLocal(IResource.DEPTH_INFINITE, null); 
     
    8399    } 
    84100 
    85  
    86  
    87     private IFolder prepOutputFolder(DeeProjectOptions options) throws CoreException { 
    88         IPath outputPath = options.compilerOptions.outputDir; 
    89         outputFolder = getProject().getFolder(outputPath); 
    90         if(outputFolder.exists()) { 
    91             outputFolder.delete(true, null); 
    92         } 
    93  
    94         if(!outputFolder.exists()) 
    95             outputFolder.create(IResource.DERIVED, true, null); 
    96         return outputFolder; 
    97     } 
    98101     
    99102} 
  • trunk/mmrnmhrm.core/src/mmrnmhrm/core/build/ProcessUtil.java

    r804 r906  
    2727         * using a separate thread. 
    2828         */ 
     29        @Override 
    2930        public void run() { 
    3031            BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); 
  • trunk/mmrnmhrm.core/src/mmrnmhrm/core/dltk/DeeSourceParser.java

    r804 r906  
    5959 
    6060    protected static DeeModuleDeclaration parseModule(char[] source, 
    61             int langVersion, IProblemReporter reporter, char[] fileName) { 
     61            int langVersion, IProblemReporter reporter, @SuppressWarnings("unused")    char[] fileName) { 
    6262        Parser parser = new Parser(langVersion, source); 
    6363        parser.setProblemReporter(DescentProblemAdapter.create(reporter)); 
  • trunk/mmrnmhrm.core/src/mmrnmhrm/core/dltk/search/DeeDefMatcher.java

    r804 r906  
    2626    } 
    2727     
     28    @Override 
    2829    @SuppressWarnings("restriction") 
    2930    public int match(ASTNode node, MatchingNodeSet nodeSet) { 
  • trunk/mmrnmhrm.core/src/mmrnmhrm/core/dltk/search/DeeNeoMatchLocatorParser.java

    r758 r906  
    3636    private ASTVisitor visitor = new ASTVisitor() { 
    3737 
     38        @Override 
    3839        public boolean visitGeneral(ASTNode node) throws Exception { 
    3940            processNode(node); 
     
    4243        } 
    4344 
     45        @Override 
    4446        public boolean visit(ASTNode node) throws Exception { 
    4547            processNode(node); 
  • trunk/mmrnmhrm.core/src/mmrnmhrm/core/dltk/search/DeeNeoPatternMatcher.java

    r758 r906  
    6767 
    6868 
     69    @Override 
    6970    @SuppressWarnings("restriction") 
    7071    public int match(ASTNode node, MatchingNodeSet nodeSet) { 
     
    133134    } 
    134135 
     136    @Override 
    135137    public String toString() { 
    136138        return "Locator for " + this.typeDecPattern.toString(); //$NON-NLS-1$ 
  • trunk/mmrnmhrm.core/src/mmrnmhrm/core/launch/DeeDmdInstallType.java

    r804 r906  
    2020import org.eclipse.core.runtime.Path; 
    2121import org.eclipse.core.runtime.Status; 
     22import org.eclipse.dltk.core.IBuildpathEntry; 
    2223import org.eclipse.dltk.internal.launching.AbstractInterpreterInstallType; 
    2324import org.eclipse.dltk.launching.IInterpreterInstall; 
     
    2829 
    2930    private static String[] interpreterNames = { "dmd" }; 
     31     
     32    public static boolean isStandardLibraryEntry(IBuildpathEntry entry) { 
     33        int numSegs = entry.getPath().segmentCount(); 
     34        return entry.isExternal()  
     35            && entry.getPath().isAbsolute() 
     36            && entry.getPath().lastSegment().matches("phobos") 
     37            && entry.getPath().segment(numSegs-2).matches("src"); 
     38    } 
    3039     
    3140    public static class DeeLaunchingPlugin extends DeeCore { 
     
    6776    } 
    6877     
     78    @Override 
    6979    @SuppressWarnings("unchecked") 
    70     protected org.eclipse.jface.operation.IRunnableWithProgress createLookupRunnable( 
     80    protected IRunnableWithProgress createLookupRunnable( 
    7181            final File installLocation, final List locations) { 
    7282        //return super.createLookupRunnable(installLocation, locations); 
     
    8191                    path = new Path(installLocation.getCanonicalPath()); 
    8292                    path = path.removeLastSegments(2); 
    83                     path = path.append("src").append("phobos"); 
     93                    path = path.append(new Path("src/phobos")); 
    8494                    LibraryLocation loc = new LibraryLocation(path); 
    8595                    locs.add(loc); 
     
    140150    } 
    141151 
     152 
    142153} 
  • trunk/mmrnmhrm.core/src/mmrnmhrm/core/model/DeeNature.java

    r711 r906  
    1717 
    1818    /** Configure the project with a Dee nature. */ 
     19    @Override 
    1920    public void configure() throws CoreException { 
    2021        super.configure(); 
     
    2324     
    2425    /** Remove the Dee nature from the project. */ 
     26    @Override 
    2527    public void deconfigure() throws CoreException { 
    2628        super.configure();