-
Notifications
You must be signed in to change notification settings - Fork 467
Gradle multi-project project with ratchetFrom #919
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
Comments
I'm pretty sure this is a dupe of #911. Try the workaround there and let me know if it fixes anything. |
That fixed my local exception, but not the one from github actions
Or is there anything I have to do to work properly there? |
Great! The GitHub actions error is different and easy to fix. GitHub does a bare checkout by default, you can fix this by adding |
Thank you! Everything's working now |
As a first step towards having consistent, enforced code style across the project, to simplify diffs, and to reduce the effort by contributors, we can use Spotless. By default, we'll enable Java, Gradle and JSON configurations, and have the option of adding other source types in the future. We need to exclude the `sample.json` file as it's not valid JSON, otherwise Spotless fails to run. To reduce the pain for folks interacting with the project, we can enable ratcheting to only affect files that have already been modified by a user. This also documents how to run Spotless locally, and documents how to have it running automagically on compiles via https://www.jvt.me/posts/2020/05/15/gradle-spotless/ We need to make sure that we've updated GitHub Actions to pull the full Git history - as per a suggestion on `https://github.com/diffplug/spotless/issues/919#issuecomment-904957487` - so we can correctly ratchet as part of our CI. Closes wiremock#1559.
Previously we've got the `add-copyright-headers` task to retroactively add license headers, but fortunately, Spotless can do this for us too, so we can remove our code and apply it as part of a Spotless run. To simplify the configuration in our `build.gradle`, we can put this into a separate file that can be edited on its own. To ensure this stays up-to-date, we need to add `ratchetFrom` to make sure that this updates against our main branch[0]. We need to make sure that we've updated GitHub Actions to pull the full Git history - as per a suggestion on diffplug/spotless#919 (comment) - so we can correctly ratchet as part of our CI. [0]: https://www.jvt.me/posts/2021/03/31/git-origin-head/
Previously we've got the `add-copyright-headers` task to retroactively add license headers, but fortunately, Spotless can do this for us too, so we can remove our code and apply it as part of a Spotless run. To simplify the configuration in our `build.gradle`, we can put this into a separate file that can be edited on its own. To ensure this stays up-to-date, we need to add `ratchetFrom` to make sure that this updates against our main branch[0]. We need to make sure that we've updated GitHub Actions to pull the full Git history - as per a suggestion on diffplug/spotless#919 (comment) - so we can correctly ratchet as part of our CI. [0]: https://www.jvt.me/posts/2021/03/31/git-origin-head/
Previously we've got the `add-copyright-headers` task to retroactively add license headers, but fortunately, Spotless can do this for us too, so we can remove our code and apply it as part of a Spotless run. To simplify the configuration in our `build.gradle`, we can put this into a separate file that can be edited on its own. To ensure this stays up-to-date, we need to add `ratchetFrom` to make sure that this updates against our main branch[0]. We need to make sure that we've updated GitHub Actions to pull the full Git history - as per a suggestion on diffplug/spotless#919 (comment) - so we can correctly ratchet as part of our CI. [0]: https://www.jvt.me/posts/2021/03/31/git-origin-head/
If you are submitting a bug, please include the following:
I'm still trying to integrate Improve code formatting libgdx/libgdx#5698 at libgdx. Because a lot of the code is not correctly formatted I set
ratchetFrom 'origin/master'
to minimized the necessary changes for a working build, but this introduced new problems. The build on my local machine fails with the exception mentioned below and the github actions workflow of PR fails, too. (link)I think the problem is, that spotless searches for the git repo of each subproject and uses not the root project.
6.7.1
spotless-plugin-gradle:5.14.3
Not necessary, I think
The current config is: https://github.com/SimonIT/libgdx/blob/7f5eb9d62c1b4557c03598705361690f1346651a/build.gradle#L64-L88
gradlew spotless[Apply/Check] --stacktrace
If you're just submitting a feature request or question, no need for the above.
The text was updated successfully, but these errors were encountered: