Java Code Examples for org.gradle.util.GradleVersion#current()

The following examples show how to use org.gradle.util.GradleVersion#current() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CommandLineActionFactory.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void run() {
    GradleVersion currentVersion = GradleVersion.current();

    final StringBuilder sb = new StringBuilder();
    sb.append("\n------------------------------------------------------------\nGradle ");
    sb.append(currentVersion.getVersion());
    sb.append("\n------------------------------------------------------------\n\nBuild time:   ");
    sb.append(currentVersion.getBuildTime());
    sb.append("\nBuild number: ");
    sb.append(currentVersion.getBuildNumber());
    sb.append("\nRevision:     ");
    sb.append(currentVersion.getRevision());
    sb.append("\n\nGroovy:       ");
    sb.append(GroovySystem.getVersion());
    sb.append("\nAnt:          ");
    sb.append(Main.getAntVersion());
    sb.append("\nJVM:          ");
    sb.append(Jvm.current());
    sb.append("\nOS:           ");
    sb.append(OperatingSystem.current());
    sb.append("\n");

    System.out.println(sb.toString());
}
 
Example 2
Source File: CommandLineActionFactory.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void run() {
    GradleVersion currentVersion = GradleVersion.current();

    final StringBuilder sb = new StringBuilder();
    sb.append("\n------------------------------------------------------------\nGradle ");
    sb.append(currentVersion.getVersion());
    sb.append("\n------------------------------------------------------------\n\nBuild time:   ");
    sb.append(currentVersion.getBuildTime());
    sb.append("\nBuild number: ");
    sb.append(currentVersion.getBuildNumber());
    sb.append("\nRevision:     ");
    sb.append(currentVersion.getRevision());
    sb.append("\n\nGroovy:       ");
    sb.append(GroovySystem.getVersion());
    sb.append("\nAnt:          ");
    sb.append(Main.getAntVersion());
    sb.append("\nJVM:          ");
    sb.append(Jvm.current());
    sb.append("\nOS:           ");
    sb.append(OperatingSystem.current());
    sb.append("\n");

    System.out.println(sb.toString());
}
 
Example 3
Source File: BuildScopeServices.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
protected CacheRepository createCacheRepository() {
    CacheFactory factory = get(CacheFactory.class);
    StartParameter startParameter = get(StartParameter.class);
    DefaultCacheScopeMapping scopeMapping = new DefaultCacheScopeMapping(startParameter.getGradleUserHomeDir(), startParameter.getProjectCacheDir(), GradleVersion.current());
    return new DefaultCacheRepository(
            scopeMapping,
            startParameter.getCacheUsage(),
            factory);
}
 
Example 4
Source File: BuildScopeServices.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
protected CacheRepository createCacheRepository() {
    CacheFactory factory = get(CacheFactory.class);
    StartParameter startParameter = get(StartParameter.class);
    DefaultCacheScopeMapping scopeMapping = new DefaultCacheScopeMapping(startParameter.getGradleUserHomeDir(), startParameter.getProjectCacheDir(), GradleVersion.current());
    return new DefaultCacheRepository(
            scopeMapping,
            factory);
}
 
Example 5
Source File: ForbiddenApisPlugin.java    From forbidden-apis with Apache License 2.0 5 votes vote down vote up
@Override
public void apply(Project project) {
  if (GradleVersion.current().compareTo(MIN_GRADLE_VERSION) < 0) {
    throw new GradleException("Forbiddenapis plugin requires at least " + MIN_GRADLE_VERSION + ", running version is " + GradleVersion.current());
  }
  final DelegatingScript script;
  try {
    script = COMPILED_SCRIPT.newInstance();
  } catch (Exception e) {
    throw new GradleException("Cannot instantiate Groovy script to apply forbiddenapis plugin.", e);
  }
  script.setDelegate(this);
  script.setProperty("project", project);
  script.run();
}
 
Example 6
Source File: AppEngineCorePluginConfiguration.java    From app-gradle-plugin with Apache License 2.0 5 votes vote down vote up
private void checkGradleVersion() {
  if (GRADLE_MIN_VERSION.compareTo(GradleVersion.current()) > 0) {
    throw new GradleException(
        "Detected "
            + GradleVersion.current()
            + ", but the appengine-gradle-plugin requires "
            + GRADLE_MIN_VERSION
            + " or higher.");
  }
}
 
Example 7
Source File: AppEnginePlugin.java    From app-gradle-plugin with Apache License 2.0 5 votes vote down vote up
private void checkGradleVersion() {
  if (GRADLE_MIN_VERSION.compareTo(GradleVersion.current()) > 0) {
    throw new GradleException(
        "Detected "
            + GradleVersion.current()
            + ", but the appengine-gradle-plugin requires "
            + GRADLE_MIN_VERSION
            + " or higher.");
  }
}
 
Example 8
Source File: BuildScopeServices.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
protected CacheRepository createCacheRepository() {
    CacheFactory factory = get(CacheFactory.class);
    StartParameter startParameter = get(StartParameter.class);
    DefaultCacheScopeMapping scopeMapping = new DefaultCacheScopeMapping(startParameter.getGradleUserHomeDir(), startParameter.getProjectCacheDir(), GradleVersion.current());
    return new DefaultCacheRepository(
            scopeMapping,
            startParameter.getCacheUsage(),
            factory);
}
 
Example 9
Source File: BuildScopeServices.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
protected CacheRepository createCacheRepository() {
    CacheFactory factory = get(CacheFactory.class);
    StartParameter startParameter = get(StartParameter.class);
    DefaultCacheScopeMapping scopeMapping = new DefaultCacheScopeMapping(startParameter.getGradleUserHomeDir(), startParameter.getProjectCacheDir(), GradleVersion.current());
    return new DefaultCacheRepository(
            scopeMapping,
            factory);
}
 
Example 10
Source File: QuarkusPlugin.java    From quarkus with Apache License 2.0 4 votes vote down vote up
private void verifyGradleVersion() {
    if (GradleVersion.current().compareTo(GradleVersion.version("5.0")) < 0) {
        throw new GradleException("Quarkus plugin requires Gradle 5.0 or later. Current version is: " +
                GradleVersion.current());
    }
}
 
Example 11
Source File: DocumentationRegistry.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public DocumentationRegistry() {
    this.gradleVersion = GradleVersion.current();
}
 
Example 12
Source File: IntegrationTestBuildContext.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public GradleVersion getVersion() {
    return GradleVersion.current();
}
 
Example 13
Source File: IntegrationTestBuildContext.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public GradleVersion getVersion() {
    return GradleVersion.current();
}
 
Example 14
Source File: DocumentationRegistry.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public DocumentationRegistry() {
    this.gradleVersion = GradleVersion.current();
}
 
Example 15
Source File: DocumentationRegistry.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public DocumentationRegistry() {
    this.gradleVersion = GradleVersion.current();
}
 
Example 16
Source File: IntegrationTestBuildContext.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public GradleVersion getVersion() {
    return GradleVersion.current();
}
 
Example 17
Source File: DocumentationRegistry.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public DocumentationRegistry() {
    this.gradleVersion = GradleVersion.current();
}
 
Example 18
Source File: IntegrationTestBuildContext.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public GradleVersion getVersion() {
    return GradleVersion.current();
}