Skip to content

Commit

Permalink
Add configuration of parallel build and build process heap size
Browse files Browse the repository at this point in the history
  • Loading branch information
nailujx86 committed May 19, 2024
1 parent 148e813 commit 4babad8
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ public void actionPerformed(@NotNull AnActionEvent e) {
// we open the file
OpenFileAction.openFile(updateHandlerFile, project);
Document document = FileDocumentManager.getInstance().getDocument(updateHandlerFile);
PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(document);
IdeView ideView = e.getData(LangDataKeys.IDE_VIEW);
if (psiFile != null && ideView != null) {
// and then focus the project/file view on the file
ideView.selectElement(psiFile);
if (document != null) {
PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(document);
IdeView ideView = e.getData(LangDataKeys.IDE_VIEW);
if (psiFile != null && ideView != null) {
// and then focus the project/file view on the file
ideView.selectElement(psiFile);
}
}
ActionManager actionManager = ActionManager.getInstance();
AnAction codeCompletion = actionManager.getAction("CodeCompletion");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class CreateAutoconfigFileForm {
private JPanel form;

public CreateAutoconfigFileForm(List<UpdateHandler<?>> handlers) {
ComboBoxModel<HandlerComboBoxWrapper> comboBoxModel = new DefaultComboBoxModel<HandlerComboBoxWrapper>(handlers.stream().map(HandlerComboBoxWrapper::new).toArray(HandlerComboBoxWrapper[]::new));
ComboBoxModel<HandlerComboBoxWrapper> comboBoxModel = new DefaultComboBoxModel<>(handlers.stream().map(HandlerComboBoxWrapper::new).toArray(HandlerComboBoxWrapper[]::new));
handlerSelection.setModel(comboBoxModel);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ public List<String> updateConfiguration(JavaConfiguration configuration, Project
ProcessorConfigProfile defaultProcessorProfile = compilerConfiguration.getDefaultProcessorProfile();
applySetting(annotationProcessor.getEnable(), defaultProcessorProfile.isEnabled(), defaultProcessorProfile::setEnabled, changedConfigs, "Enable annotation processor");
}

Boolean parallelCompilation = compiler.getParallelCompilation();
if (parallelCompilation != null) {
applySetting(parallelCompilation, compilerConfiguration.isParallelCompilationEnabled(), compilerConfiguration::setParallelCompilationEnabled, changedConfigs, "Enable parallel compilation");
}

Integer buildProcessHeapSize = compiler.getBuildProcessHeapSize();
if (buildProcessHeapSize != null) {
applySetting(buildProcessHeapSize, compilerConfiguration.getBuildProcessHeapSize(0), compilerConfiguration::setBuildProcessHeapSize, changedConfigs, "Build process heap size");
}
}
return changedConfigs;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/schema/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
},
"mode": {
"type": "string",
"description": "Reload on any changes or only reload on external changes/from version control?",
"description": "Reload on any changes or only reload on external changes for example from version control?",
"enum": [
"any-changes",
"external-changes"
Expand All @@ -88,7 +88,7 @@
"description": "Reload on any changes on project configuration files"
},
"external-changes": {
"description": "Reload on external changes on project configuration files e.g. from version control"
"description": "Reload on external changes on project configuration files for example from version control"
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions src/main/resources/schema/java.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
"description": "Enable or disable annotation processing"
}
}
},
"parallelCompilation": {
"type": "boolean",
"description": "Whether to compile independent java modules in parallel. Greatly increases build speed but requires larger build process heap size."
},
"buildProcessHeapSize": {
"type": "integer",
"description": "Shared build process heap size in megabytes."
}
}
}
Expand Down

0 comments on commit 4babad8

Please sign in to comment.