-
Notifications
You must be signed in to change notification settings - Fork 6
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
Upgrade to Java 17 and gradle 7.4.2. #188
Conversation
0f63959
to
57851aa
Compare
Codecov ReportBase: 76.69% // Head: 77.29% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #188 +/- ##
============================================
+ Coverage 76.69% 77.29% +0.59%
+ Complexity 762 742 -20
============================================
Files 33 41 +8
Lines 2609 2757 +148
Branches 505 472 -33
============================================
+ Hits 2001 2131 +130
- Misses 409 448 +39
+ Partials 199 178 -21
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
52055a0
to
c2d3267
Compare
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.
@cmnbroad A few comments. There's some stuff that could be cleaned up using the new switch expressions and instanceof pattern matching but it's not necessary. I have to say I've never 100% understood how this all works so I'm not sure if I'm catching wierd errors in scanner design or anything like that. They seem to be consistent with each other though.
I noticed that this uses a Reporter
in a lot of places instead of a the logger. Is it possible to remove the logger dependency and use a reporter in all places here?
Are the com.sun classes always available now through the toolprovider methods? Are there any gotchas about those like there used to be?
name = isRelease ? "SonaType" : "Artifactory" | ||
url = isRelease ? "https://oss.sonatype.org/service/local/staging/deploy/maven2/" : "https://broadinstitute.jfrog.io/broadinstitute/libs-snapshot-local/" | ||
credentials { | ||
username = isRelease ? project.findProperty("sonatypeUsername") : System.env.ARTIFACTORY_USERNAME |
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.
It's very silly that one of these is set through the environment one is a gradle property. Maybe we should unify them. It's entirely a relic based on my first draft at publishing these things I believe.
build.gradle
Outdated
@@ -119,61 +116,67 @@ artifacts { | |||
* Sign non-snapshot releases with our secret key. This should never need to be invoked directly. | |||
*/ | |||
signing { | |||
required { isRelease && gradle.taskGraph.hasTask("uploadArchives") } | |||
required { isRelease && gradle.taskGraph.hasTask("publish") } | |||
sign configurations.archives |
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 think you might need to change this to sign publishing.publications
at least based on how gatk and htsjdk were updated
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.
Ok, will try that.
*/ | ||
abstract public class BarclayDocletOption implements Doclet.Option { | ||
// record to keep all of the components required for an option | ||
private record DocletOptionRecord( |
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.
neat, a record
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.
A bit of a strange use, too bad you can't have a record with an abstract method.
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.
You could make it just a record that contains a lambda that does the processing I think if you wanted to make the class just directly a record instead of this indirection. You couldn't make helper subclasses then though.
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 left this as is, and added the helper subclasses.
* This can be thought of as a set of such argument relationships and does not have any ordering scheme. | ||
* | ||
* <p> |
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 would love to change to markdown instead of html in the templates.
Option.Kind.STANDARD, | ||
"<string>") { | ||
@Override | ||
public boolean process(String option, List<String> arguments) { |
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.
So much boiler plate. It looks like most (maybe all?) follow the same exact initialization. I think you could use something like this and remove all the redundant initialization and just provide the necessary function override.
private static abstract class SingleStandardOption extends BarclayDocletOption {
public SingleStandardOption(String name){
super(List.of(name), name, 1, Kind.STANDARD, "<string>");
}
}
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.
Technically, that would be SingleStandardStringWithOneArgumentAndNoAliasesOption
. But yeah, that would eliminate least some boilerplate.
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.
Done - I added this as a static class inside BarclayDocletOption
so it can also be used in the other doclets.
// Get a list of all the features and groups that we'll actually retain | ||
workUnits = computeWorkUnits(); | ||
// scan all included elements for DocumentedFeatures | ||
workUnits = JavaLanguageModelScanners.getWorkUnits(this, docletEnv, reporter, docletEnv.getIncludedElements()); | ||
|
||
final Set<String> uniqueGroups = new HashSet<>(); |
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.
linked
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.
Done.
|
||
@Override | ||
public Set<? extends Option> getSupportedOptions() { | ||
return new HashSet<>() {{ |
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.
linked
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.
Done.
*/ | ||
protected void validateDocletStartingState() { | ||
private DocletEnvironment docletEnv; // The javadoc doclet env | ||
protected Set<DocWorkUnit> workUnits = new HashSet<>(); // Set of all things we are going to document |
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.
linked
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.
Done.
* An {@link ElementScanner14} for finding {@link DocumentedFeature}s to be included in a Barclay doc | ||
* task. Returns a set of {@link DocWorkUnit} objects. | ||
*/ | ||
public class DocumentedFeatureScanner extends ElementScanner14<Void, Void> { |
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.
Shouldn't this be a scanner 17?
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.
Yes, but ElementScanner17
doesn't appear to exist. ElementScanner14
is annotated with (@SupportedSourceVersion(RELEASE_17)
. I assume they do this when the new version has no language changes that would warrant a new class, but the doc for these classes is pretty minimal.
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.
That makes sense. I'm surprised 17 didn't have any new elements with the new pattern matching stuff.
* element, even if the field is declared within the class represented by the (enclosing) element, i.e., | ||
* this can happen if the field is initialized by instantiating an anonymous class. | ||
*/ | ||
public class FieldScanner extends ElementScanner14<Void, Void> { |
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.
Same question about making this a scanner 17.
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.
See the other comments.
// */ | ||
// public static boolean run(final DocletEnvironment docEnv) throws IOException { | ||
// return super.start; | ||
// } |
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.
Oh, this should be removed entirely and just rely on the base class.
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.
Done.
… unit tests, fix custom tags.
c2d3267
to
7a858a9
Compare
d6a1bd7
to
cb4da7a
Compare
cb4da7a
to
538c64c
Compare
…elements only, use canonical class name.
538c64c
to
86ba9c1
Compare
@lbergelson I think this is ready for review now. I updated a lot of code based on things I found when running the GATK docgen with this code, and comparing the results to the current code generated on GATK master. Sorry for the churn. |
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.
@cmnbroad This looks good to me 👍
if (fieldElement == null) { | ||
return ""; | ||
// the field isn't defined directly in the workunit's enclosing class/element, so it must be |
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.
These comments are extremely helpful.
Moves the doclets (help tab completion and WDL generation) over to the new doclet API introduced in Java 11. Requires a major version upgrade.