Java Code Examples for org.netbeans.spi.project.ActionProvider#COMMAND_BUILD

The following examples show how to use org.netbeans.spi.project.ActionProvider#COMMAND_BUILD . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RootProjectActionProvider.java    From NBANDROID-V2 with Apache License 2.0 6 votes vote down vote up
@Override
public void invokeAction(String command, Lookup context) throws IllegalArgumentException {
    if (project.getLookup().lookup(GradleBuild.class) != null) {
        switch (command) {
            case ActionProvider.COMMAND_REBUILD:
                callGradleRebuild();
                break;
            case ActionProvider.COMMAND_BUILD:
                callGradleBuild();
                break;
            case ActionProvider.COMMAND_CLEAN:
                callGradleClean();
                break;
            case AndroidConstants.COMMAND_BUILD_TEST:
                callAndroidTest();
                break;
        }
    }

}
 
Example 2
Source File: Actions.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public static Action buildProject() {
    Action a = new ProjectAction (
        ActionProvider.COMMAND_BUILD, 
        NbBundle.getMessage(Actions.class, "LBL_BuildProjectAction_Name"),
        NbBundle.getMessage(Actions.class, "LBL_BuildProjectAction_Name_popup"),
        null,
        null );  
    a.putValue("iconBase","org/netbeans/modules/project/ui/resources/buildCurrentProject.gif"); //NOI18N
    return a;
}
 
Example 3
Source File: Actions.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public static Action buildMainProject() {
    Action a = new MainProjectAction (
        ActionProvider.COMMAND_BUILD, 
        NbBundle.getMessage(Actions.class, "LBL_BuildMainProjectAction_Name" ),null);  //NOI18N
    a.putValue("iconBase","org/netbeans/modules/project/ui/resources/buildProject.png"); //NOI18N
    return a;
}
 
Example 4
Source File: AndroidProjectActionProvider.java    From NBANDROID-V2 with Apache License 2.0 5 votes vote down vote up
@Override
public String[] getSupportedActions() {
    return new String[]{ActionProvider.COMMAND_REBUILD, ActionProvider.COMMAND_BUILD,
        AndroidConstants.COMMAND_BUILD_TEST,
        ActionProvider.COMMAND_CLEAN,
        ActionProvider.COMMAND_RUN,
        ActionProvider.COMMAND_TEST,
        ActionProvider.COMMAND_DEBUG,};
}
 
Example 5
Source File: AndroidProjectActionProvider.java    From NBANDROID-V2 with Apache License 2.0 5 votes vote down vote up
@Override
public void invokeAction(String command, Lookup context) throws IllegalArgumentException {
     switch (command) {
            case ActionProvider.COMMAND_REBUILD:
                callGradleRebuild();
                break;
            case ActionProvider.COMMAND_BUILD:
                callGradleBuild();
                break;
            case ActionProvider.COMMAND_CLEAN:
                callGradleClean();
                break;
        }
    if (project.getLookup().lookup(AndroidProject.class) != null) {
        switch (command) {
            case AndroidConstants.COMMAND_BUILD_TEST:
                callAndroidTest();
                break;
            case ActionProvider.COMMAND_RUN:
                callLaunch(COMMAND_RUN);
                break;
            case ActionProvider.COMMAND_DEBUG:
                callLaunch(COMMAND_DEBUG);
                break;
        }
    }
}
 
Example 6
Source File: JavaActionProvider.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@NonNull
public ScriptAction createDefaultScriptAction(
        @NonNull final String command,
        final boolean javaModelSensitive,
        final boolean scanSensitive,
        final boolean enabledInCoS,
        @NonNull final Supplier<? extends String[]> targets,
        @NullAllowed final CustomFileExecutor customFileExecutor) {
    Parameters.notNull("command", command);         //NOI18N
    Parameters.notNull("targets", targets);         //NOI18N
    switch (command) {
        case ActionProvider.COMMAND_CLEAN:
            return createNonCosAction(command, false, javaModelSensitive, scanSensitive, enabledInCoS, targets, Collections.emptyMap());
        case ActionProvider.COMMAND_REBUILD:
            return createNonCosAction(command, true, javaModelSensitive, scanSensitive, enabledInCoS, targets, Collections.emptyMap());
        case ActionProvider.COMMAND_BUILD:
            return createBuildAction(javaModelSensitive, scanSensitive, enabledInCoS, targets, mfs);
        case ActionProvider.COMMAND_RUN:
        case ActionProvider.COMMAND_DEBUG:
        case ActionProvider.COMMAND_DEBUG_STEP_INTO:
        case ActionProvider.COMMAND_PROFILE:
            return createRunAction(command, javaModelSensitive, scanSensitive, enabledInCoS, targets, mfs, mainClassServices);
        case ActionProvider.COMMAND_TEST:
            return createNonCosAction(command, true, javaModelSensitive, scanSensitive, enabledInCoS, targets, Collections.singletonMap("ignore.failing.tests", "true"));  //NOI18N);
        case ActionProvider.COMMAND_COMPILE_SINGLE:
            return createCompileSingleAction(javaModelSensitive, scanSensitive, enabledInCoS, sourceRoots, testRoots, targets);
        case ActionProvider.COMMAND_RUN_SINGLE:
        case ActionProvider.COMMAND_DEBUG_SINGLE:
        case ActionProvider.COMMAND_PROFILE_SINGLE:
            return createRunSingleAction(
                    command, javaModelSensitive, scanSensitive, enabledInCoS,
                    sourceRoots, testRoots, targets, customFileExecutor);
        case ActionProvider.COMMAND_TEST_SINGLE:
            return createTestSingleAction(javaModelSensitive, scanSensitive, enabledInCoS, sourceRoots, testRoots, targets);
        case ActionProvider.COMMAND_DEBUG_TEST_SINGLE:
        case ActionProvider.COMMAND_PROFILE_TEST_SINGLE:
            return createDebugTestSingleAction(command, javaModelSensitive, scanSensitive, enabledInCoS, sourceRoots, testRoots, targets);
        case SingleMethod.COMMAND_RUN_SINGLE_METHOD:
        case SingleMethod.COMMAND_DEBUG_SINGLE_METHOD:
            return createRunSingleMethodAction(command, javaModelSensitive, scanSensitive, enabledInCoS, testRoots, targets);
        case JavaProjectConstants.COMMAND_DEBUG_FIX:
            return createDebugFixAction(command, javaModelSensitive, scanSensitive, enabledInCoS, sourceRoots, testRoots, targets);
        default:
            throw new UnsupportedOperationException(String.format("Unsupported command: %s", command)); //NOI18N
    }
}
 
Example 7
Source File: RootProjectActionProvider.java    From NBANDROID-V2 with Apache License 2.0 4 votes vote down vote up
@Override
public String[] getSupportedActions() {
    return new String[]{ActionProvider.COMMAND_REBUILD, ActionProvider.COMMAND_BUILD,
        AndroidConstants.COMMAND_BUILD_TEST,
        ActionProvider.COMMAND_CLEAN,};
}