当前位置: 首页>>代码示例>>Java>>正文


Java ScriptHandler类代码示例

本文整理汇总了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()));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:17,代码来源:BuildEnvironmentReportTask.java

示例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);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:DefaultObjectConfigurationAction.java

示例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);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:ScriptEvaluatingSettingsProcessor.java

示例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);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:ProjectScopeServices.java

示例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);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:DefaultInitScriptProcessor.java

示例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();
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:8,代码来源:DefaultPluginRequestApplicator.java

示例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));
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:8,代码来源:DefaultScriptHandlerFactory.java

示例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);
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:11,代码来源:DefaultObjectConfigurationAction.java

示例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);
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:8,代码来源:ScriptEvaluatingSettingsProcessor.java

示例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);
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:8,代码来源:DefaultInitScriptProcessor.java

示例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;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:10,代码来源:DefaultScriptPluginFactory.java

示例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);
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:10,代码来源:DefaultObjectConfigurationAction.java

示例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);
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:8,代码来源:ScriptEvaluatingSettingsProcessor.java

示例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;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:8,代码来源:DefaultScriptPluginFactory.java

示例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);

}
 
开发者ID:shevek,项目名称:gradle-stdproject-plugin,代码行数:11,代码来源:BuildDependencies.java


注:本文中的org.gradle.api.initialization.dsl.ScriptHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。