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

Fix javadoc when enable preview flag is added #2338

Merged
merged 3 commits into from
Jul 29, 2022
Merged
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
6 changes: 6 additions & 0 deletions changelog/@unreleased/pr-2338.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: fix
fix:
description: javadoc tasks are now properly configured when `--enable-preview` is
used
links:
- https://github.com/palantir/gradle-baseline/pull/2338
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public void execute(Task task) {
if (target.get().enablePreview()) {
// yes, javadoc truly takes a single-dash where everyone else takes a double dash
options.addBooleanOption("-enable-preview", true);
options.setSource(target.get().javaLanguageVersion().toString());
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,20 @@ class BaselineJavaVersionIntegrationTest extends IntegrationSpec {
assertBytecodeVersion(compiledClass, JAVA_17_BYTECODE, ENABLE_PREVIEW_BYTECODE)
}

def 'java 17 preview javadoc works'() {
when:
buildFile << '''
javaVersions {
libraryTarget = 11
distributionTarget = '17_PREVIEW'
}
'''.stripIndent(true)
file('src/main/java/Main.java') << java17PreviewCode

then:
runTasksSuccessfully('javadoc', '-i')
}

def 'library target is used when no artifacts are published but project is overridden as a library'() {
when:
buildFile << '''
Expand Down