Search in sources :

Example 1 with GradleResourceCompilerConfigurationGenerator

use of org.jetbrains.plugins.gradle.config.GradleResourceCompilerConfigurationGenerator in project intellij-community by JetBrains.

the class GradleStartupActivity method runActivity.

@Override
public void runActivity(@NotNull final Project project) {
    configureBuildClasspath(project);
    showNotificationForUnlinkedGradleProject(project);
    final GradleResourceCompilerConfigurationGenerator buildConfigurationGenerator = new GradleResourceCompilerConfigurationGenerator(project);
    CompilerManager.getInstance(project).addBeforeTask(new CompileTask() {

        @Override
        public boolean execute(CompileContext context) {
            AccessToken token = ReadAction.start();
            try {
                buildConfigurationGenerator.generateBuildConfiguration(context);
            } finally {
                token.finish();
            }
            return true;
        }
    });
}
Also used : GradleResourceCompilerConfigurationGenerator(org.jetbrains.plugins.gradle.config.GradleResourceCompilerConfigurationGenerator) CompileTask(com.intellij.openapi.compiler.CompileTask) AccessToken(com.intellij.openapi.application.AccessToken) CompileContext(com.intellij.openapi.compiler.CompileContext)

Example 2 with GradleResourceCompilerConfigurationGenerator

use of org.jetbrains.plugins.gradle.config.GradleResourceCompilerConfigurationGenerator in project intellij-community by JetBrains.

the class GradleCompilingTestCase method setUpInWriteAction.

@Override
protected void setUpInWriteAction() throws Exception {
    super.setUpInWriteAction();
    final GradleResourceCompilerConfigurationGenerator buildConfigurationGenerator = new GradleResourceCompilerConfigurationGenerator(myProject);
    CompilerManager.getInstance(myProject).addBeforeTask(new CompileTask() {

        @Override
        public boolean execute(CompileContext context) {
            AccessToken token = ReadAction.start();
            try {
                buildConfigurationGenerator.generateBuildConfiguration(context);
            } finally {
                token.finish();
            }
            return true;
        }
    });
}
Also used : GradleResourceCompilerConfigurationGenerator(org.jetbrains.plugins.gradle.config.GradleResourceCompilerConfigurationGenerator) CompileTask(com.intellij.openapi.compiler.CompileTask) AccessToken(com.intellij.openapi.application.AccessToken) CompileContext(com.intellij.openapi.compiler.CompileContext)

Aggregations

AccessToken (com.intellij.openapi.application.AccessToken)2 CompileContext (com.intellij.openapi.compiler.CompileContext)2 CompileTask (com.intellij.openapi.compiler.CompileTask)2 GradleResourceCompilerConfigurationGenerator (org.jetbrains.plugins.gradle.config.GradleResourceCompilerConfigurationGenerator)2