refreshVersions icon indicating copy to clipboard operation
refreshVersions copied to clipboard

fix idea sync failing on composite builds, add support for composite builds

Open NikkyAI opened this issue 4 years ago โ€ข 5 comments

๐Ÿš€ 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

NikkyAI avatar Jun 05 '21 11:06 NikkyAI

I've seen I broke something with Kotlin plugin version by trying to fix something, I'll fix it on the main branch first.

LouisCAD avatar Jun 07 '21 06:06 LouisCAD

@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 avatar Jun 07 '21 08:06 LouisCAD

@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

NikkyAI avatar Jun 07 '21 09:06 NikkyAI

If you merge latest main again, the issue will go away.

LouisCAD avatar Jun 07 '21 09:06 LouisCAD

further testing reveals this breaks in different ways.. still needs more testing

NikkyAI avatar Jun 07 '21 14:06 NikkyAI