本文整理汇总了Java中org.gradle.api.plugins.ExtensionContainer类的典型用法代码示例。如果您正苦于以下问题:Java ExtensionContainer类的具体用法?Java ExtensionContainer怎么用?Java ExtensionContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExtensionContainer类属于org.gradle.api.plugins包,在下文中一共展示了ExtensionContainer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: apply
import org.gradle.api.plugins.ExtensionContainer; //导入依赖的package包/类
@Override
public void apply(Project project) {
final ConfigurationContainer configurations = project.getConfigurations();
configurations.maybeCreate("test");
configurations.maybeCreate("build");
configurations.maybeCreate("tool");
final ExtensionContainer extensions = project.getExtensions();
final ExtensionAware golang = (ExtensionAware) extensions.create("golang", GolangSettings.class, true, project);
golang.getExtensions().create("build", BuildSettings.class, true, project);
golang.getExtensions().create("toolchain", ToolchainSettings.class, true, project);
golang.getExtensions().create("dependencies", DependenciesSettings.class, true, project);
golang.getExtensions().create("testing", TestingSettings.class, true, project);
extensions.create(INSTANCE_PROPERTY_NAME, Reference.class, this);
final TaskContainer tasks = project.getTasks();
addTasks(tasks);
}
开发者ID:echocat,项目名称:gradle-golang-plugin,代码行数:20,代码来源:GolangPluginSupport.java
示例2: 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));
}
开发者ID:phensley,项目名称:gradle-eclipse-checkstyle,代码行数:22,代码来源:EclipseCheckstyle.java
示例3: setUp
import org.gradle.api.plugins.ExtensionContainer; //导入依赖的package包/类
@Before
public void setUp() {
project = mock(Project.class);
// project.getExtensions().getExtraProperties().set(passwordProperty, pass);
ExtensionContainer extensionContainer = mock(ExtensionContainer.class);
when(project.getExtensions()).thenReturn(extensionContainer);
extraProperties = mock(ExtraPropertiesExtension.class);
when(extensionContainer.getExtraProperties()).thenReturn(extraProperties);
}
开发者ID:Unity-Group,项目名称:gradle-lazy-credentials,代码行数:10,代码来源:PasswordPromptTest.java
示例4: 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);
}
开发者ID:echocat,项目名称:gradle-golang-plugin,代码行数:13,代码来源:Settings.java
示例5: createReadmeUpdateTasks
import org.gradle.api.plugins.ExtensionContainer; //导入依赖的package包/类
/**
* Create task to update readme file from template
*
* @param tasks Task container to create new tasks
* @param projectConfig Project configuration
* @param projectContext Project context
* @param extensions Extension container
*/
@Mutate
public void createReadmeUpdateTasks(ModelMap<Task> tasks, ProjectConfig projectConfig,
ProjectContext projectContext, ExtensionContainer extensions) {
// Create task to update the README
Map<String, Object> context = new HashMap<>();
extensions.getExtraProperties().getProperties().forEach((name, value) -> {
context.put(name, value);
});
context.put("project", projectContext);
context.put("projectConfig", projectConfig);
tasks.create("readmeUpdate", Copy.class, t -> {
t.setDescription("Update README from template.");
t.setGroup("documentation");
t.from("src/doc/templates");
t.include("README.template.md");
t.rename(n -> n.replace(".template.", "."));
t.expand(context);
ConventionMapping parameters = t.getConventionMapping();
parameters.map("destinationDir", () -> projectContext.getProjectDir());
});
tasks.named("assemble", t -> {
t.dependsOn("readmeUpdate");
});
}
开发者ID:jochenseeber,项目名称:gradle-project-config,代码行数:38,代码来源:ProjectConfigPlugin.java
示例6: setUp
import org.gradle.api.plugins.ExtensionContainer; //导入依赖的package包/类
@Before
public void setUp() {
this.project = mock(Project.class);
ExtensionContainer extensionContainer = mock(ExtensionContainer.class);
this.pluginExtension = sampleExtension(this.project);
when(extensionContainer.findByType(CfPluginExtension.class)).thenReturn(this.pluginExtension);
when(this.project.getExtensions()).thenReturn(extensionContainer);
this.cfPropertiesMapper = new CfPropertiesMapper(this.project);
}
开发者ID:pivotalservices,项目名称:ya-cf-app-gradle-plugin,代码行数:10,代码来源:CfPropertiesMapperTest.java
示例7: RegisterTypeRule
import org.gradle.api.plugins.ExtensionContainer; //导入依赖的package包/类
protected RegisterTypeRule(ModelType<? extends T> type, ModelType<? extends U> implementation, ModelRuleDescriptor descriptor, Action<? super RegistrationContext<T, U>> registerAction) {
this.type = type;
this.implementation = implementation;
this.descriptor = descriptor;
this.registerAction = registerAction;
subject = ModelReference.of("extensions", ExtensionContainer.class);
inputs = ImmutableList.<ModelReference<?>>of(ModelReference.of(ProjectIdentifier.class));
}
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:10,代码来源:ComponentModelRuleDefinitionHandler.java
示例8: mutate
import org.gradle.api.plugins.ExtensionContainer; //导入依赖的package包/类
public final void mutate(final ExtensionContainer extensionContainer, final Inputs inputs) {
RuleContext.inContext(getDescriptor(), new Runnable() {
public void run() {
RegistrationContext<T, U> context = new RegistrationContext<T, U>(type, implementation, extensionContainer, inputs.get(0, ModelType.of(ProjectIdentifier.class)).getInstance());
registerAction.execute(context);
}
});
}
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:9,代码来源:ComponentModelRuleDefinitionHandler.java
示例9: registerPlatformExtension
import org.gradle.api.plugins.ExtensionContainer; //导入依赖的package包/类
@Mutate
void registerPlatformExtension(ExtensionContainer extensions, PlatformContainer platforms) {
extensions.add("platforms", platforms);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:ComponentModelBasePlugin.java
示例10: publishing
import org.gradle.api.plugins.ExtensionContainer; //导入依赖的package包/类
@Model
PublishingExtension publishing(ExtensionContainer extensions) {
return extensions.getByType(PublishingExtension.class);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:PublishingPlugin.java
示例11: 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();
}
});
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:42,代码来源:CoffeeScriptBasePlugin.java
示例12: toolChains
import org.gradle.api.plugins.ExtensionContainer; //导入依赖的package包/类
@Model
NativeToolChainRegistryInternal toolChains(ExtensionContainer extensionContainer) {
return extensionContainer.getByType(NativeToolChainRegistryInternal.class);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:NativeComponentModelPlugin.java
示例13: buildTypes
import org.gradle.api.plugins.ExtensionContainer; //导入依赖的package包/类
@Model
BuildTypeContainer buildTypes(ExtensionContainer extensionContainer) {
return extensionContainer.getByType(BuildTypeContainer.class);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:NativeComponentModelPlugin.java
示例14: flavors
import org.gradle.api.plugins.ExtensionContainer; //导入依赖的package包/类
@Model
FlavorContainer flavors(ExtensionContainer extensionContainer) {
return extensionContainer.getByType(FlavorContainer.class);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:NativeComponentModelPlugin.java
示例15: gradlePluginDevelopmentExtension
import org.gradle.api.plugins.ExtensionContainer; //导入依赖的package包/类
@Model
public GradlePluginDevelopmentExtension gradlePluginDevelopmentExtension(ExtensionContainer extensionContainer) {
return extensionContainer.getByType(GradlePluginDevelopmentExtension.class);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:JavaGradlePluginPlugin.java
示例16: getExtensions
import org.gradle.api.plugins.ExtensionContainer; //导入依赖的package包/类
public ExtensionContainer getExtensions() {
return convention;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:DefaultNamedDomainObjectCollection.java
示例17: getExtensions
import org.gradle.api.plugins.ExtensionContainer; //导入依赖的package包/类
public ExtensionContainer getExtensions() {
return getConvention();
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:AbstractTask.java
示例18: getExtensions
import org.gradle.api.plugins.ExtensionContainer; //导入依赖的package包/类
public ExtensionContainer getExtensions() {
if (extensionContainer == null) {
this.extensionContainer = toType(object, ExtensionAware.class).getExtensions();
}
return extensionContainer;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:7,代码来源:DslObject.java
示例19: configurations
import org.gradle.api.plugins.ExtensionContainer; //导入依赖的package包/类
@Model
PlayPluginConfigurations configurations(ExtensionContainer extensions) {
return extensions.getByType(PlayPluginConfigurations.class);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:PlayApplicationPlugin.java
示例20: RegistrationContext
import org.gradle.api.plugins.ExtensionContainer; //导入依赖的package包/类
public RegistrationContext(ModelType<? extends T> type, ModelType<? extends U> implementation, ExtensionContainer extensions, ProjectIdentifier projectIdentifier) {
this.type = type;
this.implementation = implementation;
this.extensions = extensions;
this.projectIdentifier = projectIdentifier;
}
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:7,代码来源:ComponentModelRuleDefinitionHandler.java
注:本文中的org.gradle.api.plugins.ExtensionContainer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论