fix idea sync failing on composite builds, add support for composite builds
๐ Description
handles failure due to uninitialized versionPropertiesFile during idea sync
it does this by catching the exception and setting the description of task refrewshVersions to the most likely correct value
main project and included project will have seperate versions.properties
(although if they both are configured to point at the same file it might work?)
it also refactors RefreshVersionsConfigHolder usage
using the rootProject path as the key each uses their own RefresVersionsConfig instance
this avoids the parentProject writing to the included builds versions.properties
the only breaking change is for groovy code: versionFor needs to be passed the project to grab the correct config instance
(works out of the box as receiver in kotlin)
unless there is a way to make these functions have a receiver without breaking usage code ?
versionFor was moved into the extension versions, so that it can keep a reference to the correct config
the usage looks like so now:
version.versionFor("version.kotlin")
// alternative
versions {
versionFor("version.kotlin")
}
it does not require imports in the buildscript anymore
๐ Motivation and Context
makes includeBuild not fail
this mainly fixes the idea sync failing and removing all tasks from the tool window
should unblock work on https://github.com/jmfayard/refreshVersions/issues/205
๐งช How Has This Been Tested?
tested on idea ultimate on windows and linux all sample projects pass checks and idea sync
๐ฆ Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
โ Checklist
- [x] I have read the guidelines for the development process
- [x] My change requires a change to the documentation.
- [x] I have updated the documentation accordingly.
I've seen I broke something with Kotlin plugin version by trying to fix something, I'll fix it on the main branch first.
@NikkyAI I fixed what I broke on the main branch, you can undo the changes you did to work that around in this PR.
@LouisCAD i reverted the commit, kepts the plugin alias so that tests do not fail, i will remove that in a future PR when i work on integrating parent and included builds more
If you merge latest main again, the issue will go away.
further testing reveals this breaks in different ways.. still needs more testing