Search in sources :

Example 1 with BuildScanConfig

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);
}
Also used : BuildScanConfig(org.gradle.internal.scan.config.BuildScanConfig) GradleEnterprisePluginAdapter(org.gradle.internal.enterprise.core.GradleEnterprisePluginAdapter) VersionNumber(org.gradle.util.internal.VersionNumber)

Aggregations

GradleEnterprisePluginAdapter (org.gradle.internal.enterprise.core.GradleEnterprisePluginAdapter)1 BuildScanConfig (org.gradle.internal.scan.config.BuildScanConfig)1 VersionNumber (org.gradle.util.internal.VersionNumber)1