-
Notifications
You must be signed in to change notification settings - Fork 6
Scijava/scijava javadoc parser/javadoc to yaml #79
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
Conversation
|
What I suggested was to make the path to the YAML for |
|
Closes scijava/scijava#65 |
ec94780 to
33a339e
Compare
ctrueden
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for working on this, @gselzer! I'm excited to have ops driven uniformly by YAML metadata. But it looks like this PR is not quite ready for review yet:
- The description has empty code blocks for the op and corresponding YAML.
- The commit history has WIPs.
33a339e to
2c67649
Compare
|
@ctrueden I edited my PR to add the example Op and resulting YAML, and squashed together all of the WIP commits into a single commit, because things really weren't passing the build until the very end. Should be good to go now! |
|
Build with: Questions:
|
|
@gselzer what are the benefits to replacing the therapi mechanism for harvesting Javadoc ops? I didn't see a corresponding issue for this PR. |
There may be more, which I'm forgetting... |
899a953 to
294dc26
Compare
294dc26 to
95fb6c9
Compare
|
@gselzer I've rebased this branch against Also are the op parameter names being retained? Can you point me to an example of where they are used? |
|
@hinerm looking now, it seems to be an issue with type variables. There are some identifiers in the imagej ops2 yaml that have type variables, such as: net.imagej.ops2.copy.Copiers.<T>copyType(T, T)unfortunately, we are not correctly reifying the parameter types. I think that the solution is just to erase the type variables to their bounds. I'll let you know when I have a fix. |
90f156f to
d3fa2a6
Compare
|
@gselzer based on discussion today:
|
d3fa2a6 to
0574e21
Compare
So, looking back at this, I think we should avoid failing compilation - the javadoc parser is designed to be more general than Ops, and thus we may not always want to conform to the Javadoc requirements for an Op. What we can do is ensure that the tests fail because an Op written as a method doesn't have a type hint. Right now, if we miss a type hint, the errors look like this: I think this is good enough, for now. |
gselzer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed a little bit!
.github/build.sh
Outdated
| #!/bin/sh | ||
| curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/master/ci-build.sh | ||
| mvn -Djavadoc.skip -pl scijava/scijava-taglets clean install | ||
| mvn -Djavadoc.skip -pl scijava/scijava-taglets,scijava/scijava-javadoc-parser -am clean install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd really prefer to get these modules out of the incubator ASAP - @ctrueden the taglets, at least, seem pretty polished - should we consider migrating them?
imagej/imagej-ops2/src/main/java/net/imagej/ops2/copy/Copiers.java
Outdated
Show resolved
Hide resolved
gselzer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Phew! What a PR!
scijava/scijava-common3/src/main/java/org/scijava/common3/Classes.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should change the readme to reflect the new project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And should also remember to attribute therapi for the starting code. Check their license
scijava/scijava-javadoc-parser/src/main/java/org/scijava/javadoc/parser/ImplClassData.java
Outdated
Show resolved
Hide resolved
scijava/scijava-javadoc-parser/src/main/java/org/scijava/javadoc/parser/ImplData.java
Outdated
Show resolved
Hide resolved
.../scijava-ops-engine/src/main/java/org/scijava/ops/engine/yaml/AbstractYAMLOpInfoCreator.java
Outdated
Show resolved
Hide resolved
.../scijava-ops-engine/src/main/java/org/scijava/ops/engine/yaml/AbstractYAMLOpInfoCreator.java
Outdated
Show resolved
Hide resolved
scijava/scijava-ops-engine/src/main/java/org/scijava/ops/engine/yaml/YAMLOpInfoDiscoverer.java
Outdated
Show resolved
Hide resolved
...ava/scijava-ops-engine/src/main/resources/META-INF/services/org.scijava.discovery.Discoverer
Show resolved
Hide resolved
scijava/scijava-ops-engine/src/test/java/org/scijava/ops/engine/yaml/ops/YAMLClassOp.java
Outdated
Show resolved
Hide resolved
|
Some additional thoughts from discussing with @hinerm and @ctrueden:
|
f838758 to
b8f0cc7
Compare
2bf8bec to
35377ce
Compare
Wasn't being used
It wasn't used
No real reason to keep it as a field
2c6286e to
e82f4e8
Compare
This PR introduces a new SciJava annotation processor to replace the usage of therapi. The processor creates YAML files describing all implementations (identified with an
@implNotetag), for use in SciJava 3.The YAML created by the processor is designed for usage beyond Ops, and for robust declaration of implementations from arbitrary, cross-langauge sources. Each implementation must contain the following:
type.yamlfiles (for example,op.yamlcontains all of theopimplementations discovered by the processor).URIthat some yaml reader could use to get an instance of the implementation. For example, this could be a FQCN in Java, along with a scheme identifying that the URI is a Java class scheme.As an example, here's an Op:
And here is the generated YAML, placed into
op.yaml:Although the build completes and passes tests, this PR is a draft as there are a couple things left to do:
pom.xmlto merge the*.yamlfiles between source and tests - @ctrueden seemed to think that we don't need to do that. My experience is that it is necessary, though..