Java Code Examples for org.gradle.api.plugins.ExtensionContainer#getByType()
The following examples show how to use
org.gradle.api.plugins.ExtensionContainer#getByType() .
These examples are extracted from open source projects.
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 Project: gradle-golang-plugin File: Settings.java License: Mozilla Public License 2.0 | 5 votes |
public Settings(@Nonnull Project project, @Nonnull ExtensionContainer container) { _project = project; _golang = container.getByType(GolangSettings.class); if (!(_golang instanceof ExtensionAware)) { throw new IllegalStateException("golang instance (" + _golang + ") of provided extension container (" + container + ") is not an instance of " + ExtensionAware.class.getName() + "."); } final ExtensionContainer globalExtensions = ((ExtensionAware) _golang).getExtensions(); _build = globalExtensions.getByType(BuildSettings.class); _toolchain = globalExtensions.getByType(ToolchainSettings.class); _dependencies = globalExtensions.getByType(DependenciesSettings.class); _testing = globalExtensions.getByType(TestingSettings.class); }
Example 2
Source Project: pushfish-android File: ComponentTypeRuleDefinitionHandler.java License: BSD 2-Clause "Simplified" License | 4 votes |
public void execute(final RegistrationContext<ComponentSpec, BaseComponentSpec> context) { ExtensionContainer extensions = context.getExtensions(); ProjectSourceSet projectSourceSet = extensions.getByType(ProjectSourceSet.class); ComponentSpecContainer componentSpecs = extensions.getByType(ComponentSpecContainer.class); doRegister(context.getType(), context.getImplementation(), projectSourceSet, componentSpecs, context.getProjectIdentifier()); }
Example 3
Source Project: pushfish-android File: ComponentModelBasePlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model LanguageRegistry languages(ExtensionContainer extensions) { return extensions.getByType(LanguageRegistry.class); }
Example 4
Source Project: pushfish-android File: LanguageBasePlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model ProjectSourceSet sources(ExtensionContainer extensions) { return extensions.getByType(ProjectSourceSet.class); }
Example 5
Source Project: pushfish-android File: PublishingPlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model PublishingExtension publishing(ExtensionContainer extensions) { return extensions.getByType(PublishingExtension.class); }
Example 6
Source Project: pygradle File: ExtensionUtils.java License: Apache License 2.0 | 4 votes |
public static <T> T getPythonComponentExtension(PythonExtension extension, Class<T> type) { ExtensionContainer extensionContainer = ((ExtensionAware) extension).getExtensions(); return extensionContainer.getByType(type); }
Example 7
Source Project: Pushjet-Android File: ComponentTypeRuleDefinitionHandler.java License: BSD 2-Clause "Simplified" License | 4 votes |
public void execute(final RegistrationContext<ComponentSpec, BaseComponentSpec> context) { ExtensionContainer extensions = context.getExtensions(); ProjectSourceSet projectSourceSet = extensions.getByType(ProjectSourceSet.class); ComponentSpecContainer componentSpecs = extensions.getByType(ComponentSpecContainer.class); doRegister(context.getType(), context.getImplementation(), projectSourceSet, componentSpecs, context.getProjectIdentifier()); }
Example 8
Source Project: Pushjet-Android File: ComponentModelBasePlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model LanguageRegistry languages(ExtensionContainer extensions) { return extensions.getByType(LanguageRegistry.class); }
Example 9
Source Project: Pushjet-Android File: LanguageBasePlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model ProjectSourceSet sources(ExtensionContainer extensions) { return extensions.getByType(ProjectSourceSet.class); }
Example 10
Source Project: Pushjet-Android File: PublishingPlugin.java License: BSD 2-Clause "Simplified" License | 4 votes |
@Model PublishingExtension publishing(ExtensionContainer extensions) { return extensions.getByType(PublishingExtension.class); }