org.gradle.api.internal.plugins.ExtensionContainerInternal Java Examples

The following examples show how to use org.gradle.api.internal.plugins.ExtensionContainerInternal. 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: AbstractProject.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ExtensionContainerInternal getExtensions() {
    return (ExtensionContainerInternal) getConvention();
}
 
Example #2
Source File: AbstractProject.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ExtensionContainerInternal getExtensions() {
    return (ExtensionContainerInternal) getConvention();
}
 
Example #3
Source File: ShowConfigurationTask.java    From app-gradle-plugin with Apache License 2.0 4 votes vote down vote up
@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;
    }
    // ignore fields marked with InternalProperty
    if (field.getAnnotationsByType(InternalProperty.class).length > 0) {
      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();
}
 
Example #4
Source File: AbstractProject.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ExtensionContainerInternal getExtensions() {
    return (ExtensionContainerInternal) getConvention();
}
 
Example #5
Source File: AbstractProject.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ExtensionContainerInternal getExtensions() {
    return (ExtensionContainerInternal) getConvention();
}
 
Example #6
Source File: ProjectInternal.java    From pushfish-android with BSD 2-Clause "Simplified" License votes vote down vote up
ExtensionContainerInternal getExtensions(); 
Example #7
Source File: ProjectInternal.java    From pushfish-android with BSD 2-Clause "Simplified" License votes vote down vote up
ExtensionContainerInternal getExtensions(); 
Example #8
Source File: ProjectInternal.java    From Pushjet-Android with BSD 2-Clause "Simplified" License votes vote down vote up
ExtensionContainerInternal getExtensions(); 
Example #9
Source File: ProjectInternal.java    From Pushjet-Android with BSD 2-Clause "Simplified" License votes vote down vote up
ExtensionContainerInternal getExtensions();