use of org.gradle.internal.scan.config.BuildScanConfig in project gradle by gradle.
the class LegacyGradleEnterprisePluginCheckInService method collect.
@Override
public BuildScanConfig collect(BuildScanPluginMetadata pluginMetadata) {
if (manager.isPresent()) {
throw new IllegalStateException("Configuration has already been collected.");
}
VersionNumber pluginVersion = VersionNumber.parse(pluginMetadata.getVersion()).getBaseVersion();
if (pluginVersion.compareTo(FIRST_GRADLE_ENTERPRISE_PLUGIN_VERSION) < 0) {
throw new UnsupportedBuildScanPluginVersionException(GradleEnterprisePluginManager.OLD_SCAN_PLUGIN_VERSION_MESSAGE);
}
String unsupportedReason = unsupportedReason(pluginVersion);
if (unsupportedReason == null) {
manager.registerAdapter(new Adapter());
} else {
manager.unsupported();
if (!isPluginAwareOfUnsupported(pluginVersion)) {
throw new UnsupportedBuildScanPluginVersionException(unsupportedReason);
}
}
return new Config(Requestedness.from(gradle), new Attributes(buildType), unsupportedReason);
}
Aggregations