• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ClosureBackedAction类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.gradle.api.internal.ClosureBackedAction的典型用法代码示例。如果您正苦于以下问题:Java ClosureBackedAction类的具体用法?Java ClosureBackedAction怎么用?Java ClosureBackedAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ClosureBackedAction类属于org.gradle.api.internal包,在下文中一共展示了ClosureBackedAction类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: registerConfigurationAction

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
private void registerConfigurationAction(final Closure<?> action) {
    modelRegistry.mutate(new ModelMutator<Object>() {
        public ModelReference<Object> getSubject() {
            return ModelReference.untyped(modelPath);
        }

        public void mutate(Object object, Inputs inputs) {
            new ClosureBackedAction<Object>(action).execute(object);
        }

        public ModelRuleDescriptor getDescriptor() {
            return new SimpleModelRuleDescriptor("model." + modelPath);
        }

        public List<ModelReference<?>> getInputs() {
            return Collections.emptyList();
        }
    });
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:20,代码来源:NonTransformedModelDslBacking.java


示例2: createRepository

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
private RemoteRepository createRepository(Map properties, Closure closure) {
    RemoteRepository repository = new MavenRemoteRepository();
    ConfigureUtil.configureByMap(properties, repository);
    // Should be using ConfigureUtil (with DELEGATE_FIRST strategy), however for backwards compatibility need to use OWNER_FIRST
    new ClosureBackedAction<RemoteRepository>(closure, Closure.OWNER_FIRST).execute(repository);
    return repository;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:DefaultGroovyMavenDeployer.java


示例3: registerConfigurationAction

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
private void registerConfigurationAction(final Closure<?> action) {
    modelRegistry.configure(ModelActionRole.Mutate,
        new NoInputsModelAction<Object>(
            ModelReference.untyped(modelPath),
            new SimpleModelRuleDescriptor("model." + modelPath), new ClosureBackedAction<Object>(action)
        ));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:NonTransformedModelDslBacking.java


示例4: configure

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
public void configure(Closure<?> action) {
    executingDsl.set(true);
    try {
        ClosureBackedAction.execute(this, action);
    } finally {
        executingDsl.set(false);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:NonTransformedModelDslBacking.java


示例5: execute

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
public void execute(final Closure antClosure) {
    classLoaderCache.withCachedClassLoader(libClasspath, gradleApiGroovyLoader, antAdapterGroovyLoader,
        new Factory<ClassLoader>() {
            @Override
            public ClassLoader create() {
                return new VisitableURLClassLoader(baseAntLoader, libClasspath);
            }
        }, new Action<CachedClassLoader>() {
            @Override
            public void execute(CachedClassLoader cachedClassLoader) {
                ClassLoader classLoader = cachedClassLoader.getClassLoader();
                Object antBuilder = newInstanceOf("org.gradle.api.internal.project.ant.BasicAntBuilder");
                Object antLogger = newInstanceOf("org.gradle.api.internal.project.ant.AntLoggingAdapter");

                // This looks ugly, very ugly, but that is apparently what Ant does itself
                ClassLoader originalLoader = Thread.currentThread().getContextClassLoader();
                Thread.currentThread().setContextClassLoader(classLoader);

                try {
                    configureAntBuilder(antBuilder, antLogger);

                    // Ideally, we'd delegate directly to the AntBuilder, but its Closure class is different to our caller's
                    // Closure class, so the AntBuilder's methodMissing() doesn't work. It just converts our Closures to String
                    // because they are not an instanceof its Closure class.
                    Object delegate = new AntBuilderDelegate(antBuilder, classLoader);
                    ClosureBackedAction.execute(delegate, antClosure);
                } finally {
                    Thread.currentThread().setContextClassLoader(originalLoader);
                    disposeBuilder(antBuilder, antLogger);
                }
            }
        });
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:34,代码来源:DefaultIsolatedAntBuilder.java


示例6: model

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
public void model(Closure<?> modelRules) {
    ModelRegistry modelRegistry = getModelRegistry();
    if (TransformedModelDslBacking.isTransformedBlock(modelRules)) {
        ClosureBackedAction.execute(new TransformedModelDslBacking(modelRegistry, this.getRootProject().getFileResolver()), modelRules);
    } else {
        new NonTransformedModelDslBacking(modelRegistry).configure(modelRules);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:DefaultProject.java


示例7: configureTarget

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
private static <T> void configureTarget(Closure configureClosure, T target, ConfigureDelegate closureDelegate) {
    if (!(configureClosure instanceof GeneratedClosure)) {
        new ClosureBackedAction<T>(configureClosure, Closure.DELEGATE_FIRST, false).execute(target);
        return;
    }

    // Hackery to make closure execution faster, by short-circuiting the expensive property and method lookup on Closure
    Closure withNewOwner = configureClosure.rehydrate(target, closureDelegate, configureClosure.getThisObject());
    new ClosureBackedAction<T>(withNewOwner, Closure.OWNER_ONLY, false).execute(target);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:ConfigureUtil.java


示例8: create

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
public synchronized AndroidTask<Task> create(
        TaskFactory taskFactory,
        String taskName,
        Closure configAction) {

    taskFactory.create(taskName, DefaultTask.class, new ClosureBackedAction<Task>(configAction));
    final AndroidTask<Task> newTask = new AndroidTask<Task>(taskName, Task.class);
    tasks.put(taskName, newTask);

    return newTask;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:AndroidTaskRegistry.java


示例9: configure

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
public void configure(Closure<?> action) {
    executingDsl.set(true);
    try {
        new ClosureBackedAction<Object>(action).execute(this);
    } finally {
        executingDsl.set(false);
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:9,代码来源:NonTransformedModelDslBacking.java


示例10: mutate

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
public void mutate(final Object object, Inputs inputs) {
    RuleInputAccessBacking.runWithContext(inputs, new Runnable() {
        public void run() {
            new ClosureBackedAction<Object>(action).execute(object);
        }
    });
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:8,代码来源:ClosureBackedModelMutator.java


示例11: repackage

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
@Nonnull
public FileCollection repackage(@Nonnull String name, @Nonnull Closure<?> c) {
    JarjarTask jarjar = project.getTasks().create(
            name,
            JarjarTask.class,
            new ClosureBackedAction<JarjarTask>(c));
    return jarjar.getOutputs().getFiles();
}
 
开发者ID:shevek,项目名称:jarjar,代码行数:9,代码来源:JarjarController.java


示例12: reports

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
/**
 * Configures the reports to be generated by this task.
 */
public PmdReports reports(@DelegatesTo(value = PmdReports.class, strategy = Closure.DELEGATE_FIRST) Closure closure) {
    return reports(new ClosureBackedAction<PmdReports>(closure));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:7,代码来源:Pmd.java


示例13: reports

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
/**
 * Configures the reports to be generated by this task.
 */
public CodeNarcReports reports(Closure closure) {
    return reports(new ClosureBackedAction<CodeNarcReports>(closure));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:7,代码来源:CodeNarc.java


示例14: create

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
public void create(Closure<?> closure) {
    create(ClosureBackedAction.of(closure));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:NodeBackedModelSet.java


示例15: afterEach

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
public void afterEach(Closure<?> closure) {
    afterEach(ClosureBackedAction.of(closure));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:NodeBackedModelSet.java


示例16: beforeEach

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
public void beforeEach(Closure<?> closure) {
    beforeEach(ClosureBackedAction.of(closure));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:NodeBackedModelSet.java


示例17: create

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
public void create(String name, Closure<? super I> configAction) {
    create(name, new ClosureBackedAction<I>(configAction));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:ModelMapGroovyView.java


示例18: named

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
public void named(String name, Closure<? super I> configAction) {
    named(name, new ClosureBackedAction<I>(configAction));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:ModelMapGroovyView.java


示例19: all

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
public void all(Closure<? super I> configAction) {
    all(new ClosureBackedAction<I>(configAction));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:ModelMapGroovyView.java


示例20: withType

import org.gradle.api.internal.ClosureBackedAction; //导入依赖的package包/类
public <S> void withType(Class<S> type, Closure<? super S> configAction) {
    withType(type, new ClosureBackedAction<S>(configAction));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:ModelMapGroovyView.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SEIInvokerTube类代码示例发布时间:2022-05-23
下一篇:
Java Function2类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap