Changeset 3642 for devel-tools


Ignore:
Timestamp:
Mar 31, 2008, 5:53:45 PM (13 years ago)
Author:
yura
Message:
  • RfpPreBuilder? - build interface for refal modules (they are used in Java builder).
Location:
devel-tools/trunk/eclipse/org.refal.rfpdt.core
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/plugin.xml

    r3626 r3642  
    1212   </extension>
    1313   <extension
     14         id="rfpPreBuilder"
     15         name="Refal Plus Project Pre Builder"
     16         point="org.eclipse.core.resources.builders">
     17      <builder
     18            hasNature="true">
     19         <run class="org.refal.rfpdt.core.RfpPreBuilder"/>
     20      </builder>
     21   </extension>
     22   <extension
    1423         id="rfpNature"
    1524         name="Refal Plus Project Nature"
     
    1827         <run class="org.refal.rfpdt.core.RfpNature"/>
    1928      </runtime>
     29      <builder id="org.refal.rfpdt.core.rfpPreBuilder"/>
    2030      <builder id="org.refal.rfpdt.core.rfpBuilder"/>
    2131      <requires-nature id="org.eclipse.jdt.core.javanature"/>
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core/RfpBuilder.java

    r3633 r3642  
    336336        if (!isRfFile(resource))
    337337            return;
    338         final IFile file = (IFile) resource;
     338        IFile file = (IFile) resource;
    339339        deleteMarkers(file);
    340         deleteClassFiles(file);
    341         final CompilerEnvironment environment = new IdeCompilerEnvironment(getRfpProject(), file);
     340        CompilerEnvironment environment = new IdeCompilerEnvironment(getRfpProject(), file);
    342341        AstImplem astImplem = Checker.getModuleImplementation(environment);
    343342        if (environment.getMsgHandler().getErrorCount() > 0)
     
    347346            Result res = new Result();
    348347            rfpc.CompileASToJBC(ast, res);
     348            deleteClassFiles(file);
    349349            for (Comparable<?> p : res.getExpr()) {
    350350                Expr e = (Expr) p;
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core/RfpCore.java

    r3638 r3642  
    2424    public static final String NATURE_ID = "org.refal.rfpdt.core.rfpNature";
    2525    public static final String BUILDER_ID = "org.refal.rfpdt.core.rfpBuilder";
     26    public static final String PRE_BUILDER_ID = "org.refal.rfpdt.core.rfpPreBuilder";
    2627    public static final String MARKER_ID = "org.refal.rfpdt.core.rfpProblemMarker";
    2728    public static final String RFP_CONTAINER = "org.refal.rfpdt.launching.rfpContainer";
  • devel-tools/trunk/eclipse/org.refal.rfpdt.core/src/org/refal/rfpdt/core/RfpNature.java

    r3569 r3642  
    1414
    1515public class RfpNature implements IProjectNature {
    16     private static final String EXCLUSION_FILTER_ID = "org.eclipse.jdt.core.builder.resourceCopyExclusionFilter";
    1716    private static final String EXCLUSION_EXTENTIONS = "*.rf,*.rfi";
    1817
     
    2019
    2120    public void configure () throws CoreException {
    22         // setup builder
    2321        IProjectDescription projectDesc = project.getDescription();
    2422        ICommand[] commands = projectDesc.getBuildSpec();
     
    2624            if (RfpCore.BUILDER_ID.equals(command.getBuilderName()))
    2725                return;
    28         ICommand[] newCommands = new ICommand[commands.length + 1];
    29         System.arraycopy(commands, 0, newCommands, 0, commands.length);
    30         ICommand command = projectDesc.newCommand();
    31         command.setBuilderName(RfpCore.BUILDER_ID);
    32         newCommands[commands.length] = command;
     26        // setup builder
     27        ICommand[] newCommands = new ICommand[commands.length + 2];
     28        ICommand command1 = projectDesc.newCommand();
     29        command1.setBuilderName(RfpCore.PRE_BUILDER_ID);
     30        newCommands[0] = command1;
     31        System.arraycopy(commands, 0, newCommands, 1, commands.length);
     32        ICommand command2 = projectDesc.newCommand();
     33        command2.setBuilderName(RfpCore.BUILDER_ID);
     34        newCommands[commands.length + 1] = command2;
    3335        projectDesc.setBuildSpec(newCommands);
    3436        project.setDescription(projectDesc, null);
     
    4951        javaProject.setRawClasspath(entriesNew, null);
    5052        // setup exclusion filter for coping files to output folder
    51         String filters = javaProject.getOption(EXCLUSION_FILTER_ID, true);
     53        String filters = javaProject.getOption(JavaCore.CORE_JAVA_BUILD_RESOURCE_COPY_FILTER, true);
    5254        if (filters == null)
    5355            filters = "";
     
    5557            filters += ",";
    5658        filters += EXCLUSION_EXTENTIONS;
    57         javaProject.setOption(EXCLUSION_FILTER_ID, filters);
     59        javaProject.setOption(JavaCore.CORE_JAVA_BUILD_RESOURCE_COPY_FILTER, filters);
     60        javaProject.setOption(JavaCore.CORE_JAVA_BUILD_CLEAN_OUTPUT_FOLDER, JavaCore.IGNORE);
     61
    5862        javaProject.save(null, true);
    5963    }
     
    6266        IProjectDescription projectDesc = getProject().getDescription();
    6367        ICommand[] commands = projectDesc.getBuildSpec();
    64         for (int i = 0; i < commands.length; i++)
    65             if (RfpCore.BUILDER_ID.equals(commands[i].getBuilderName())) {
     68        for (int i = 0; i < commands.length; i++) {
     69            String commandName = commands[i].getBuilderName();
     70            if (commandName != null
     71                    && (commandName.equals(RfpCore.BUILDER_ID) || commandName.equals(RfpCore.PRE_BUILDER_ID))) {
    6672                ICommand[] newCommands = new ICommand[commands.length - 1];
    6773                System.arraycopy(commands, 0, newCommands, 0, i);
    6874                System.arraycopy(commands, i + 1, newCommands, i, commands.length - i - 1);
    69                 projectDesc.setBuildSpec(newCommands);
    70                 break;
     75                commands = newCommands;
    7176            }
     77        }
     78        projectDesc.setBuildSpec(commands);
    7279    }
    7380
Note: See TracChangeset for help on using the changeset viewer.