Skip to content

Fix BaselineModuleJvmArgs with enable-preview functionality#2336

Merged
bulldozer-bot[bot] merged 2 commits intodevelopfrom
dfox/oops
Jul 29, 2022
Merged

Fix BaselineModuleJvmArgs with enable-preview functionality#2336
bulldozer-bot[bot] merged 2 commits intodevelopfrom
dfox/oops

Conversation

@iamdanfox
Copy link
Copy Markdown
Contributor

Before this PR

I just tried to apply baseline 4.149.0 to template-witchcraft to try out my newly merged --enable-preview stuff from #2322, but found a BUG:

./gradlew tasks         

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file '/Volumes/git/template-witchcraft/build.gradle' line: 62

* What went wrong:
A problem occurred evaluating root project 'witchcraft-example-root'.
> Failed to apply plugin class 'com.palantir.baseline.plugins.javaversions.BaselineJavaVersion'.
   > Extension of type 'BaselineJavaVersionsExtension' does not exist. Currently registered extension types: [ExtraPropertiesExtension, JunitTaskResultExtension, ReportingExtension, CheckstyleExtension, IdeaModel, BasePluginExtension, DefaultArtifactPublicationSet, SpotlessExtension, VersionsLockExtension, SourceSetContainer, JavaPluginExtension, JavaToolchainService, TestingExtension, EclipseModel, BaselineErrorProneExtension, BaselineModuleJvmArgsExtension, BaselineJavaVersionExtension]

Turns out the tests I added were all single project tests and this obscured a mistake whereby multi-project builds would fail.

After this PR

==COMMIT_MSG==
Fix the BaselineModuleJvmArgs plugin to once again work as intended in multi-project builds
==COMMIT_MSG==

Possible downsides?

@changelog-app
Copy link
Copy Markdown

changelog-app Bot commented Jul 29, 2022

Generate changelog in changelog/@unreleased

Type
See change types. Select one:

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Fix the BaselineModuleJvmArgs plugin to once again work as intended in multi-project builds

Check the box to generate changelog(s)

  • Generate changelog entry

BaselineJavaVersionsExtension javaVersionsExtension =
project.getExtensions().getByType(BaselineJavaVersionsExtension.class);
BaselineJavaVersionExtension javaVersionsExtension =
project.getExtensions().getByType(BaselineJavaVersionExtension.class);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the subtle typo here is that I was detecting that the singular BaselineJavaVersion plugin was applied, but trying to read the root level BaselineJavaVersionsExtension off this project.

This can only work in single project builds.

@iamdanfox iamdanfox marked this pull request as ready for review July 29, 2022 16:12
@bulldozer-bot bulldozer-bot Bot merged commit 7944f5b into develop Jul 29, 2022
@bulldozer-bot bulldozer-bot Bot deleted the dfox/oops branch July 29, 2022 16:19
@svc-autorelease
Copy link
Copy Markdown
Collaborator

Released 4.150.0

bulldozer-bot Bot pushed a commit to palantir/witchcraft-api that referenced this pull request Jul 29, 2022
###### _excavator_ is a bot for automating changes across repositories.

Changes produced by the roomba/latest-baseline-oss check.

# Release Notes
## 4.149.0
| Type | Description | Link |
| ---- | ----------- | ---- |
| Feature | Users of the `com.palantir.baseline-java-versions` plugin can now set `javaVersions { distributionTarget = '17_PREVIEW' }` to opt-in to Java's `--enable-preview` flag at compile time. | palantir/gradle-baseline#2322 |


## 4.150.0
| Type | Description | Link |
| ---- | ----------- | ---- |
| Fix | Fix the `BaselineModuleJvmArgs` plugin to once again work as intended in multi-project builds | palantir/gradle-baseline#2336 |



To enable or disable this check, please contact the maintainers of Excavator.
This was referenced Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants