public void adjustTaskGroupAssignments()
    {
        final TaskContainer tasks = project.getTasks();
        tasks.getByName(BasePlugin.ASSEMBLE_TASK_NAME).setGroup(ARTIFACTS_GROUP_NAME);
        tasks.getByName(JavaPlugin.JAR_TASK_NAME).setGroup(ARTIFACTS_GROUP_NAME);

        final SourceSet sqSourceSet = buildUtil.getSourceSet(BuildUtil.SONARQUBE_SOURCE_SET_NAME);
        tasks.getByName(JavaPlugin.COMPILE_JAVA_TASK_NAME).setGroup(BasePlugin.BUILD_GROUP);
        tasks.getByName(sqSourceSet.getCompileJavaTaskName()).setGroup(BasePlugin.BUILD_GROUP);
        tasks.getByName(JavaPlugin.COMPILE_TEST_JAVA_TASK_NAME).setGroup(BasePlugin.BUILD_GROUP);

        for (final SpotBugsTask sbTask : tasks.withType(SpotBugsTask.class)) {
            sbTask.setGroup(LifecycleBasePlugin.VERIFICATION_GROUP);
        }
        for (final Checkstyle csTask : tasks.withType(Checkstyle.class)) {
            csTask.setGroup(LifecycleBasePlugin.VERIFICATION_GROUP);
        }
        for (final Copy task : tasks.withType(Copy.class)) {
            if (task.getName().startsWith("process") && task.getName().endsWith("Resources")) {
                task.setGroup(LifecycleBasePlugin.BUILD_GROUP);
            }
        }
    }
public void adjustTaskGroupAssignments ( ) { final TaskContainer tasks = project . getTasks ( ) ; tasks . getByName ( BasePlugin . ASSEMBLE_TASK_NAME ) . setGroup ( ARTIFACTS_GROUP_NAME ) ; tasks . getByName ( JavaPlugin . JAR_TASK_NAME ) . setGroup ( ARTIFACTS_GROUP_NAME ) ; final SourceSet sqSourceSet = buildUtil . getSourceSet ( BuildUtil . SONARQUBE_SOURCE_SET_NAME ) ; tasks . getByName ( JavaPlugin . COMPILE_JAVA_TASK_NAME ) . setGroup ( BasePlugin . BUILD_GROUP ) ; tasks . getByName ( sqSourceSet . getCompileJavaTaskName ( ) ) . setGroup ( BasePlugin . BUILD_GROUP ) ; tasks . getByName ( JavaPlugin . COMPILE_TEST_JAVA_TASK_NAME ) . setGroup ( BasePlugin . BUILD_GROUP ) ; for ( final SpotBugsTask sbTask : tasks . withType ( SpotBugsTask . class ) ) { sbTask . setGroup ( LifecycleBasePlugin . VERIFICATION_GROUP ) ; } for ( final Checkstyle csTask : tasks . withType ( Checkstyle . class ) ) { csTask . setGroup ( LifecycleBasePlugin . VERIFICATION_GROUP ) ; } for ( final Copy task : tasks . withType ( Copy . class ) ) { if ( task . getName ( ) . startsWith ( "process" ) && task . getName ( ) . endsWith ( "Resources" ) ) { task . setGroup ( LifecycleBasePlugin . BUILD_GROUP ) ; } } }
Assign some standard tasks and tasks created by third-party plugins to their task groups according to the
order of things for Checkstyle Addons.