本文整理汇总了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;
}
示例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();
}
}
示例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();
}
示例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();
}
示例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;
}
示例6: tearDown
import org.apache.ivy.core.IvyContext; //导入方法依赖的package包/类
@After
public void tearDown() {
IvyContext.popContext();
}
示例7: tearDown
import org.apache.ivy.core.IvyContext; //导入方法依赖的package包/类
@After
public void tearDown() {
resetMockLogger(loggerEngine);
// pop the context we setup before
IvyContext.popContext();
}
示例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();
}