Skip to content

Commit

Permalink
cnf change: prevent build disabling 'Build automatically'
Browse files Browse the repository at this point in the history
This improves the DX in the following scenario:
When you edit /cnf/build.bnd and you Save the file before this fix a FULL build was always triggered, even if Project / Build Automatically was disabled. (and such a build can take very long and can become anoying in cases where you need tweak build.bnd)
Now a build is only triggered if Build Automatically  is enabled. This at least gives the developer a knob to disable the build-on-change behavior in cases where you work on the file and want to save it a few times along the way.

Note: The "Reload Workspace" Button in the Bndtools Explorer is not affected by this change and still triggeres a FULL build regardless of the Build Automatically setting (which is desired, because this Reload Button should act like a 'force build'

Signed-off-by: Christoph Rueger <[email protected]>

Revert "cnf change: prevent build disabling 'Build automatically'"

This reverts commit dcd301e.

cnf change: prevent build when 'Build automatically' is disabled

This improves the DX in the following scenario:
When you edit /cnf/build.bnd and you Save the file before this fix a FULL build was always triggered, even if Project / Build Automatically was disabled. (and such a build can take very long and can become anoying in cases where you need tweak build.bnd)
Now a build is only triggered if Build Automatically is enabled. This at least gives the developer a knob to disable the build-on-change behavior in cases where you work on the file and want to save it a few times along the way.

Note: The "Reload Workspace" Button in the Bndtools Explorer is also affected by this change and does not trigger a FULL build. This behavior is useful so that validation of cnf/build.bnd kicks in and you see e.g. Problem markers, without triggering a build

Signed-off-by: Christoph Rueger <[email protected]>
  • Loading branch information
chrisrueger committed Dec 7, 2024
1 parent f9b2c85 commit 9ad0381
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions bndtools.core/src/bndtools/central/sync/WorkspaceChange.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ private IStatus done0(IProgressMonitor monitor) {
if (cancel || monitor.isCanceled())
return Status.CANCEL_STATUS;

if (!ResourcesPlugin.getWorkspace()
.isAutoBuilding()) {
return Status.warning(
"[cnf change] Skip FULL build, because 'Build Automatically' is disabled.");
}

workspace.build(IncrementalProjectBuilder.FULL_BUILD, monitor);
} catch (CoreException e) {
return Status.error("trying to build", e);
Expand Down
3 changes: 2 additions & 1 deletion bndtools.core/src/bndtools/explorer/BndtoolsExplorer.java
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ private boolean isSelected(IProject project, String name) {
}

private Action reloadAction() {
Action rebuild = new Action("Reload workspace", Icons.desc("refresh")) {
Action rebuild = new Action("Reload workspace (Rebuilds all projects if 'Build Automatically' is enabled)",
Icons.desc("refresh")) {
WorkspaceSynchronizer s;

@Override
Expand Down

0 comments on commit 9ad0381

Please sign in to comment.