-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add support to update root gradle.properties #41
Conversation
Hi! Thank you very much for this PR! Also, I couldn't see any new tests being added in this PR. I would be really grateful if you could also add tests that verify that the new functionality is working. |
Hej @patrikerdes, sure, I can do that. Oh I see, I updated Regarding tests, I can also write some. So probably I should add it to |
|
Ok, I think I can see how I can handle tests. :) I will rebase and also add tests, probably not today but in next few days. Also thanks for a plugin! It comes really handy. |
a13cae6
to
10c87e9
Compare
I added tests. I also had to do a workaround for some other tests since Versions plugin from 0.28 supports only Gradle >= 5.0. Mostly tests for I also added a few lines in README.md how to apply plugin in case of Multi-projects build. |
I upgraded the gradle wrapper to 6.4.1 as part of fixing the broken tests, so the workaround you did for the failing tests should no longer be necessary. (I checked and you have that commit in your branch now after you rebased.) |
My bad, added version change before rebase. Anyway fixed now. Also diff is smaller and easier to review now. |
LGTM |
Now available in 0.2.14 |
This fixes: #28.
Basic idea:
useLatestVersions
task writes variables tobuild/useLatestVersions/version-variables.json
internalRootAggregate
that at the end reads all version-variables.json, merges them if possible (there is check that versions match) and writes to gradle.propertiesinternalRootAggregate
also deletes allversion-variables.json
filesuseLatestVersions
tasks are finalized byinternalRootAggregate
task andinternalRootAggregate
task must run after alluseLatestVersions
tasksBy default this behavior is disabled, but can be enabled with --updateRootProperties or as:
Note: when updateRootProperties=false, subprojects won't make version-variables.json file, but internalRootAggregate task will be run anyway, it just won't be able to read variables of subprojects.
I also included one small change, now variables that are defined multiple times in *.gradle file are also matched (change in
Common.getVariablesFromMatches
). Previously if you had two same version variables in *.gradle file it was not updated (also no problem was printed).