Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): Bump spock-core from 2.1-groovy-3.0 to 2.3-groovy-4.0 in /gradle-plugins #97

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 27 additions & 18 deletions biz.aQute.bndlib/src/aQute/bnd/build/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -1966,30 +1966,34 @@ public File[] buildLocal(boolean underTest) throws Exception {
return null;
}

Map<File, Resource> exports = builder.doExports(selectedRunFiles);

getInfo(builder);

if (!isOk()) {
return null;
}

for (Map.Entry<File, Resource> ee : exports.entrySet()) {
try (Resource resource = ee.getValue()) {
File outputFile = ee.getKey();
File actual = write(resource::write, outputFile);
if (!selectedRunFiles.isEmpty()) {
Map<File, Resource> exports = builder.doExports(selectedRunFiles);

if (actual != null) {
buildFilesSet.add(actual);
} else {
error("Could not save %s", outputFile);
getInfo(builder);

if (isOk()) {

for (Map.Entry<File, Resource> ee : exports.entrySet()) {
try (Resource resource = ee.getValue()) {
File outputFile = ee.getKey();
File actual = write(resource::write, outputFile);

if (actual != null) {
buildFilesSet.add(actual);
} else {
error("Could not save %s", outputFile);
}
}
}
}
}

if (!isOk()) {
return null;
}

boolean bfsWrite = !bfs.exists() || (lastModified > bfs.lastModified());
if (buildfiles != null) {
Expand Down Expand Up @@ -2622,7 +2626,8 @@ public Jar getValidJar(Jar jar, String id) throws Exception {
return jar;
}

public String _project(@SuppressWarnings("unused") String args[]) {
public String _project(@SuppressWarnings("unused")
String args[]) {
return IO.absolutePath(getBase());
}

Expand Down Expand Up @@ -2713,7 +2718,8 @@ public void action(String command, Object... args) throws Exception {
/**
* Run all before command plugins
*/
void before(@SuppressWarnings("unused") Project p, String a) {
void before(@SuppressWarnings("unused")
Project p, String a) {
List<CommandPlugin> testPlugins = getPlugins(CommandPlugin.class);
for (CommandPlugin testPlugin : testPlugins) {
testPlugin.before(this, a);
Expand All @@ -2723,7 +2729,8 @@ void before(@SuppressWarnings("unused") Project p, String a) {
/**
* Run all after command plugins
*/
void after(@SuppressWarnings("unused") Project p, String a, Throwable t) {
void after(@SuppressWarnings("unused")
Project p, String a, Throwable t) {
List<CommandPlugin> testPlugins = getPlugins(CommandPlugin.class);
for (int i = testPlugins.size() - 1; i >= 0; i--) {
testPlugins.get(i)
Expand All @@ -2737,7 +2744,8 @@ public void refreshAll() {
}

@SuppressWarnings("unchecked")
public void script(@SuppressWarnings("unused") String type, String script) throws Exception {
public void script(@SuppressWarnings("unused")
String type, String script) throws Exception {
script(type, script, new Object[0]);
}

Expand All @@ -2760,7 +2768,8 @@ public void script(String type, String script, Object... args) throws Exception
.eval((Map) p, new StringReader(script));
}

public String _repos(@SuppressWarnings("unused") String args[]) throws Exception {
public String _repos(@SuppressWarnings("unused")
String args[]) throws Exception {
List<RepositoryPlugin> repos = getPlugins(RepositoryPlugin.class);
List<String> names = new ArrayList<>();
for (RepositoryPlugin rp : repos)
Expand Down
2 changes: 1 addition & 1 deletion bndtools.core/src/bndtools/Plugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void start(BundleContext context) throws Exception {
plugin = this;
this.bundleContext = context;

scheduler = Executors.newScheduledThreadPool(1);
scheduler = Executors.newScheduledThreadPool(4);

bndActivator = new Activator();
bndActivator.start(context);
Expand Down
4 changes: 3 additions & 1 deletion bndtools.core/src/bndtools/explorer/BndtoolsExplorer.java
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,11 @@ private void updateTreeViewer() {
if (!installed) {
installed = true;
installFilter();
model.filterDirty.set(true);
}

getTreeViewer().refresh();
if (model.filterDirty.getAndSet(false))
getTreeViewer().refresh();
}

private void installFilter() {
Expand Down
16 changes: 5 additions & 11 deletions bndtools.core/src/bndtools/explorer/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Model {
String message = "initializing workspace";
int severity;
String filterText;
final AtomicBoolean filterDirty = new AtomicBoolean(false);
final List<Runnable> updates = new ArrayList<>();
final AtomicBoolean dirty = new AtomicBoolean(false);
final Set<IProject> pinned = new HashSet<>();
Expand All @@ -48,6 +49,7 @@ void setFilterText(String value) {
glob = null;
else
glob = new Glob(value);
filterDirty.set(true);
update();
}

Expand Down Expand Up @@ -77,14 +79,15 @@ void updateMessage() {
void setSeverity(int severity) {
if (this.severity != severity) {
this.severity = severity;
filterDirty.set(true);
update();
}
}

private String getPrompt(Workspace ws) {
try {
if (prompt == null || prompt.isEmpty())
prompt = "<b>${basename;${workspace}}</b> ${def;Bundle-Version} <a href='prefs'>change macro def</a>";
prompt = "<b>${basename;${workspace}}</b> ${def;Bundle-Version} <a href='prefs'>[?]</a>";
else if ("-".equals(prompt))
return "";

Expand Down Expand Up @@ -113,16 +116,6 @@ void update() {
* This runs async on the display thread.
*/
private void update0() {
try {
// coalesce some more updates on
// the worker thread(s).
Thread.sleep(50);
} catch (InterruptedException e) {
Thread.currentThread()
.interrupt();
return;
}

if (dirty.getAndSet(false)) {
updates.forEach(Runnable::run);
}
Expand All @@ -138,6 +131,7 @@ void doPin() {
} else {
pinned.add(p);
}
filterDirty.set(true);
update();
}

Expand Down
2 changes: 1 addition & 1 deletion gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ dependencies {
implementation("biz.aQute.bnd:biz.aQute.repository:${version}")
implementation("biz.aQute.bnd:biz.aQute.resolve:${version}")
runtimeOnly("biz.aQute.bnd:biz.aQute.bnd.embedded-repo:${version}")
testImplementation("org.spockframework:spock-core:2.3-groovy-3.0")
testImplementation("org.spockframework:spock-core:2.3-groovy-4.0")
}

// Gradle plugin descriptions
Expand Down