-
Notifications
You must be signed in to change notification settings - Fork 299
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
Fix JSpecify support on JDK 21 #869
Changes from 17 commits
dcb52e5
7cbdf62
527f749
8acfb89
1102fd7
62434cc
79dd0fa
121e735
ce338a6
72c5733
89474f7
ef844c8
79bc579
ee143b1
bb502b2
62500ed
417f888
b0bf1ba
fe1b8be
4c6ef16
708a494
132b6b3
992e48c
8c22d6c
579b60c
b7d94cf
ac250ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,22 +44,6 @@ configurations.create('transitiveSourcesElements') { | |
} | ||
} | ||
|
||
// Share the coverage data to be aggregated for the whole product | ||
configurations.create('coverageDataElements') { | ||
visible = false | ||
canBeResolved = false | ||
canBeConsumed = true | ||
extendsFrom(configurations.implementation) | ||
attributes { | ||
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_RUNTIME)) | ||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category, Category.DOCUMENTATION)) | ||
attribute(DocsType.DOCS_TYPE_ATTRIBUTE, objects.named(DocsType, 'jacoco-coverage-data')) | ||
} | ||
// This will cause the test task to run if the coverage data is requested by the aggregation task | ||
outgoing.artifact(tasks.named("test").map { task -> | ||
task.extensions.getByType(JacocoTaskExtension).destinationFile | ||
}) | ||
} | ||
|
||
test { | ||
maxHeapSize = "1024m" | ||
|
@@ -118,3 +102,21 @@ def testJdk21 = tasks.register("testJdk21", Test) { | |
tasks.named('check').configure { | ||
dependsOn testJdk21 | ||
} | ||
|
||
|
||
// Share the coverage data to be aggregated for the whole product | ||
configurations.create('coverageDataElements') { | ||
visible = false | ||
canBeResolved = false | ||
canBeConsumed = true | ||
extendsFrom(configurations.implementation) | ||
attributes { | ||
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_RUNTIME)) | ||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category, Category.DOCUMENTATION)) | ||
attribute(DocsType.DOCS_TYPE_ATTRIBUTE, objects.named(DocsType, 'jacoco-coverage-data')) | ||
} | ||
// This will cause the test tasks to run if the coverage data is requested by the aggregation task | ||
tasks.withType(Test).forEach {task -> | ||
outgoing.artifact(tasks.named(task.name).map { t -> t.extensions.getByType(JacocoTaskExtension).destinationFile }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The whole There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Meh, let's leave this hack for now and fix this properly in #871 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SGTM! |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,14 +124,6 @@ tasks.named('check').configure { | |
dependsOn(jdk8Test) | ||
} | ||
|
||
tasks.named('testJdk21', Test).configure { | ||
filter { | ||
// JSpecify Generics tests do not yet pass on JDK 21 | ||
// See https://github.com/uber/NullAway/issues/827 | ||
excludeTestsMatching "com.uber.nullaway.NullAwayJSpecifyGenericsTests" | ||
} | ||
} | ||
|
||
Comment on lines
-127
to
-134
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! 👍 |
||
// Create a task to build NullAway with NullAway checking enabled | ||
tasks.register('buildWithNullAway', JavaCompile) { | ||
onlyIf { | ||
|
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.
This change is required so that test coverage when running tests on JDK 21 gets reported to CodeCov.