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

Ability to use failOnNonReproducibleResolution with the plugin? #701

Closed
boris-petrov opened this issue Oct 17, 2022 · 12 comments
Closed

Ability to use failOnNonReproducibleResolution with the plugin? #701

boris-petrov opened this issue Oct 17, 2022 · 12 comments

Comments

@boris-petrov
Copy link

boris-petrov commented Oct 17, 2022

I wanted to add the following to my build.gradle file:

configurations.all {
	resolutionStrategy {
		failOnNonReproducibleResolution()
	}
}

Just to have more "safety" with dependencies. However, that seems to break the versions-plugin with a message that dynamic-versions are disabled (as failOnNonReproducibleResolution includes failOnDynamicVersions). Any suggestions on how can I make the plugin work and have this setting enabled?

@ben-manes
Copy link
Owner

In #592

Usually you can get around this by conditionalizing the your resolution strategy to no-op if the dependencyUpdate task will be run. The simplest is checking for it ingradle.startParameter.taskNames, with a fancier version being to use gradle.taskGraph.whenReady. I think the latter might not work since Gradle 7.0 as I recall them making things stricter.

@ben-manes
Copy link
Owner

Also looks like there is a workaround in #593, maybe not yet released?

@boris-petrov
Copy link
Author

Ah, sorry, I searched for failOnNonReproducibleResolution before opening the issue, should have also searched for failOnDynamicVersions!

That PR sounds like it resolves the issue, yes. But it's not released, no. Perhaps you can do that? 😄

Thanks for the prompt response!

@ben-manes
Copy link
Owner

If you'd like, you can send a PR that follows a similar pattern to disable failOnNonReproducibleResolution and then we could trigger a release afterwards?

@boris-petrov
Copy link
Author

I'm not sure that's needed for failOnNonReproducibleResolution. If I understand correctly from Gradle's documentation (the two links I sent above) - failOnNonReproducibleResolution just enables failOnDynamicVersions and failOnChangingVersions. The former is already fixed. I'm not sure if the latter would break gradle-versions-plugin? My tests show it doesn't seem so. So perhaps no change from master is needed?

@ben-manes
Copy link
Owner

oh then that's good, I am not familiar with that option

@boris-petrov
Copy link
Author

Yeah, we can try - if you release a new version, I'll try it with failOnNonReproducibleResolution and failOnDynamicVersions. If it works, great. If the former doesn't work, I'll submit a PR and you can release a second version. 😄

@ben-manes
Copy link
Owner

You could install the plugin locally and use mavenLocal() in your project.

Otherwise, I am reviewing how a release is performed with the build and rewrite to kotlin since I am not familiar with the process anymore.

@boris-petrov
Copy link
Author

Sure, no worries! I'll see how this local installation works and I'll write here in a few hours with the results. Thanks!

@ben-manes
Copy link
Owner

easy peasy, released!

/cc @jaredsburrows

@boris-petrov
Copy link
Author

Great, thanks! I confirm that the new version fixes the issue with failOnNonReproducibleResolution!

@ben-manes
Copy link
Owner

ben-manes commented Oct 17, 2022

wonderful, thanks @boris-petrov and @keykey7! 😃

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

No branches or pull requests

2 participants