8000 Gradle: Update Gradle Plugin extension to use properties by Nava2 · Pull Request #3879 · flyway/flyway · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Gradle: Update Gradle Plugin extension to use properties #3879

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Nava2
Copy link
@Nava2 Nava2 commented Apr 21, 2024

This updates the flyway gradle plugin to provide Property<> values on the extension rather than using bare types. This is incredibly important for working with Gradle such that properties remain lazy. This allows values to be configured from different locations rather than relying on being available immediately.

Drive-by: This bumps the version of Gradle from 6.1.1 (Jan 2020) to 6.9.4 (Feb 2023). The version in use is wildly out of date.

All changes within this PR are backwards compatible with Version 6.9.4.

Nava2 added 2 commits April 21, 2024 16:10
This updates the flyway gradle plugin to provide `Property<>` values on the extension rather than using bare types. This is incredibly important for working with Gradle such that properties remain lazy. This allows values to be configured from different locations rather than relying on being available immediately.
@CLAassistant
Copy link
CLAassistant commented Apr 21, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
@WilliamL-RG WilliamL-RG left a comment

Choose a reason for hiding this comment

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

Apologies for the time since this PR was created. I have found some issues with the PR that are preventing Flyway working as expected with Gradle, so they will need to be addressed.

public Map<String, String> pluginConfiguration;
private final MapProperty<String, String> pluginConfiguration;

FlywayExtension(ObjectFactory objects) {

Choose a reason for hiding this comment

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

This needs to be made public

@@ -29,12 +29,12 @@
public class FlywayPlugin implements Plugin<Project> {
public void apply(Project project) {
project.getExtensions().create("flyway", FlywayExtension.class);

Choose a reason for hiding this comment

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

This would need to be updated to match the new constructor

if (value instanceof Provider<?> && ((Provider<?>) value).isPresent()) {
config.put(key, ((Provider<?>) value).get().toString());
} else {
config.put(key, value.toString());

Choose a reason for hiding this comment

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

This will need a null check to ensure configuration parameters are properly set to null and not an empty string


/**
* The version to tag an existing schema with when executing baseline. (default: 1)
*/
public String baselineVersion;
private final Property<String> baselineVersion;

Choose a reason for hiding this comment

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

This can create conflicts with baseline versions that are not written as a string. For example this will not accept baselineVersion = 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0