当前位置: 首页>>代码示例>>Java>>正文


Java ExtensionContainerInternal类代码示例

本文整理汇总了Java中org.gradle.api.internal.plugins.ExtensionContainerInternal的典型用法代码示例。如果您正苦于以下问题:Java ExtensionContainerInternal类的具体用法?Java ExtensionContainerInternal怎么用?Java ExtensionContainerInternal使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ExtensionContainerInternal类属于org.gradle.api.internal.plugins包,在下文中一共展示了ExtensionContainerInternal类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getExtensionData

import org.gradle.api.internal.plugins.ExtensionContainerInternal; //导入依赖的package包/类
@VisibleForTesting
// recursive (but doesn't search through nested objects, only nested extensions)
static String getExtensionData(String extensionName, Object extensionInstance, int depth)
    throws IllegalAccessException {
  StringBuilder result = new StringBuilder("");
  // extension start block
  result.append(spaces(depth)).append(extensionName).append(" {\n");

  // all non-extension fields
  for (Field field : extensionInstance.getClass().getSuperclass().getDeclaredFields()) {
    // ignore synthetic fields (stuff added by compiler or instrumenter)
    if (field.isSynthetic()) {
      continue;
    }
    // This is just a helper for the extensions, don't show it
    if (field.getType().equals(org.gradle.api.Project.class)) {
      continue;
    }
    result.append(getFieldData(field, extensionInstance, depth + 1));
  }

  // all extension fields
  Map<String, Object> map =
      ((ExtensionContainerInternal) ((ExtensionAware) extensionInstance).getExtensions())
          .getAsMap();
  for (String childExtensionName : map.keySet()) {
    Object childExtensionInstance = map.get(childExtensionName);
    // only expand out extensions we understand (we're ignoring the default ext group here, which
    // is not ExtensionAware)
    if (childExtensionInstance instanceof ExtensionAware) {
      result.append(getExtensionData(childExtensionName, map.get(childExtensionName), depth + 1));
    }
  }

  // extension end block
  result.append(spaces(depth)).append("}\n");

  return result.toString();
}
 
开发者ID:GoogleCloudPlatform,项目名称:app-gradle-plugin,代码行数:40,代码来源:ShowConfigurationTask.java

示例2: getExtensions

import org.gradle.api.internal.plugins.ExtensionContainerInternal; //导入依赖的package包/类
public ExtensionContainerInternal getExtensions() {
    return (ExtensionContainerInternal) getConvention();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:DefaultProject.java

示例3: getExtensions

import org.gradle.api.internal.plugins.ExtensionContainerInternal; //导入依赖的package包/类
ExtensionContainerInternal getExtensions(); 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:2,代码来源:ProjectInternal.java


注:本文中的org.gradle.api.internal.plugins.ExtensionContainerInternal类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。