use of com.intellij.openapi.compiler.CompileTask in project intellij-community by JetBrains.
the class MavenTasksManager method initComponent.
@Override
public void initComponent() {
if (!isNormalProject())
return;
if (isInitialized.getAndSet(true))
return;
CompilerManager compilerManager = CompilerManager.getInstance(myProject);
class MyCompileTask implements CompileTask {
private final boolean myBefore;
MyCompileTask(boolean before) {
myBefore = before;
}
@Override
public boolean execute(CompileContext context) {
return doExecute(myBefore, context);
}
}
compilerManager.addBeforeTask(new MyCompileTask(true));
compilerManager.addAfterTask(new MyCompileTask(false));
}
use of com.intellij.openapi.compiler.CompileTask in project intellij-community by JetBrains.
the class MavenProjectsManager method initComponent.
@Override
public void initComponent() {
if (!isNormalProject())
return;
StartupManagerEx startupManager = StartupManagerEx.getInstanceEx(myProject);
startupManager.registerStartupActivity(() -> {
boolean wasMavenized = !myState.originalFiles.isEmpty();
if (!wasMavenized)
return;
initMavenized();
});
startupManager.registerPostStartupActivity(() -> {
if (!isMavenizedProject()) {
showNotificationOrphanMavenProject(myProject);
}
CompilerManager.getInstance(myProject).addBeforeTask(new CompileTask() {
@Override
public boolean execute(CompileContext context) {
AccessToken token = ReadAction.start();
try {
new MavenResourceCompilerConfigurationGenerator(myProject, myProjectsTree).generateBuildConfiguration(context.isRebuild());
} finally {
token.finish();
}
return true;
}
});
});
}
use of com.intellij.openapi.compiler.CompileTask in project intellij-community by JetBrains.
the class ExternalSystemTaskActivator method init.
public void init() {
CompilerManager compilerManager = CompilerManager.getInstance(myProject);
class MyCompileTask implements CompileTask {
private final boolean myBefore;
MyCompileTask(boolean before) {
myBefore = before;
}
@Override
public boolean execute(CompileContext context) {
return doExecuteCompileTasks(myBefore, context);
}
}
compilerManager.addBeforeTask(new MyCompileTask(true));
compilerManager.addAfterTask(new MyCompileTask(false));
fireTasksChanged();
}
use of com.intellij.openapi.compiler.CompileTask in project intellij-community by JetBrains.
the class ClassFilesIndexFeaturesHolder method projectOpened.
@Override
public final void projectOpened() {
for (final ClassFilesIndexFeature feature : ClassFilesIndexFeature.values()) {
final RegistryValue registryValue = feature.getRegistryValue();
registryValue.addListener(new RegistryValueListener.Adapter() {
@Override
public void afterValueChanged(final RegistryValue rawValue) {
if (!rawValue.asBoolean() && myEnabledFeatures.containsKey(feature)) {
disposeFeature(feature);
}
}
}, myProject);
}
final CompilerManager compilerManager = CompilerManager.getInstance(myProject);
compilerManager.addBeforeTask(new CompileTask() {
@Override
public boolean execute(final CompileContext context) {
close();
return true;
}
});
}
use of com.intellij.openapi.compiler.CompileTask 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;
}
});
}
Aggregations