use of org.jetbrains.android.compiler.AndroidPrecompileTask in project android by JetBrains.
the class AndroidProjectComponent method projectOpened.
@Override
public void projectOpened() {
final CompilerManager manager = CompilerManager.getInstance(myProject);
manager.addBeforeTask(new AndroidPrecompileTask());
myDisposable = Disposer.newDisposable(getClass().getName());
if (!ApplicationManager.getApplication().isUnitTestMode() && !ApplicationManager.getApplication().isHeadlessEnvironment()) {
if (ProjectFacetManager.getInstance(myProject).hasFacets(AndroidFacet.ID)) {
createAndroidSpecificComponents();
} else {
final MessageBusConnection connection = myProject.getMessageBus().connect(myDisposable);
connection.subscribe(FacetManager.FACETS_TOPIC, new FacetManagerAdapter() {
@Override
public void facetAdded(@NotNull Facet facet) {
if (facet instanceof AndroidFacet) {
createAndroidSpecificComponents();
connection.disconnect();
}
}
});
}
}
}
Aggregations