-
Notifications
You must be signed in to change notification settings - Fork 32
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
Support Mono Repo #84
Comments
When you say "any commit/change across the whole git repo", what sort of change do you mean? Can you given an example? I'm having a little trouble understanding why such a change wouldn't affect any of the subprojects; aren't they all part of the same repo? Do you mean that even when you make a change in one subproject, the plugin still calculates versions for all subprojects? I've actually run into this scenario and my workaround was to write a script (I used perl) that identified the subprojects that changed and then explicitly build them. For example, if the script identified that |
The goal is to have completely separate versions for subprojects in the same repo so that when the CI system builds it will skip building the projects which don't have any changes, gradle already does all the incremental builds and won't build unchanged items due to buildcache so now just need to sort the versioning to make sure no new jars get created This means we only want to create a new prerelease version/version if files under the subprojects and potentially some other key files/directory have been touched, not if we touch under a different subproject Example
For us we would want gradle :subproject2:printVersion to stay at 2.0.2 as no changes have been made to files affecting subproject2 If possible there could be a property in semantic-build-versioning.gradle where we could pass in paths which tell the plugin which directories to check paths = ["subproject1/**","build.gradle","etc/conf.properties"] Or maybe use gradle to detect if the project has changed |
Ah, I understand now. I think this could actually be done similar to task inputs and outputs perhaps. I wonder if there is a way to hook into that through the gradle API. |
For us I think it would be better to check if the commits since the last version touches any of the configured paths. The problem relying on gradle would be that the cache may be cleared and then an unnecessary version bump will happen |
@tobad357 Good point. Instead of explicitly providing paths, though I think it might be better to see if any of the changed files are from the subproject's directory when deciding whether to bump the version. |
@vivin I actually hacked this feature into a local version of the plugin Let me see if I have time this weekend to clean it up and I can see if I can share The reason we use includePaths is that sometimes there is a file that affects the build outside of the subproject (there shouldn't be....), this allows us to support that |
FYI we also added a flag to allow tag task to disregard if the tag already exists |
This issue seems to have stalled. Did this functionality ever make it into the product? |
Currently we have a mono repo with multiple gradle sub projects
Each subproject has different versions which works fine with separate semantic-build-versioning.gradle files and using tagPrefix/tagPattern
The only issue we have is that any commit / change across the whole git repo
will cause a new version to be created/allowed for the subproject when what
would be better is to only check for commits/changes that affects files in the subproject directory and potentially some other folders.
Is this functionality something you could see the plugin to support?
The text was updated successfully, but these errors were encountered: