Java 类org.gradle.api.internal.plugins.ExtensionContainerInternal 实例源码

项目:app-gradle-plugin    文件:ShowConfigurationTask.java   
@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();
}
项目:Reer    文件:DefaultProject.java   
public ExtensionContainerInternal getExtensions() {
    return (ExtensionContainerInternal) getConvention();
}
项目:Pushjet-Android    文件:AbstractProject.java   
public ExtensionContainerInternal getExtensions() {
    return (ExtensionContainerInternal) getConvention();
}
项目:Pushjet-Android    文件:AbstractProject.java   
public ExtensionContainerInternal getExtensions() {
    return (ExtensionContainerInternal) getConvention();
}
项目:Reer    文件:ProjectInternal.java   
ExtensionContainerInternal getExtensions();
项目:Pushjet-Android    文件:ProjectInternal.java   
ExtensionContainerInternal getExtensions();
项目:Pushjet-Android    文件:ProjectInternal.java   
ExtensionContainerInternal getExtensions();