UserDataHolderBase (@NotNull String sourceArtifactNotation, @NotNull String taskName, @NotNull String sourcesLocationFilePath ) { UserDataHolderBase userData = new UserDataHolderBase(); VersionSpecificInitScript legacyInitScript = new LazyVersionSpecificInitScript( () -> GradleInitScriptUtil.loadLegacyDownloadSourcesInitScript(sourceArtifactNotation, taskName, sourcesLocationFilePath), INIT_SCRIPT_FILE_PREFIX, version -> GRADLE_5_6.compareTo(version) > 0 ); VersionSpecificInitScript initScript = new LazyVersionSpecificInitScript( () -> GradleInitScriptUtil.loadDownloadSourcesInitScript(sourceArtifactNotation, taskName, sourcesLocationFilePath), INIT_SCRIPT_FILE_PREFIX, version -> GRADLE_5_6.compareTo(version) <= 0 ); userData.putUserData(GradleTaskManager.VERSION_SPECIFIC_SCRIPTS_KEY, List.of(legacyInitScript, initScript)); return userData; }