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


Java IvyContext.popContext方法代码示例

本文整理汇总了Java中org.apache.ivy.core.IvyContext.popContext方法的典型用法代码示例。如果您正苦于以下问题:Java IvyContext.popContext方法的具体用法?Java IvyContext.popContext怎么用?Java IvyContext.popContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.ivy.core.IvyContext的用法示例。


在下文中一共展示了IvyContext.popContext方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getEasyAntModuleDescriptor

import org.apache.ivy.core.IvyContext; //导入方法依赖的package包/类
public EasyAntModuleDescriptor getEasyAntModuleDescriptor(File moduleDescriptor) throws Exception {
    if (moduleDescriptor == null) {
        throw new Exception("moduleDescriptor cannot be null");
    }
    if (!moduleDescriptor.exists()) {
        throw new Exception("imposible to find the specified module descriptor"
                + moduleDescriptor.getAbsolutePath());
    }
    IvyContext.pushNewContext().setIvy(ivyInstance);
    // First we need to parse the specified file to retrieve all the easyant
    // stuff
    parser.parseDescriptor(ivyInstance.getSettings(), moduleDescriptor.toURI().toURL(), new URLResource(
            moduleDescriptor.toURI().toURL()), true);
    EasyAntModuleDescriptor md = parser.getEasyAntModuleDescriptor();
    IvyContext.popContext();
    return md;
}
 
开发者ID:apache,项目名称:ant-easyant-core,代码行数:18,代码来源:DefaultPluginService.java

示例2: withIvy

import org.apache.ivy.core.IvyContext; //导入方法依赖的package包/类
public <T> T withIvy(Transformer<? extends T, ? super Ivy> action) {
    Integer currentDepth = depth.get();

    if (currentDepth != null) {
        depth.set(currentDepth + 1);
        try {
            return action.transform(IvyContext.getContext().getIvy());
        } finally {
            depth.set(currentDepth);
        }
    }

    IvyContext.pushNewContext();
    try {
        depth.set(1);
        try {
            Ivy ivy = getIvy();
            try {
                IvyContext.getContext().setIvy(ivy);
                return action.transform(ivy);
            } finally {
                releaseIvy(ivy);
            }
        } finally {
            depth.set(null);
        }
    } finally {
        IvyContext.popContext();
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:31,代码来源:DefaultIvyContextManager.java

示例3: finalizeTask

import org.apache.ivy.core.IvyContext; //导入方法依赖的package包/类
/**
 * Called when task is about to finish Should clean up all state related information (stacks for
 * example)
 */
protected void finalizeTask() {
    if (!IvyContext.getContext().pop(ANT_PROJECT_CONTEXT_KEY, getProject())) {
        Message.error("ANT project popped from stack not equals current! Ignoring");
    }
    IvyContext.popContext();
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:11,代码来源:IvyTask.java

示例4: tearDown

import org.apache.ivy.core.IvyContext; //导入方法依赖的package包/类
@After
public void tearDown() {
    IvyContext.popContext();
    Delete del = new Delete();
    del.setProject(new Project());
    del.setDir(cacheManager.getRepositoryCacheRoot());
    del.execute();
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:9,代码来源:DefaultRepositoryCacheManagerTest.java

示例5: getPluginInfo

import org.apache.ivy.core.IvyContext; //导入方法依赖的package包/类
public EasyAntReport getPluginInfo(File pluginIvyFile, File sourceDirectory, String conf) throws Exception {
    IvyContext.pushNewContext().setIvy(ivyInstance);
    EasyAntReport eaReport = null;
    try {

        ResolveOptions resolveOptions = buildResolveOptions(conf);
        ResolveReport report = IvyContext.getContext().getIvy().getResolveEngine()
                .resolve(pluginIvyFile.toURI().toURL(), resolveOptions);
        eaReport = new EasyAntReport();
        eaReport.setResolveReport(report);
        eaReport.setModuleDescriptor(report.getModuleDescriptor());

        Project project = buildProject();

        // expose resolve report for import deferred
        project.addReference(EasyAntMagicNames.IMPORTED_MODULES_RESOLVE_REPORT_REF, report);

        // emulate top level project
        ImportTestModule importTestModule = new ImportTestModule();
        importTestModule.setModuleIvy(pluginIvyFile);
        importTestModule.setSourceDirectory(sourceDirectory);
        importTestModule.setOwningTarget(ProjectUtils.createTopLevelTarget());
        importTestModule.setLocation(new Location(ProjectUtils.emulateMainScript(project).getAbsolutePath()));
        importTestModule.setProject(project);
        importTestModule.execute();

        analyseProject(project, eaReport, conf);
    } catch (Exception e) {
        throw new Exception("An error occured while fetching plugin informations : " + e.getMessage(), e);
    } finally {
        IvyContext.popContext();
    }
    return eaReport;

}
 
开发者ID:apache,项目名称:ant-easyant-core,代码行数:36,代码来源:DefaultPluginService.java

示例6: tearDown

import org.apache.ivy.core.IvyContext; //导入方法依赖的package包/类
@After
public void tearDown() {
    IvyContext.popContext();
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:5,代码来源:LatestVersionMatcherTest.java

示例7: tearDown

import org.apache.ivy.core.IvyContext; //导入方法依赖的package包/类
@After
public void tearDown() {
    resetMockLogger(loggerEngine);
    // pop the context we setup before
    IvyContext.popContext();
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:7,代码来源:WarnCircularDependencyStrategyTest.java

示例8: popContext

import org.apache.ivy.core.IvyContext; //导入方法依赖的package包/类
/**
 * Pops the current Ivy context.
 * <p>
 * You must call this method once and only once for each call to {@link #pushContext()}, when
 * you're done with the your Ivy related work.
 * </p>
 * <p>
 * Alternatively, you can use the {@link #execute(org.apache.ivy.Ivy.IvyCallback)} method which
 * takes care of everything for you.
 * </p>
 */
public void popContext() {
    IvyContext.popContext();
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:15,代码来源:Ivy.java


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