Skip to content
This repository was archived by the owner on Oct 26, 2026. It is now read-only.

Restore Package Rules - #59

Merged
hinerm merged 2 commits into
mainfrom
scijava/scijava-ops-engine/restore-package-rules
Sep 19, 2023
Merged

hinerm merged 2 commits into
mainfrom
scijava/scijava-ops-engine/restore-package-rules

Conversation

@gselzer

@gselzer gselzer commented Apr 15, 2022

Copy link
Copy Markdown
Member

This PR re-establishes the package rules of scijava-maven-plugin. To do this, OpEnvironment, OpHistory, TypeReifier and LoggerFactory were rewritten as Prioritized implementations.

We then added Discoverer.discoverMax() and Discoverer.discoverMin(), able to discoverer the highest/lowest priority implementations for any Class implementing Comparable.

This makes it trivial to discover DefaultOpEnvironment. Specifically, we can use OpEnvironment.getOpEnvironment() to get the highest-priority OpEnvironment. This is similar to the call Context.getService(OpService.class) in SciJava Common/ImageJ Ops.

Remaining questions:

  • I made LoggerFactory the discoverable interface instead of Logger for convenience reasons (the Logger implementation has constructor arguments). Is there a reason to keep LoggerFactory? Can we remove the constructor arguments of the Logger implementations?

Cannot be merged until #55 is merged, as this work is built on top of that work.

@gselzer
gselzer marked this pull request as draft April 15, 2022 19:15
@gselzer
gselzer force-pushed the scijava/scijava-ops-engine/restore-package-rules branch 5 times, most recently from 003a120 to 2729c24 Compare May 13, 2022 22:22
@gselzer

gselzer commented May 13, 2022

Copy link
Copy Markdown
Member Author

This would close scijava/scijava#92

@ctrueden

ctrueden commented May 3, 2023

Copy link
Copy Markdown
Member

This PR needs a git rebase 2c271c15b43afe0b150fb5a930ceb0ac3e1bb2e2 --onto origin/main with conflicts addressed.

@gselzer
gselzer force-pushed the scijava/scijava-ops-engine/restore-package-rules branch from 2729c24 to 9b54563 Compare August 31, 2023 18:12
@gselzer
gselzer marked this pull request as ready for review August 31, 2023 18:12
@gselzer
gselzer force-pushed the scijava/scijava-ops-engine/restore-package-rules branch from 9b54563 to dc9b2f6 Compare August 31, 2023 19:30
@gselzer

gselzer commented Aug 31, 2023

Copy link
Copy Markdown
Member Author

@ctrueden @hinerm this PR has been brought up to date, unfortunately through the process of basically doing it all over again.

I'd suggest we fast-track this PR, with the fear of having to do it all over again.

For those who review, please pay attention to the API added to the OpEnvironment, as while it works, I'd think we could do better. The use cases are as follows:

  • Some unit tests (and use cases?) will want an empty Op environment. The current need is the SciJava Ops Engine unit tests
  • Some unit tests will want an Op environment with all available Ops. The current need is the ImageJ Ops2 unit tests, and also Fiji scripting

To restore the package rules, we need to hide DefaultOpEnvironment, so using the static method in OpEnvironment should become the standard for obtaining an OpEnvironment.

@gselzer gselzer linked an issue Sep 6, 2023 that may be closed by this pull request
gselzer and others added 2 commits September 14, 2023 14:52
This reverts commit b052d25.

This did not seem to fix the builds.
@hinerm
hinerm force-pushed the scijava/scijava-ops-engine/restore-package-rules branch from dc9b2f6 to e7bbccf Compare September 14, 2023 19:52
@hinerm
hinerm merged commit 0b0b4e1 into main Sep 19, 2023
@hinerm
hinerm deleted the scijava/scijava-ops-engine/restore-package-rules branch September 19, 2023 17:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose DefaultOpEnvironment

3 participants