Changeset 3524 for devel-tools/trunk


Ignore:
Timestamp:
Mar 14, 2008, 3:55:30 PM (13 years ago)
Author:
yura
Message:
Location:
devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core/RfpBuilder.java

    r3523 r3524  
    5050        return RfpCore.getRfpProject(getProject());
    5151    }
    52    
     52
    5353    private void createClassFile (String className, byte[] bytes) {
    5454        try {
    5555            IFile classFile = getRfpProject().getClassFile(className);
     56            if (classFile.exists())
     57                classFile.delete(true, false, null);
    5658            InputStream inputStream = new ByteArrayInputStream(bytes);
    5759            classFile.create(inputStream, true, null);
     
    6668        RfpProject rfpProject = getRfpProject();
    6769        String moduleName = rfpProject.getModuleName(file);
    68         IFile classFile =  rfpProject.getClassFile(moduleName);
     70        IFile classFile = rfpProject.getClassFile(moduleName);
    6971        try {
    7072            for (int i = 0; true; i++) {
     
    175177                for (IClasspathEntry entry : project.getJavaProject().getRawClasspath())
    176178                    if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
    177                         IClasspathContainer container = JavaCore.getClasspathContainer(entry.getPath(),
    178                                 project.getJavaProject());
     179                        IClasspathContainer container = JavaCore.getClasspathContainer(entry.getPath(), project
     180                                .getJavaProject());
    179181                        for (IClasspathEntry entry2 : container.getClasspathEntries()) {
    180182                            if (entry2.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
     
    264266        IProject project = getProject();
    265267        project.deleteMarkers(RfpCore.MARKER_ID, false, IResource.DEPTH_INFINITE);
    266 
    267         project.accept(new IResourceVisitor() {
    268             public boolean visit (IResource resource) throws CoreException {
    269                 if (isRfFile(resource))
    270                     deleteClassFiles((IFile) resource);
    271                 return true;
    272             }
    273         });
     268       
     269        // We are relying on JavaBuilder for cleaning.
     270        // project.accept(new IResourceVisitor() {
     271        // public boolean visit (IResource resource) throws CoreException {
     272        // if (isRfFile(resource))
     273        // deleteClassFiles((IFile) resource);
     274        // return true;
     275        // }
     276        // });
    274277    }
    275278
     
    304307            return null;
    305308        deleteMarkers(file);
    306         CompilerEnvironment environment = new IdeCompilerEnvironment(RfpCore.getRfpProject(project), file, new StringReader(document));
     309        CompilerEnvironment environment = new IdeCompilerEnvironment(RfpCore.getRfpProject(project), file,
     310                new StringReader(document));
    307311        AstImplem astImplem = Checker.getModuleImplementation(environment);
    308312        return astImplem;
     
    357361                    case IResourceDelta.CHANGED:
    358362                        if (isRfFile(resource) || isRfiFile(resource)) {
    359                             SortedSet<String> dependentModuleSet = dependencies.get(getRfpProject().getModuleName((IFile) resource));
     363                            SortedSet<String> dependentModuleSet = dependencies.get(getRfpProject().getModuleName(
     364                                    (IFile) resource));
    360365                            if (dependentModuleSet != null)
    361366                                modulesToRecompile.addAll(dependentModuleSet);
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core/RfpNature.java

    r3523 r3524  
    2222        IProjectDescription desc = project.getDescription();
    2323        ICommand[] commands = desc.getBuildSpec();
    24         for (int i = 0; i < commands.length; i++)
    25             if (commands[i].getBuilderName().equals(RfpCore.BUILDER_ID))
     24        for (ICommand command : commands)
     25            if (command.getBuilderName().equals(RfpCore.BUILDER_ID))
    2626                return;
    2727        ICommand[] newCommands = new ICommand[commands.length + 1];
     28        System.arraycopy(commands, 0, newCommands, 0, commands.length);
    2829        ICommand command = desc.newCommand();
    2930        command.setBuilderName(RfpCore.BUILDER_ID);
    30         newCommands[0] = command;
    31         System.arraycopy(commands, 0, newCommands, 1, commands.length);
     31        newCommands[commands.length] = command;
    3232        desc.setBuildSpec(newCommands);
    3333        project.setDescription(desc, null);
    34 
    3534        { // setup the .classpath
    3635            IJavaProject javaProject = RfpCore.getRfpProject(project).getJavaProject();
Note: See TracChangeset for help on using the changeset viewer.