org.gradle.model.Defaults类的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中org.gradle.model.Defaults类的一些代码示例,展示了Defaults类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Defaults类的具体详情如下:
包路径:org.gradle.model.Defaults
类名称:Defaults

Defaults介绍

暂无

代码示例

代码示例来源:origin: me.seeber.gradle/gradle-project-config

/**
 * Initialize the Gradle plugin extension
 *
 * @param pluginExtension Gradle plugin extension to initialize
 */
@Defaults
public void initializeGradlePluginDevelopmentExtension(GradlePluginDevelopmentExtension pluginExtension) {
  pluginExtension.setAutomatedPublishing(false);
}

代码示例来源:origin: gradle.plugin.me.seeber.gradle/gradle-project-config

/**
 * Initialize the Gradle plugin extension
 *
 * @param pluginExtension Gradle plugin extension to initialize
 */
@Defaults
public void initializeGradlePluginDevelopmentExtension(GradlePluginDevelopmentExtension pluginExtension) {
  pluginExtension.setAutomatedPublishing(false);
}

代码示例来源:origin: me.seeber.gradle/gradle-bintray-config

/**
 * Initialize the Bintray configuration
 *
 * @param bintrayConfig Bintray configuration to initialize
 */
@Defaults
public void initializeBintrayConfig(BintrayConfig bintrayConfig) {
  bintrayConfig.setRepository("maven");
}

代码示例来源:origin: gradle.plugin.me.seeber.gradle/gradle-plugin-publish-config

/**
 * Initialize the plugin development extension
 *
 * @param pluginExtension Plugin development extension
 */
@Defaults
public void initializeGradlePluginDevelopmentExtension(GradlePluginDevelopmentExtension pluginExtension) {
  pluginExtension.setAutomatedPublishing(false);
}

代码示例来源:origin: gradle.plugin.me.seeber.gradle/gradle-bintray-config

/**
 * Initialize the Bintray configuration
 *
 * @param bintrayConfig Bintray configuration to initialize
 */
@Defaults
public void initializeBintrayConfig(BintrayConfig bintrayConfig) {
  bintrayConfig.setRepository("maven");
}

代码示例来源:origin: me.seeber.gradle/gradle-plugin-publish-config

/**
 * Initialize the plugin development extension
 *
 * @param pluginExtension Plugin development extension
 */
@Defaults
public void initializeGradlePluginDevelopmentExtension(GradlePluginDevelopmentExtension pluginExtension) {
  pluginExtension.setAutomatedPublishing(false);
}

代码示例来源:origin: gradle.plugin.me.seeber.gradle/gradle-project-config

/**
   * Initialize the project configuration
   *
   * @param projectConfig Project configuration
   * @param annotationsConfig Annotations configuration
   */
  @Defaults
  public void initializeProjectConfig(ProjectConfig projectConfig, AnnotatedProject annotationsConfig) {
    License license = projectConfig.getLicense();
    license.exclude("*.eea");
  }
}

代码示例来源:origin: me.seeber.gradle/gradle-project-config

/**
   * Initialize the project configuration
   *
   * @param projectConfig Project configuration
   * @param annotationsConfig Annotations configuration
   */
  @Defaults
  public void initializeProjectConfig(ProjectConfig projectConfig, AnnotatedProject annotationsConfig) {
    License license = projectConfig.getLicense();
    license.exclude("*.eea");
  }
}

代码示例来源:origin: me.seeber.gradle/gradle-project-config

/**
 * Initialize the Java plugin convention
 *
 * @param javaConvention Java plugin convention to initialize
 */
@Defaults
public void initializeJavaPluginConvention(JavaPluginConvention javaConvention) {
  javaConvention.setSourceCompatibility("1.8");
  javaConvention.setTargetCompatibility("1.8");
}

代码示例来源:origin: gradle.plugin.me.seeber.gradle/gradle-project-config

/**
 * Initialize the Java plugin convention
 *
 * @param javaConvention Java plugin convention to initialize
 */
@Defaults
public void initializeJavaPluginConvention(JavaPluginConvention javaConvention) {
  javaConvention.setSourceCompatibility("1.8");
  javaConvention.setTargetCompatibility("1.8");
}

代码示例来源:origin: me.seeber.gradle/gradle-github-config

/**
 * Initialize the Github configuration
 *
 * @param githubConfig Github configuration to initialize
 * @param project Project context
 */
@Defaults
public void initializeGithubConfig(GithubConfig githubConfig, ProjectContext project) {
  githubConfig.setRepository(project.getName());
}

代码示例来源:origin: me.seeber.gradle/gradle-git-config

/**
   * Initialize the Project configuration
   *
   * @param projectConfig Project configuration to initialize
   */
  @Defaults
  public void initializeProjectConfig(ProjectConfig projectConfig) {
    projectConfig.getVersionControl().ignore("/.checkstyle");
  }
}

代码示例来源:origin: gradle.plugin.me.seeber.gradle/gradle-github-config

/**
 * Initialize the Github configuration
 *
 * @param githubConfig Github configuration to initialize
 * @param project Project context
 */
@Defaults
public void initializeGithubConfig(GithubConfig githubConfig, ProjectContext project) {
  githubConfig.setRepository(project.getName());
}

代码示例来源:origin: me.seeber.gradle/gradle-project-config

/**
 * Initialize the annotations configuration
 *
 * @param annotatedProject Annotations configuration to initialize
 * @param project Project context
 */
@Defaults
public void initializeAnnotationsConfig(AnnotatedProject annotatedProject, ProjectContext project) {
  Matcher matcher = ID_PATTERN.matcher(project.getName());
  if (matcher.matches()) {
    annotatedProject.setId(matcher.group(1));
  }
  matcher = VERSION_PATTERN.matcher(project.getVersion().toString());
  if (matcher.matches()) {
    annotatedProject.setVersion(matcher.group(1));
  }
}

代码示例来源:origin: gradle.plugin.me.seeber.gradle/gradle-project-config

/**
 * Initialize the annotations configuration
 *
 * @param annotatedProject Annotations configuration to initialize
 * @param project Project context
 */
@Defaults
public void initializeAnnotationsConfig(AnnotatedProject annotatedProject, ProjectContext project) {
  Matcher matcher = ID_PATTERN.matcher(project.getName());
  if (matcher.matches()) {
    annotatedProject.setId(matcher.group(1));
  }
  matcher = VERSION_PATTERN.matcher(project.getVersion().toString());
  if (matcher.matches()) {
    annotatedProject.setVersion(matcher.group(1));
  }
}

代码示例来源:origin: me.seeber.gradle/gradle-bintray-config

/**
 * Add GitHub configuration
 *
 * @param bintrayConfig Bintray configuration
 * @param githubConfig Github configuration
 */
@Defaults
public void configureBintrayExtension(BintrayExtension bintrayConfig, GithubConfig githubConfig) {
  PackageConfig pkg = bintrayConfig.getPkg();
  pkg.setGithubRepo(String.format("%s/%s", githubConfig.getUser(), githubConfig.getRepository()));
}

代码示例来源:origin: me.seeber.gradle/gradle-project-config

/**
 * Configure the wrapper task
 *
 * @param wrapper Wrapper task to configure
 * @param projectConfig Project configuration to get required Gradle version
 */
@Defaults
public void configureWrapperTask(@Each Wrapper wrapper, ProjectConfig projectConfig) {
  if (!Strings.isNullOrEmpty(projectConfig.getGradleVersion())) {
    wrapper.setGradleVersion(projectConfig.getGradleVersion());
  }
}

代码示例来源:origin: gradle.plugin.me.seeber.gradle/gradle-project-config

/**
 * Configure the wrapper task
 *
 * @param wrapper Wrapper task to configure
 * @param projectConfig Project configuration to get required Gradle version
 */
@Defaults
public void configureWrapperTask(@Each Wrapper wrapper, ProjectConfig projectConfig) {
  if (!Strings.isNullOrEmpty(projectConfig.getGradleVersion())) {
    wrapper.setGradleVersion(projectConfig.getGradleVersion());
  }
}

代码示例来源:origin: gradle.plugin.me.seeber.gradle/gradle-bintray-config

/**
 * Add GitHub configuration
 *
 * @param bintrayConfig Bintray configuration
 * @param githubConfig Github configuration
 */
@Defaults
public void configureBintrayExtension(BintrayExtension bintrayConfig, GithubConfig githubConfig) {
  PackageConfig pkg = bintrayConfig.getPkg();
  pkg.setGithubRepo(String.format("%s/%s", githubConfig.getUser(), githubConfig.getRepository()));
}

代码示例来源:origin: me.seeber.gradle/gradle-project-config

/**
 * Initialize the Eclipse configuration
 *
 * @param eclipse Eclipse configuration to initialize
 * @param project Current Gradle project
 */
@Defaults
public void initializeEclipseConfig(EclipseConfig eclipse, ProjectIdentifier project) {
  try {
    Map<String, Object> context = new HashMap<>();
    context.put("project", project);
    @NonNull URL resource = Validate
        .notNull(Resources.getResource(EclipseConfigPlugin.class, "codetemplates.xml"));
    String templateText = Resources.toString(resource, Charsets.UTF_8);
    TemplateEngine engine = new SimpleTemplateEngine();
    String templates = engine.createTemplate(templateText).make(context).toString();
    eclipse.getUi().setCodeTemplates(templates);
  }
  catch (Exception e) {
    throw new RuntimeException("Could not set code templates", e);
  }
}

相关文章

Defaults类方法