本文整理汇总了Java中org.gradle.api.initialization.dsl.ScriptHandler类的典型用法代码示例。如果您正苦于以下问题:Java ScriptHandler类的具体用法?Java ScriptHandler怎么用?Java ScriptHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ScriptHandler类属于org.gradle.api.initialization.dsl包,在下文中一共展示了ScriptHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generate
import org.gradle.api.initialization.dsl.ScriptHandler; //导入依赖的package包/类
@TaskAction
public void generate() {
ProjectReportGenerator projectReportGenerator = new ProjectReportGenerator() {
@Override
public void generateReport(Project project) throws IOException {
Configuration configuration = getProject().getBuildscript().getConfigurations().getByName(ScriptHandler.CLASSPATH_CONFIGURATION);
renderer.startConfiguration(configuration);
renderer.render(configuration);
renderer.completeConfiguration(configuration);
}
};
ReportGenerator reportGenerator = new ReportGenerator(renderer, getClientMetaData(), null,
getTextOutputFactory(), projectReportGenerator);
reportGenerator.generateReport(Collections.singleton(getProject()));
}
示例2: applyScript
import org.gradle.api.initialization.dsl.ScriptHandler; //导入依赖的package包/类
private void applyScript(Object script) {
URI scriptUri = resolver.resolveUri(script);
ScriptSource scriptSource = new UriScriptSource("script", scriptUri);
ClassLoaderScope classLoaderScopeChild = classLoaderScope.createChild("script-" + scriptUri.toString());
ScriptHandler scriptHandler = scriptHandlerFactory.create(scriptSource, classLoaderScopeChild);
ScriptPlugin configurer = configurerFactory.create(scriptSource, scriptHandler, classLoaderScopeChild, classLoaderScope, false);
for (Object target : targets) {
configurer.apply(target);
}
}
示例3: applySettingsScript
import org.gradle.api.initialization.dsl.ScriptHandler; //导入依赖的package包/类
private void applySettingsScript(SettingsLocation settingsLocation, final SettingsInternal settings) {
ScriptSource settingsScriptSource = settingsLocation.getSettingsScriptSource();
ClassLoaderScope settingsClassLoaderScope = settings.getClassLoaderScope();
ScriptHandler scriptHandler = scriptHandlerFactory.create(settingsScriptSource, settingsClassLoaderScope);
ScriptPlugin configurer = configurerFactory.create(settingsScriptSource, scriptHandler, settingsClassLoaderScope, settings.getRootClassLoaderScope(), true);
configurer.apply(settings);
}
示例4: createScriptHandler
import org.gradle.api.initialization.dsl.ScriptHandler; //导入依赖的package包/类
protected ScriptHandler createScriptHandler() {
ScriptHandlerFactory factory = new DefaultScriptHandlerFactory(
get(DependencyManagementServices.class),
get(FileResolver.class),
get(DependencyMetaDataProvider.class));
return factory.create(project.getBuildScriptSource(), project.getClassLoaderScope(), project);
}
示例5: process
import org.gradle.api.initialization.dsl.ScriptHandler; //导入依赖的package包/类
public void process(final ScriptSource initScript, GradleInternal gradle) {
ClassLoaderScope baseScope = gradle.getClassLoaderScope();
URI uri = initScript.getResource().getLocation().getURI();
String id = uri == null ? idGenerator.generateId().toString() : uri.toString();
ClassLoaderScope scriptScope = baseScope.createChild("init-" + id);
ScriptHandler scriptHandler = scriptHandlerFactory.create(initScript, scriptScope);
ScriptPlugin configurer = configurerFactory.create(initScript, scriptHandler, scriptScope, baseScope, true);
configurer.apply(gradle);
}
示例6: defineScriptHandlerClassScope
import org.gradle.api.initialization.dsl.ScriptHandler; //导入依赖的package包/类
private void defineScriptHandlerClassScope(ScriptHandler scriptHandler, ClassLoaderScope classLoaderScope) {
Configuration classpathConfiguration = scriptHandler.getConfigurations().getByName(ScriptHandler.CLASSPATH_CONFIGURATION);
Set<File> files = classpathConfiguration.getFiles();
ClassPath classPath = new DefaultClassPath(files);
classLoaderScope.export(classPath);
classLoaderScope.lock();
}
示例7: create
import org.gradle.api.initialization.dsl.ScriptHandler; //导入依赖的package包/类
public ScriptHandler create(ScriptSource scriptSource, ClassLoaderScope classLoaderScope, DomainObjectContext context) {
DependencyResolutionServices services = dependencyManagementServices.create(fileResolver, dependencyMetaDataProvider, projectFinder, context);
RepositoryHandler repositoryHandler = services.getResolveRepositoryHandler();
ConfigurationContainer configurationContainer = services.getConfigurationContainer();
DependencyHandler dependencyHandler = services.getDependencyHandler();
return new DefaultScriptHandler(scriptSource, repositoryHandler, dependencyHandler, configurationContainer, new ScriptHandlerClassLoaderFactory(scriptSource, classLoaderScope));
}
示例8: applyScript
import org.gradle.api.initialization.dsl.ScriptHandler; //导入依赖的package包/类
private void applyScript(Object script) {
URI scriptUri = resolver.resolveUri(script);
UriScriptSource scriptSource = new UriScriptSource("script", scriptUri);
ClassLoaderScope classLoaderScopeChild = classLoaderScope.createChild();
ScriptHandler scriptHandler = scriptHandlerFactory.create(scriptSource, classLoaderScopeChild);
ScriptPlugin configurer = configurerFactory.create(scriptSource, scriptHandler, classLoaderScopeChild, classLoaderScope, "buildscript", DefaultScript.class, false);
for (Object target : targets) {
configurer.apply(target);
}
}
示例9: applySettingsScript
import org.gradle.api.initialization.dsl.ScriptHandler; //导入依赖的package包/类
private void applySettingsScript(SettingsLocation settingsLocation, final SettingsInternal settings) {
ScriptSource settingsScriptSource = settingsLocation.getSettingsScriptSource();
ClassLoaderScope settingsClassLoaderScope = settings.getClassLoaderScope();
ScriptHandler scriptHandler = scriptHandlerFactory.create(settingsScriptSource, settingsClassLoaderScope);
ScriptPlugin configurer = configurerFactory.create(settingsScriptSource, scriptHandler, settingsClassLoaderScope, settings.getRootClassLoaderScope(), "buildscript", SettingsScript.class, false);
configurer.apply(settings);
}
示例10: process
import org.gradle.api.initialization.dsl.ScriptHandler; //导入依赖的package包/类
public void process(final ScriptSource initScript, GradleInternal gradle) {
ClassLoaderScope baseScope = gradle.getClassLoaderScope();
ClassLoaderScope scriptScope = baseScope.createChild();
ScriptHandler scriptHandler = scriptHandlerFactory.create(initScript, scriptScope);
ScriptPlugin configurer = configurerFactory.create(initScript, scriptHandler, scriptScope, baseScope, "initscript", InitScript.class, false);
configurer.apply(gradle);
}
示例11: ScriptPluginImpl
import org.gradle.api.initialization.dsl.ScriptHandler; //导入依赖的package包/类
public ScriptPluginImpl(ScriptSource scriptSource, ScriptHandler scriptHandler, ClassLoaderScope targetScope, ClassLoaderScope baseScope, String classpathClosureName, Class<? extends BasicScript> scriptType, boolean ownerScript) {
this.scriptSource = scriptSource;
this.targetScope = targetScope;
this.baseScope = baseScope;
this.classpathClosureName = classpathClosureName;
this.scriptHandler = scriptHandler;
this.scriptType = scriptType;
this.ownerScript = ownerScript;
}
示例12: applyScript
import org.gradle.api.initialization.dsl.ScriptHandler; //导入依赖的package包/类
private void applyScript(Object script) {
URI scriptUri = resolver.resolveUri(script);
UriScriptSource scriptSource = new UriScriptSource("script", scriptUri);
ScriptHandler scriptHandler = scriptHandlerFactory.create(scriptSource, classLoaderScope);
ScriptPlugin configurer = configurerFactory.create(scriptSource, scriptHandler, classLoaderScope, "buildscript", DefaultScript.class);
for (Object target : targets) {
configurer.apply(target);
}
}
示例13: applySettingsScript
import org.gradle.api.initialization.dsl.ScriptHandler; //导入依赖的package包/类
private void applySettingsScript(SettingsLocation settingsLocation, final SettingsInternal settings) {
ScriptSource settingsScriptSource = settingsLocation.getSettingsScriptSource();
ClassLoaderScope classLoaderScope = settings.getClassLoaderScope();
ScriptHandler scriptHandler = scriptHandlerFactory.create(settingsScriptSource, classLoaderScope);
ScriptPlugin configurer = configurerFactory.create(settingsScriptSource, scriptHandler, classLoaderScope, "buildscript", SettingsScript.class);
configurer.apply(settings);
}
示例14: ScriptPluginImpl
import org.gradle.api.initialization.dsl.ScriptHandler; //导入依赖的package包/类
public ScriptPluginImpl(ScriptSource scriptSource, ScriptHandler scriptHandler, ClassLoaderScope classLoaderScope, String classpathClosureName, Class<? extends BasicScript> scriptType) {
this.scriptSource = scriptSource;
this.classLoaderScope = classLoaderScope;
this.classpathClosureName = classpathClosureName;
this.scriptHandler = scriptHandler;
this.scriptType = scriptType;
}
示例15: run
import org.gradle.api.initialization.dsl.ScriptHandler; //导入依赖的package包/类
@TaskAction
public void run() {
SortedSet<String> dependencies = new TreeSet<String>();
ConfigurationContainer container = getProject().getBuildscript().getConfigurations();
for (File file : container.getByName(ScriptHandler.CLASSPATH_CONFIGURATION))
dependencies.add(file.getName());
for (String dependency : dependencies)
System.out.println(dependency);
}