本文整理汇总了Java中org.gradle.api.plugins.ExtensionContainer.getByType方法的典型用法代码示例。如果您正苦于以下问题:Java ExtensionContainer.getByType方法的具体用法?Java ExtensionContainer.getByType怎么用?Java ExtensionContainer.getByType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.gradle.api.plugins.ExtensionContainer
的用法示例。
在下文中一共展示了ExtensionContainer.getByType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generate
import org.gradle.api.plugins.ExtensionContainer; //导入方法依赖的package包/类
public void generate() {
ExtensionContainer extensions = project.getExtensions();
EclipseCheckstyleExtension prefs = extensions.getByType(EclipseCheckstyleExtension.class);
CheckstyleExtension ext = project.getExtensions().getByType(CheckstyleExtension.class);
if (ext == null) {
return;
}
// Without a checkstyle config file defined, we currently don't do anything.
File configFile = ext.getConfigFile();
if (configFile == null || !configFile.exists()) {
return;
}
log.info("eclipse checkstyle: configuring eclipse checkstyle using config {}", configFile);
String configPath = configFile.toString();
String projectDir = project.getProjectDir().getAbsolutePath() + File.separator;
String name = project.getName() + "-checkstyle";
write(projectDir, CHECKSTYLE_CONFIG, build(name, configPath, prefs));
}
示例2: Settings
import org.gradle.api.plugins.ExtensionContainer; //导入方法依赖的package包/类
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);
}
示例3: publishing
import org.gradle.api.plugins.ExtensionContainer; //导入方法依赖的package包/类
@Model
PublishingExtension publishing(ExtensionContainer extensions) {
return extensions.getByType(PublishingExtension.class);
}
示例4: apply
import org.gradle.api.plugins.ExtensionContainer; //导入方法依赖的package包/类
public void apply(Project project) {
project.getPluginManager().apply(RhinoPlugin.class);
JavaScriptExtension jsExtension = project.getExtensions().getByType(JavaScriptExtension.class);
ExtensionContainer extensionContainer = ((ExtensionAware) jsExtension).getExtensions();
final CoffeeScriptExtension csExtension = extensionContainer.create(CoffeeScriptExtension.NAME, CoffeeScriptExtension.class);
final Configuration jsConfiguration = addJsConfiguration(project.getConfigurations(), project.getDependencies(), csExtension);
ConventionMapping conventionMapping = ((IConventionAware) csExtension).getConventionMapping();
conventionMapping.map("js", new Callable<Configuration>() {
@Override
public Configuration call() {
return jsConfiguration;
}
});
conventionMapping.map("version", new Callable<String>() {
@Override
public String call() {
return CoffeeScriptExtension.DEFAULT_JS_DEPENDENCY_VERSION;
}
});
final RhinoExtension rhinoExtension = extensionContainer.getByType(RhinoExtension.class);
project.getTasks().withType(CoffeeScriptCompile.class, new Action<CoffeeScriptCompile>() {
@Override
public void execute(CoffeeScriptCompile task) {
task.getConventionMapping().map("rhinoClasspath", new Callable<FileCollection>() {
public FileCollection call() {
return rhinoExtension.getClasspath();
}
});
task.getConventionMapping().map("coffeeScriptJs", new Callable<FileCollection>() {
public FileCollection call() {
return csExtension.getJs();
}
});
}
});
}
示例5: toolChains
import org.gradle.api.plugins.ExtensionContainer; //导入方法依赖的package包/类
@Model
NativeToolChainRegistryInternal toolChains(ExtensionContainer extensionContainer) {
return extensionContainer.getByType(NativeToolChainRegistryInternal.class);
}
示例6: buildTypes
import org.gradle.api.plugins.ExtensionContainer; //导入方法依赖的package包/类
@Model
BuildTypeContainer buildTypes(ExtensionContainer extensionContainer) {
return extensionContainer.getByType(BuildTypeContainer.class);
}
示例7: flavors
import org.gradle.api.plugins.ExtensionContainer; //导入方法依赖的package包/类
@Model
FlavorContainer flavors(ExtensionContainer extensionContainer) {
return extensionContainer.getByType(FlavorContainer.class);
}
示例8: gradlePluginDevelopmentExtension
import org.gradle.api.plugins.ExtensionContainer; //导入方法依赖的package包/类
@Model
public GradlePluginDevelopmentExtension gradlePluginDevelopmentExtension(ExtensionContainer extensionContainer) {
return extensionContainer.getByType(GradlePluginDevelopmentExtension.class);
}
示例9: configurations
import org.gradle.api.plugins.ExtensionContainer; //导入方法依赖的package包/类
@Model
PlayPluginConfigurations configurations(ExtensionContainer extensions) {
return extensions.getByType(PlayPluginConfigurations.class);
}
示例10: execute
import org.gradle.api.plugins.ExtensionContainer; //导入方法依赖的package包/类
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());
}
示例11: languages
import org.gradle.api.plugins.ExtensionContainer; //导入方法依赖的package包/类
@Model
LanguageRegistry languages(ExtensionContainer extensions) {
return extensions.getByType(LanguageRegistry.class);
}
示例12: sources
import org.gradle.api.plugins.ExtensionContainer; //导入方法依赖的package包/类
@Model
ProjectSourceSet sources(ExtensionContainer extensions) {
return extensions.getByType(ProjectSourceSet.class);
}
示例13: gracljInternalDependencies
import org.gradle.api.plugins.ExtensionContainer; //导入方法依赖的package包/类
@Model
public GracljInternal gracljInternalDependencies(ExtensionContainer extensions) {
return extensions.getByType(GracljInternal.class);
}
示例14: projectContext
import org.gradle.api.plugins.ExtensionContainer; //导入方法依赖的package包/类
/**
* Provide the project context
*
* @param extensions Extension container to look up the context
* @return Project context
*/
@Model
public ProjectContext projectContext(ExtensionContainer extensions) {
return extensions.getByType(ProjectContext.class);
}
示例15: eclipseModel
import org.gradle.api.plugins.ExtensionContainer; //导入方法依赖的package包/类
/**
* Provide the Eclipse plugin's configuration
*
* @param extensions Container to access extensions
* @return Eclipse plugin's configuration
*/
@Model
@Hidden
public EclipseModel eclipseModel(ExtensionContainer extensions) {
return extensions.getByType(EclipseModel.class);
}