use of org.jetbrains.android.compiler.AndroidAutogeneratorMode in project android by JetBrains.
the class AndroidProjectComponent method generate.
private void generate(final Map<AndroidFacet, Collection<AndroidAutogeneratorMode>> facetsToProcess) {
TransactionGuard.getInstance().submitTransactionAndWait(() -> AndroidCompileUtil.createGenModulesAndSourceRoots(myProject, facetsToProcess.keySet()));
for (Map.Entry<AndroidFacet, Collection<AndroidAutogeneratorMode>> entry : facetsToProcess.entrySet()) {
final AndroidFacet facet = entry.getKey();
final Collection<AndroidAutogeneratorMode> modes = entry.getValue();
for (AndroidAutogeneratorMode mode : modes) {
AndroidCompileUtil.doGenerate(facet, mode);
}
}
}
use of org.jetbrains.android.compiler.AndroidAutogeneratorMode in project android by JetBrains.
the class AndroidProjectComponent method createAlarmForAutogeneration.
private void createAlarmForAutogeneration() {
DumbService service = DumbService.getInstance(myProject);
final Alarm alarm = new Alarm(Alarm.ThreadToUse.POOLED_THREAD, myDisposable);
alarm.addRequest(new Runnable() {
@Override
public void run() {
Map<AndroidFacet, Collection<AndroidAutogeneratorMode>> facetsToProcess = service.runReadActionInSmartMode(() -> checkGenerate());
if (facetsToProcess.size() > 0) {
generate(facetsToProcess);
}
if (!alarm.isDisposed()) {
alarm.addRequest(this, 2000);
}
}
}, 2000);
}
Aggregations