Changeset 906
- Timestamp:
- 11/08/07 18:47:36 (1 year ago)
- Files:
-
- trunk/dtool/META-INF/MANIFEST.MF (modified) (1 diff)
- trunk/dtool/build.properties (modified) (1 diff)
- trunk/dtool/src/dtool/ast/ASTNeoNode.java (modified) (1 diff)
- trunk/dtool/src/dtool/ast/definitions/DefUnit.java (modified) (1 diff)
- trunk/dtool/src/dtool/descentadapter/CoreConverter.java (modified) (1 diff)
- trunk/dtool/src/dtool/descentadapter/DescentASTConverter.java (modified) (2 diffs)
- trunk/mmrnmhrm.core/META-INF/MANIFEST.MF (modified) (2 diffs)
- trunk/mmrnmhrm.core/plugin.xml (modified) (2 diffs)
- trunk/mmrnmhrm.core/src/mmrnmhrm/core/DeeCore.java (modified) (2 diffs)
- trunk/mmrnmhrm.core/src/mmrnmhrm/core/build/DeeBuildOptions.java (moved) (moved from trunk/mmrnmhrm.core/src/mmrnmhrm/core/build/DeeCompilerOptions.java) (3 diffs)
- trunk/mmrnmhrm.core/src/mmrnmhrm/core/build/DeeBuilder.java (modified) (6 diffs)
- trunk/mmrnmhrm.core/src/mmrnmhrm/core/build/DeeDLTKScriptBuilder.java (modified) (1 diff)
- trunk/mmrnmhrm.core/src/mmrnmhrm/core/build/DeeProjectBuilder.java (modified) (5 diffs)
- trunk/mmrnmhrm.core/src/mmrnmhrm/core/build/ProcessUtil.java (modified) (1 diff)
- trunk/mmrnmhrm.core/src/mmrnmhrm/core/dltk/DeeSourceParser.java (modified) (1 diff)
- trunk/mmrnmhrm.core/src/mmrnmhrm/core/dltk/search/DeeDefMatcher.java (modified) (1 diff)
- trunk/mmrnmhrm.core/src/mmrnmhrm/core/dltk/search/DeeNeoMatchLocatorParser.java (modified) (2 diffs)
- trunk/mmrnmhrm.core/src/mmrnmhrm/core/dltk/search/DeeNeoPatternMatcher.java (modified) (2 diffs)
- trunk/mmrnmhrm.core/src/mmrnmhrm/core/launch/DeeDmdInstallType.java (modified) (5 diffs)
- trunk/mmrnmhrm.core/src/mmrnmhrm/core/model/DeeNature.java (modified) (2 diffs)
- trunk/mmrnmhrm.core/src/mmrnmhrm/core/model/DeeProjectOptions.java (modified) (5 diffs)
- trunk/mmrnmhrm.tests/META-INF/MANIFEST.MF (modified) (1 diff)
- trunk/mmrnmhrm.tests/src-core/dtool/tests/ref/cc/CodeCompletion_DuplicatesTest.java (modified) (2 diffs)
- trunk/mmrnmhrm.tests/src-core/dtool/tests/ref/cc/CodeCompletion__Common.java (modified) (2 diffs)
- trunk/mmrnmhrm.tests/src/mmrnmhrm/tests/ui/ref/CodeCompletion__UICommon.java (modified) (2 diffs)
- trunk/mmrnmhrm.tests/src/mmrnmhrm/ui/wizards/DeeProjectWizardTest.java (modified) (2 diffs)
- trunk/mmrnmhrm.ui/META-INF/MANIFEST.MF (modified) (2 diffs)
- trunk/mmrnmhrm.ui/plugin.xml (modified) (1 diff)
- trunk/mmrnmhrm.ui/src/melnorme/lang/ui/ExceptionHandler.java (modified) (1 diff)
- trunk/mmrnmhrm.ui/src/melnorme/util/ui/fields/StringDialogField.java (modified) (1 diff)
- trunk/mmrnmhrm.ui/src/melnorme/util/ui/swt/DialogComposite.java (modified) (1 diff)
- trunk/mmrnmhrm.ui/src/melnorme/util/ui/swt/SWTLayoutUtil.java (modified) (2 diffs)
- trunk/mmrnmhrm.ui/src/melnorme/util/ui/swt/SWTUtilExt.java (modified) (1 diff)
- trunk/mmrnmhrm.ui/src/mmrnmhrm/ui/DeePlugin.java (modified) (3 diffs)
- trunk/mmrnmhrm.ui/src/mmrnmhrm/ui/DeePluginImages.java (modified) (2 diffs)
- trunk/mmrnmhrm.ui/src/mmrnmhrm/ui/DeePluginPreferences.java (modified) (1 diff)
- trunk/mmrnmhrm.ui/src/mmrnmhrm/ui/DeeUI.java (deleted)
- trunk/mmrnmhrm.ui/src/mmrnmhrm/ui/actions/OperationsManager.java (modified) (3 diffs)
- trunk/mmrnmhrm.ui/src/mmrnmhrm/ui/editor/text/AbstractCompletionProposal.java (modified) (1 diff)
- trunk/mmrnmhrm.ui/src/mmrnmhrm/ui/editor/text/AbstractTextHover.java (modified) (5 diffs)
- trunk/mmrnmhrm.ui/src/mmrnmhrm/ui/editor/text/DeeDocTextHover.java (modified) (2 diffs)
- trunk/mmrnmhrm.ui/src/mmrnmhrm/ui/editor/text/HoverUtil.java (modified) (5 diffs)
- trunk/mmrnmhrm.ui/src/mmrnmhrm/ui/launch/DeeBuilderUIListener.java (modified) (1 diff)
- trunk/mmrnmhrm.ui/src/mmrnmhrm/ui/launch/DeeScriptArgumentsTab.java (modified) (2 diffs)
- trunk/mmrnmhrm.ui/src/mmrnmhrm/ui/preferences/DeeProjectOptionsBlock.java (modified) (8 diffs)
- trunk/mmrnmhrm.ui/src/mmrnmhrm/ui/preferences/DeeSourceColoringConfigurationBlock.java (modified) (1 diff)
- trunk/mmrnmhrm.ui/src/mmrnmhrm/ui/text/DeeSourceViewerConfiguration.java (modified) (3 diffs)
- trunk/mmrnmhrm.ui/src/mmrnmhrm/ui/wizards/DeeNewProjectCreationWizard.java (moved) (moved from trunk/mmrnmhrm.ui/src/mmrnmhrm/ui/wizards/DeeProjectCreationWizard.java) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dtool/META-INF/MANIFEST.MF
r866 r906 1 1 Manifest-Version: 1.0 2 2 Bundle-ManifestVersion: 2 3 Bundle-Name: %pluginName s3 Bundle-Name: %pluginName 4 4 Bundle-SymbolicName: dtool;singleton:=true 5 Bundle-Version: 0.2. 0.qualifier5 Bundle-Version: 0.2.2.qualifier 6 6 Bundle-ClassPath: DTool.jar 7 7 Export-Package: dtool, trunk/dtool/build.properties
r773 r906 1 1 source.DTool.jar = src/,\ 2 src-descent.core/src/,\3 src-descent.core/src-util/,\4 2 libs/ini4j-0.2.6/src/classes/ 5 3 bin.includes = META-INF/,\ trunk/dtool/src/dtool/ast/ASTNeoNode.java
r804 r906 138 138 } 139 139 140 public final void accept0( IASTVisitor visitor) {140 public final void accept0(@SuppressWarnings("unused") IASTVisitor visitor) { 141 141 Assert.fail("NEO AST elements should not use IASTVisitor"); 142 142 } trunk/dtool/src/dtool/ast/definitions/DefUnit.java
r866 r906 98 98 /** Returns signature-oriented String representation. */ 99 99 public String toStringForHoverSignature() { 100 String str = getArcheType().toString() 101 + " " + getModuleScope().toStringAsElement() + "." + getName(); 100 String str = getModuleScope().toStringAsElement() + "." + getName(); 102 101 //if(getMembersScope() != this)str += " : " + getMembersScope(); 103 102 return str; trunk/dtool/src/dtool/descentadapter/CoreConverter.java
r758 r906 7 7 import descent.internal.compiler.parser.ast.IASTNode; 8 8 9 @SuppressWarnings("unused") 9 10 public abstract class CoreConverter extends ASTCommonConverter { 10 11 trunk/dtool/src/dtool/descentadapter/DescentASTConverter.java
r758 r906 57 57 58 58 @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) { 60 61 StatementConverter conv = new StatementConverter(); 61 62 if(children == null) … … 71 72 72 73 @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) { 74 76 StatementConverter conv = new StatementConverter(); 75 77 List<T> rets = new ArrayList<T>(children.length); trunk/mmrnmhrm.core/META-INF/MANIFEST.MF
r773 r906 3 3 Bundle-Name: %pluginName 4 4 Bundle-SymbolicName: mmrnmhrm.core;singleton:=true 5 Bundle-Version: 0.2. 0.qualifier5 Bundle-Version: 0.2.2.qualifier 6 6 Bundle-Activator: mmrnmhrm.core.DeeCore 7 7 Bundle-Vendor: %pluginProvider … … 21 21 org.eclipse.jface, 22 22 org.eclipse.jface.text, 23 org.junit,24 23 org.eclipse.dltk.core, 25 24 org.eclipse.dltk.launching, trunk/mmrnmhrm.core/plugin.xml
r804 r906 98 98 </interpreterInstallType> 99 99 </extension> 100 <!-- 100 101 <extension 101 102 point="org.eclipse.dltk.core.builder"> … … 105 106 </builder> 106 107 </extension> 108 --> 107 109 <extension 108 110 point="org.eclipse.debug.core.launchConfigurationTypes"> trunk/mmrnmhrm.core/src/mmrnmhrm/core/DeeCore.java
r749 r906 35 35 36 36 /** {@inheritDoc} */ 37 @Override 37 38 public void start(BundleContext context) throws Exception { 38 39 super.start(context); … … 41 42 42 43 /** {@inheritDoc} */ 44 @Override 43 45 public void stop(BundleContext context) throws Exception { 44 46 super.stop(context); trunk/mmrnmhrm.core/src/mmrnmhrm/core/build/DeeBuildOptions.java
r773 r906 5 5 import org.eclipse.core.runtime.Platform; 6 6 7 public class Dee CompilerOptions {7 public class DeeBuildOptions { 8 8 9 9 public static enum EBuildTypes { … … 17 17 /** Project relative path */ 18 18 public IPath outputDir; 19 public String buildTool ;20 public String extraOptions;19 public String buildToolCmdLine; 20 public String buildCommands; 21 21 22 public Dee CompilerOptions(String projname) {22 public DeeBuildOptions(String projname) { 23 23 buildType = EBuildTypes.EXECUTABLE; 24 24 artifactName = projname + getOSExtension(); 25 25 outputDir = new Path(defaultOutputFolder()); 26 buildTool = "bud";27 extraOptions = "";26 buildToolCmdLine = "build -rfbuild.rf"; 27 buildCommands = DeeBuilder.getDefaultRebuildBuildFileData(); 28 28 } 29 29 … … 39 39 40 40 @Override 41 public Dee CompilerOptions clone() {42 Dee CompilerOptions options = new DeeCompilerOptions(artifactName);41 public DeeBuildOptions clone() { 42 DeeBuildOptions options = new DeeBuildOptions(artifactName); 43 43 options.buildType = buildType; 44 44 options.artifactName = artifactName; 45 45 options.outputDir = outputDir; 46 options.buildTool = buildTool; 47 options.extraOptions = extraOptions; 46 options.buildToolCmdLine = buildToolCmdLine; 47 options.buildCommands = buildCommands; 48 48 49 return options; 49 50 } trunk/mmrnmhrm.core/src/mmrnmhrm/core/build/DeeBuilder.java
r833 r906 1 1 package mmrnmhrm.core.build; 2 2 3 import static melnorme.miscutil.Assert.assertFail; 4 3 5 import java.io.ByteArrayInputStream; 6 import java.io.File; 4 7 import java.io.IOException; 5 8 import java.io.InputStream; 6 9 import java.util.ArrayList; 7 import java.util.Collections;8 10 import java.util.List; 11 import java.util.Map; 9 12 10 13 import melnorme.miscutil.StringUtil; 11 14 import mmrnmhrm.core.DeeCore; 15 import mmrnmhrm.core.launch.DeeDmdInstallType; 12 16 import mmrnmhrm.core.model.DeeModel; 13 17 import mmrnmhrm.core.model.DeeNameRules; … … 23 27 import org.eclipse.core.runtime.IProgressMonitor; 24 28 import org.eclipse.dltk.core.IBuildpathEntry; 25 import org.eclipse.dltk.core.IProjectFragment;26 29 import org.eclipse.dltk.core.IScriptProject; 27 30 … … 29 32 30 33 public 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, 43 36 DeeProjectOptions overlayOptions, IProgressMonitor monitor) { 44 37 DeeBuilder builder = new DeeBuilder(); 45 38 try { 46 builder.collectBuildUnits(deeProj, true, monitor); 39 //builder.dontCollectModules = true; 40 builder.collectBuildUnits(deeProj, monitor); 47 41 } catch (CoreException e) { 48 42 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>>"); 53 46 //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 67 90 IBuildpathEntry[] buildpathEntries = deeProj.getResolvedBuildpath(true); 68 91 … … 73 96 74 97 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); 91 99 } 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); 105 101 } 106 102 } 107 103 } 108 104 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, 110 147 IProgressMonitor monitor) throws CoreException { 111 148 … … 113 150 for (int i = 0; i < members.length; i++) { 114 151 IResource resource = members[i]; 115 processResource(entrypath, resource);116 152 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); 133 156 } else { 157 assertFail(); 134 158 } 135 159 } 136 160 } 137 161 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(); 149 194 InputStream is = new ByteArrayInputStream(buf); 150 195 if(file.exists() == false) { … … 153 198 file.setContents(is, IResource.NONE, null); 154 199 } 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); 163 255 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 202 263 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 204 279 if(cmdLine.toString().length() > 30000) 205 280 throw DeeCore.createCoreException( 206 281 "D Build: Error cannot build: cmd-line too big", null); 207 282 283 284 builder.directory(workDir.toFile()); 285 208 286 try { 209 287 Process proc = builder.start(); trunk/mmrnmhrm.core/src/mmrnmhrm/core/build/DeeDLTKScriptBuilder.java
r749 r906 13 13 import dtool.Logg; 14 14 15 @Deprecated 15 16 public class DeeDLTKScriptBuilder implements IScriptBuilder { 16 17 trunk/mmrnmhrm.core/src/mmrnmhrm/core/build/DeeProjectBuilder.java
r804 r906 34 34 private IFolder outputFolder; 35 35 36 @Override 36 37 protected void startupOnInitialize() { 37 38 assertTrue(getModelProject() != null); … … 49 50 50 51 52 @Override 51 53 protected void clean(IProgressMonitor monitor) throws CoreException { 52 54 IPath outputPath = getProjectOptions().compilerOptions.outputDir; 53 55 outputFolder = getProject().getFolder(outputPath); 54 56 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 } 57 60 } 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; 58 70 } 59 71 … … 66 78 67 79 IScriptProject deeProj = getModelProject(); 68 DeeBuilder compiler = new DeeBuilder();80 DeeBuilder deeBuilder = new DeeBuilder(); 69 81 70 82 monitor.beginTask("Building D project", 5); … … 73 85 monitor.worked(1); 74 86 75 compiler.collectBuildUnits(deeProj, monitor);87 deeBuilder.collectBuildUnits(deeProj, monitor); 76 88 monitor.worked(1); 77 89 78 compiler.compileModules(deeProj, monitor);90 deeBuilder.compileModules(deeProj); 79 91 monitor.worked(1); 92 93 deeBuilder.runBuilder(deeProj, monitor); 94 monitor.worked(1); 95 80 96 81 97 outputFolder.refreshLocal(IResource.DEPTH_INFINITE, null); … … 83 99 } 84 100 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 }98 101 99 102 } trunk/mmrnmhrm.core/src/mmrnmhrm/core/build/ProcessUtil.java
r804 r906 27 27 * using a separate thread. 28 28 */ 29 @Override 29 30 public void run() { 30 31 BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); trunk/mmrnmhrm.core/src/mmrnmhrm/core/dltk/DeeSourceParser.java
r804 r906 59 59 60 60 protected static DeeModuleDeclaration parseModule(char[] source, 61 int langVersion, IProblemReporter reporter, char[] fileName) {61 int langVersion, IProblemReporter reporter, @SuppressWarnings("unused") char[] fileName) { 62 62 Parser parser = new Parser(langVersion, source); 63 63 parser.setProblemReporter(DescentProblemAdapter.create(reporter)); trunk/mmrnmhrm.core/src/mmrnmhrm/core/dltk/search/DeeDefMatcher.java
r804 r906 26 26 } 27 27 28 @Override 28 29 @SuppressWarnings("restriction") 29 30 public int match(ASTNode node, MatchingNodeSet nodeSet) { trunk/mmrnmhrm.core/src/mmrnmhrm/core/dltk/search/DeeNeoMatchLocatorParser.java
r758 r906 36 36 private ASTVisitor visitor = new ASTVisitor() { 37 37 38 @Override 38 39 public boolean visitGeneral(ASTNode node) throws Exception { 39 40 processNode(node); … … 42 43 } 43 44 45 @Override 44 46 public boolean visit(ASTNode node) throws Exception { 45 47 processNode(node); trunk/mmrnmhrm.core/src/mmrnmhrm/core/dltk/search/DeeNeoPatternMatcher.java
r758 r906 67 67 68 68 69 @Override 69 70 @SuppressWarnings("restriction") 70 71 public int match(ASTNode node, MatchingNodeSet nodeSet) { … … 133 134 } 134 135 136 @Override 135 137 public String toString() { 136 138 return "Locator for " + this.typeDecPattern.toString(); //$NON-NLS-1$ trunk/mmrnmhrm.core/src/mmrnmhrm/core/launch/DeeDmdInstallType.java
r804 r906 20 20 import org.eclipse.core.runtime.Path; 21 21 import org.eclipse.core.runtime.Status; 22 import org.eclipse.dltk.core.IBuildpathEntry; 22 23 import org.eclipse.dltk.internal.launching.AbstractInterpreterInstallType; 23 24 import org.eclipse.dltk.launching.IInterpreterInstall; … … 28 29 29 30 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 } 30 39 31 40 public static class DeeLaunchingPlugin extends DeeCore { … … 67 76 } 68 77 78 @Override 69 79 @SuppressWarnings("unchecked") 70 protected org.eclipse.jface.operation.IRunnableWithProgress createLookupRunnable(80 protected IRunnableWithProgress createLookupRunnable( 71 81 final File installLocation, final List locations) { 72 82 //return super.createLookupRunnable(installLocation, locations); … … 81 91 path = new Path(installLocation.getCanonicalPath()); 82 92 path = path.removeLastSegments(2); 83 path = path.append( "src").append("phobos");93 path = path.append(new Path("src/phobos")); 84 94 LibraryLocation loc = new LibraryLocation(path); 85 95 locs.add(loc); … … 140 150 } 141 151 152 142 153 } trunk/mmrnmhrm.core/src/mmrnmhrm/core/model/DeeNature.java
r711 r906 17 17 18 18 /** Configure the project with a Dee nature. */ 19 @Override 19 20 public void configure() throws CoreException { 20 21 super.configure(); … … 23 24 24 25 /** Remove the Dee nature from the project. */ 26 @Override 25 27 public void deconfigure() throws CoreException { 26 28 super.configure();
