Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] How to distinguish debug builds from ordinary builds

Hi Gerald,

1) You can start the build with the
ResourcesPlugin.getWorkspace().build(int kind, IProgressMonitor monitor)

After that you need to wait until the build is finished.  For example:

    /**
     * Wait for builds to complete
     */
    public static void waitForBuild() {
        boolean wasInterrupted = false;
        do {
            try {
                Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
                Job.getJobManager().join(ResourcesPlugin.FAMILY_MANUAL_BUILD, null);
                wasInterrupted = false;
            } catch (OperationCanceledException e) {
                e.printStackTrace();
            } catch (InterruptedException e) {
                wasInterrupted = true;
            }
        } while (wasInterrupted);
    }	

2) You should pass options to the builder thru the project preferences.

But actually I would recommend to use the same approach as JDT - always compile the files with the debugging information and just use the different ways to launch. So you don't need to rebuild the project when different launch mode is used.

Regards,
Alex

----- Original Message -----
From: "Gerald Rosenberg" <gerald@xxxxxxxxxx>
To: "DLTK Developer Discussions" <dltk-dev@xxxxxxxxxxx>
Sent: Friday, December 5, 2008 1:18:58 PM GMT +06:00 Almaty, Novosibirsk
Subject: [Dltk-dev] How to distinguish debug builds from ordinary builds


Would appreciate some help with a problem, two actually. 

In launching a script, I need to (1) force a build of the specific script being launched and (2) differentiate the build based on whether the launch is a debug launch or a standard launch -- I need to alter the script compiler flags to add a debug flag for debug launches. 

For the first issue, I have been looking at JavaLaunchDelegate#launch, accessible from my LaunchConfigurationDelegate extends ScriptLaunchDelegate , but not sure that will give me a way to force the build. 

For the second, the delegate has access to the mode flag, so the question is how best to pass the flag to the builder before the build occurs. 

Thanks! 
_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev


Back to the top