本文整理汇总了Java中org.apache.ivy.core.cache.ResolutionCacheManager类的典型用法代码示例。如果您正苦于以下问题:Java ResolutionCacheManager类的具体用法?Java ResolutionCacheManager怎么用?Java ResolutionCacheManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResolutionCacheManager类属于org.apache.ivy.core.cache包,在下文中一共展示了ResolutionCacheManager类的31个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: genreport
点赞 3
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
private void genreport(ResolutionCacheManager cache, String organisation, String module) {
// first process the report with xslt
XSLTProcess xslt = new XSLTProcess();
xslt.setTaskName(getTaskName());
xslt.setProject(getProject());
xslt.init();
String resolveId = ResolveOptions.getDefaultResolveId(new ModuleId(organisation, module));
xslt.setIn(cache.getConfigurationResolveReportInCache(resolveId, "default"));
xslt.setOut(new File(getTodir(), outputname + "." + xslext));
xslt.setStyle(xslFile);
XSLTProcess.Param xslExt = xslt.createParam();
xslExt.setName("extension");
xslExt.setExpression(xslext);
// add the provided XSLT parameters
for (XSLTProcess.Param param : params) {
XSLTProcess.Param realParam = xslt.createParam();
realParam.setName(param.getName());
realParam.setExpression(param.getExpression());
}
xslt.execute();
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:27,
代码来源:IvyRepositoryReport.java
示例2: getOutputPattern
点赞 3
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
private String getOutputPattern(String conf, String ext) {
if (mRevId == null) {
ResolutionCacheManager cacheMgr = getIvyInstance().getResolutionCacheManager();
XmlReportParser parser = new XmlReportParser();
File reportFile = cacheMgr.getConfigurationResolveReportInCache(resolveId, conf);
try {
parser.parse(reportFile);
} catch (ParseException e) {
throw new BuildException("Error occurred while parsing reportfile '"
+ reportFile.getAbsolutePath() + "'", e);
}
// get the resolve module
mRevId = parser.getResolvedModule();
}
return IvyPatternHelper.substitute(outputpattern, mRevId.getOrganisation(),
mRevId.getName(), mRevId.getRevision(), "", "", ext, conf,
mRevId.getQualifiedExtraAttributes(), null);
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:23,
代码来源:IvyReport.java
示例3: doExecute
点赞 3
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
public void doExecute() throws BuildException {
prepareAndCheck();
try {
ResolutionCacheManager cacheMgr = getIvyInstance().getResolutionCacheManager();
String resolveId = getResolveId();
if (resolveId == null) {
resolveId = ResolveOptions.getDefaultResolveId(getResolvedModuleId());
}
XmlReportParser parser = new XmlReportParser();
for (String conf : splitToArray(getConf())) {
File report = cacheMgr.getConfigurationResolveReportInCache(resolveId, conf);
parser.parse(report);
for (Artifact artifact : parser.getArtifacts()) {
String name = IvyPatternHelper.substitute(getSettings().substitute(getName()),
artifact, conf);
String value = IvyPatternHelper.substitute(
getSettings().substitute(getValue()), artifact, conf);
setProperty(name, value);
}
}
} catch (Exception ex) {
throw new BuildException("impossible to add artifact properties: " + ex, ex);
}
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:27,
代码来源:IvyArtifactProperty.java
示例4: checkIfChanged
点赞 3
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
/**
* Check if the set of dependencies has changed since the previous execution of a resolution.
* <p>
* This function use the report file found in the cache. So the function must be called before
* the new report is serialized there.
* </p>
* <p>
* This function also use the internal dependencies that must already be filled. This function
* might be 'heavy' because it may have to parse the previous report.
* </p>
*/
public void checkIfChanged() {
ResolutionCacheManager cache = resolveEngine.getSettings().getResolutionCacheManager();
String resolveId = options.getResolveId();
File previousReportFile = cache.getConfigurationResolveReportInCache(resolveId, conf);
if (previousReportFile.exists()) {
try {
XmlReportParser parser = new XmlReportParser();
parser.parse(previousReportFile);
Set<ModuleRevisionId> previousDepSet = new HashSet<>(
Arrays.asList(parser.getDependencyRevisionIds()));
hasChanged = !previousDepSet.equals(getModuleRevisionIds());
} catch (Exception e) {
Message.warn("Error while parsing configuration resolve report "
+ previousReportFile.getAbsolutePath(), e);
hasChanged = Boolean.TRUE;
}
} else {
hasChanged = Boolean.TRUE;
}
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:32,
代码来源:ConfigurationResolveReport.java
示例5: output
点赞 3
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
public void output(ConfigurationResolveReport report, String resolveId, String[] confs,
ResolutionCacheManager cacheMgr) throws IOException {
File reportFile = cacheMgr.getConfigurationResolveReportInCache(resolveId,
report.getConfiguration());
File reportParentDir = reportFile.getParentFile();
reportParentDir.mkdirs();
OutputStream stream = new FileOutputStream(reportFile);
writer.output(report, confs, stream);
stream.close();
Message.verbose("\treport for " + report.getModuleDescriptor().getModuleRevisionId() + " "
+ report.getConfiguration() + " produced in " + reportFile);
File reportXsl = new File(reportParentDir, "ivy-report.xsl");
File reportCss = new File(reportParentDir, "ivy-report.css");
if (!reportXsl.exists()) {
FileUtil.copy(XmlReportOutputter.class.getResourceAsStream("ivy-report.xsl"),
reportXsl, null);
}
if (!reportCss.exists()) {
FileUtil.copy(XmlReportOutputter.class.getResourceAsStream("ivy-report.css"),
reportCss, null);
}
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:25,
代码来源:XmlReportOutputter.java
示例6: getReportStylePath
点赞 3
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
private File getReportStylePath() throws IOException {
if (xslFile != null) {
return xslFile;
}
// style should be a file (and not an url)
// so we have to copy it from classpath to cache
ResolutionCacheManager cacheMgr = getEasyAntIvyInstance().getResolutionCacheManager();
String styleName = "easyant-report.xsl";
File style = new File(cacheMgr.getResolutionCacheRoot(), styleName);
if (!style.exists()) {
Message.debug("copying easyant-report.xsl to " + style.getAbsolutePath());
FileUtil.copy(XMLEasyAntReportWriter.class.getResourceAsStream(styleName), style, null);
} else {
// Check cached and jar style content
// If EasyAnt has been updated, maybe the style file is different from the one in previous version
InputStream cacheIs = new FileInputStream(style);
InputStream jarIs = XMLEasyAntReportWriter.class.getResourceAsStream(styleName);
if (!isSame(cacheIs, jarIs)) {
Message.debug("Update cache style file");
style.delete();
FileUtil.copy(XMLEasyAntReportWriter.class.getResourceAsStream(styleName), style, null);
}
}
return style;
}
开发者ID:apache,
项目名称:ant-easyant-core,
代码行数:26,
代码来源:PluginReport.java
示例7: updateCache
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
private void updateCache(ModuleDescriptor moduleDescriptor) {
final ResolutionCacheManager cacheManager = this.ivy.getSettings()
.getResolutionCacheManager();
try {
cacheManager.saveResolvedModuleDescriptor(moduleDescriptor);
final File propsFile = cacheManager.getResolvedIvyPropertiesInCache(moduleDescriptor
.getModuleRevisionId());
propsFile.delete();
} catch (final ParseException | IOException e) {
throw new RuntimeException(e);
}
}
开发者ID:jerkar,
项目名称:jerkar,
代码行数:13,
代码来源:IvyPublisher.java
示例8: deleteResolveCache
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
private void deleteResolveCache(JkVersionedModule module) {
final ResolutionCacheManager cacheManager = this.ivy.getSettings().getResolutionCacheManager();
final ModuleRevisionId moduleRevisionId = IvyTranslations.toModuleRevisionId(module);
final File propsFile = cacheManager.getResolvedIvyPropertiesInCache(moduleRevisionId);
propsFile.delete();
final File xmlFile = cacheManager.getResolvedIvyFileInCache(moduleRevisionId);
xmlFile.delete();
}
开发者ID:jerkar,
项目名称:jerkar,
代码行数:9,
代码来源:IvyResolver.java
示例9: gen
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
private void gen(ResolutionCacheManager cache, String organisation, String module,
String style, String ext) {
XSLTProcess xslt = new XSLTProcess();
xslt.setTaskName(getTaskName());
xslt.setProject(getProject());
xslt.init();
String resolveId = ResolveOptions.getDefaultResolveId(new ModuleId(organisation, module));
xslt.setIn(cache.getConfigurationResolveReportInCache(resolveId, "default"));
xslt.setOut(new File(getTodir(), outputname + "." + ext));
xslt.setBasedir(cache.getResolutionCacheRoot());
xslt.setStyle(style);
xslt.execute();
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:15,
代码来源:IvyRepositoryReport.java
示例10: genxml
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
private void genxml(String[] confs) throws IOException {
ResolutionCacheManager cacheMgr = getIvyInstance().getResolutionCacheManager();
for (String config : confs) {
File xml = cacheMgr.getConfigurationResolveReportInCache(resolveId, config);
File out;
if (todir == null) {
out = getProject().resolveFile(getOutputPattern(config, "xml"));
} else {
out = new File(todir, getOutputPattern(config, "xml"));
}
FileUtil.copy(xml, out, null);
}
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:16,
代码来源:IvyReport.java
示例11: getReportStylePath
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
private File getReportStylePath() throws IOException {
if (xslFile != null) {
return xslFile;
}
// style should be a file (and not an url)
// so we have to copy it from classpath to cache
ResolutionCacheManager cacheMgr = getIvyInstance().getResolutionCacheManager();
File style = new File(cacheMgr.getResolutionCacheRoot(), "ivy-report.xsl");
if (!style.exists()) {
Message.debug("copying ivy-report.xsl to " + style.getAbsolutePath());
FileUtil.copy(XmlReportOutputter.class.getResourceAsStream("ivy-report.xsl"), style,
null);
}
return style;
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:16,
代码来源:IvyReport.java
示例12: getStylePath
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
private File getStylePath(String styleResourceName) throws IOException {
// style should be a file (and not an url)
// so we have to copy it from classpath to cache
ResolutionCacheManager cacheMgr = getIvyInstance().getResolutionCacheManager();
File style = new File(cacheMgr.getResolutionCacheRoot(), styleResourceName);
FileUtil.copy(XmlReportOutputter.class.getResourceAsStream(styleResourceName), style, null);
return style;
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:9,
代码来源:IvyReport.java
示例13: outputCachePath
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
private static void outputCachePath(Ivy ivy, File cache, ModuleDescriptor md, String[] confs,
String outFile) {
try {
StringBuilder buf = new StringBuilder();
Collection<ArtifactDownloadReport> all = new LinkedHashSet<>();
ResolutionCacheManager cacheMgr = ivy.getResolutionCacheManager();
XmlReportParser parser = new XmlReportParser();
for (String conf : confs) {
String resolveId = ResolveOptions.getDefaultResolveId(md);
File report = cacheMgr.getConfigurationResolveReportInCache(resolveId, conf);
parser.parse(report);
all.addAll(Arrays.asList(parser.getArtifactReports()));
}
for (ArtifactDownloadReport artifact : all) {
if (artifact.getLocalFile() != null) {
buf.append(artifact.getLocalFile().getCanonicalPath());
buf.append(File.pathSeparator);
}
}
PrintWriter writer = new PrintWriter(new FileOutputStream(outFile));
if (buf.length() > 0) {
buf.setLength(buf.length() - File.pathSeparator.length());
writer.println(buf);
}
writer.close();
System.out.println("cachepath output to " + outFile);
} catch (Exception ex) {
throw new RuntimeException("impossible to build ivy cache path: " + ex.getMessage(), ex);
}
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:34,
代码来源:Main.java
示例14: outputReport
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
public void outputReport(ResolveReport report, ResolutionCacheManager cacheMgr,
ResolveOptions options) throws IOException {
if (ResolveOptions.LOG_DEFAULT.equals(options.getLog())) {
Message.info(":: resolution report :: resolve " + report.getResolveTime() + "ms"
+ " :: artifacts dl " + report.getDownloadTime() + "ms");
} else {
Message.verbose(":: resolution report :: resolve " + report.getResolveTime() + "ms"
+ " :: artifacts dl " + report.getDownloadTime() + "ms");
}
report.setProblemMessages(Message.getProblems());
// output report
report.output(settings.getReportOutputters(), cacheMgr, options);
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:14,
代码来源:ResolveEngine.java
示例15: getLocalRepoIvy
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
/**
* Build the ivy instance to be used on the local retrieved repo
*/
private Ivy getLocalRepoIvy() {
File basedir = getLocalRepoBaseDir();
if (basedir == null) {
return null;
}
IvySettings settings = new IvySettings();
settings.setBaseDir(basedir);
settings.setDefaultUseOrigin(true);
File cacheDir = new File(basedir, ".cache");
ResolutionCacheManager resolutionCacheManager = new DefaultResolutionCacheManager(cacheDir);
settings.setResolutionCacheManager(resolutionCacheManager);
RepositoryCacheManager repositoryCacheManager = new DefaultRepositoryCacheManager("default-cache", settings,
cacheDir);
settings.setDefaultRepositoryCacheManager(repositoryCacheManager);
FileSystemResolver localResolver = new FileSystemResolver();
localResolver.setName("local-repo");
localResolver.addIvyPattern(basedir.getAbsolutePath() + "/[organization]/[module]/[revision]/ivy.xml");
localResolver.addArtifactPattern(basedir.getAbsolutePath()
+ "/[organization]/[module]/[revision]/[type]s/[artifact].[ext]");
settings.addResolver(localResolver);
settings.setDefaultResolver("local-repo");
Ivy ivy = Ivy.newInstance(settings);
AntMessageLogger.register(this, ivy);
return ivy;
}
开发者ID:apache,
项目名称:ant-easyant-core,
代码行数:37,
代码来源:ImportAntscripts.java
示例16: getResolutionCacheManager
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
public ResolutionCacheManager getResolutionCacheManager() {
return settings.getResolutionCacheManager();
}
开发者ID:Pushjet,
项目名称:Pushjet-Android,
代码行数:4,
代码来源:LegacyResolverParserSettings.java
示例17: getConfsToResolve
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
private String[] getConfsToResolve(ModuleDescriptor reference, String conf, String[] rconfs) {
Message.debug("calculating configurations to resolve");
if (reference == null) {
Message.debug("module not yet resolved, all confs still need to be resolved");
if (conf == null) {
return new String[] {"*"};
}
return splitToArray(conf);
}
if (conf == null) {
Message.debug("module already resolved, no configuration to resolve");
return new String[0];
}
String[] confs;
if ("*".equals(conf)) {
confs = reference.getConfigurationsNames();
} else {
confs = splitToArray(conf);
}
Set<String> rconfsSet = new HashSet<>();
// for each resolved configuration, check if the report still exists
ResolutionCacheManager cache = getSettings().getResolutionCacheManager();
for (String resolvedConf : rconfs) {
String resolveId = getResolveId();
if (resolveId == null) {
resolveId = ResolveOptions.getDefaultResolveId(reference);
}
File report = cache.getConfigurationResolveReportInCache(resolveId, resolvedConf);
// if the report does not exist any longer, we have to recreate it...
if (report.exists()) {
rconfsSet.add(resolvedConf);
}
}
Set<String> confsSet = new HashSet<>(Arrays.asList(confs));
Message.debug("resolved configurations: " + rconfsSet);
Message.debug("asked configurations: " + confsSet);
confsSet.removeAll(rconfsSet);
Message.debug("to resolve configurations: " + confsSet);
return confsSet.toArray(new String[confsSet.size()]);
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:47,
代码来源:IvyPostResolveTask.java
示例18: doExecute
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
public void doExecute() throws BuildException {
Ivy ivy = getIvyInstance();
IvySettings settings = ivy.getSettings();
if (xsl && xslFile == null) {
throw new BuildException("xsl file is mandatory when using xsl generation");
}
if (module == null && PatternMatcher.EXACT.equals(matcher)) {
throw new BuildException("no module name provided for ivy repository graph task: "
+ "It can either be set explicitly via the attribute 'module' or "
+ "via 'ivy.module' property or a prior call to <resolve/>");
} else if (module == null && !PatternMatcher.EXACT.equals(matcher)) {
module = PatternMatcher.ANY_EXPRESSION;
}
ModuleRevisionId moduleRevisionId = ModuleRevisionId.newInstance(organisation, module, revision);
try {
ModuleRevisionId criteria = (revision == null) || settings.getVersionMatcher().isDynamic(moduleRevisionId)
? new ModuleRevisionId(new ModuleId(organisation, module), branch, "*")
: new ModuleRevisionId(new ModuleId(organisation, module), branch, revision);
ModuleRevisionId[] mrids = ivy.listModules(criteria, settings.getMatcher(matcher));
// replace all found revisions with the original requested revision
Set<ModuleRevisionId> modules = new HashSet<>();
for (ModuleRevisionId mrid : mrids) {
modules.add(ModuleRevisionId.newInstance(mrid, revision));
}
mrids = modules.toArray(new ModuleRevisionId[modules.size()]);
ModuleDescriptor md = DefaultModuleDescriptor.newCallerInstance(mrids, true, false);
String resolveId = ResolveOptions.getDefaultResolveId(md);
ResolveReport report = ivy.resolve(md, new ResolveOptions().setResolveId(resolveId)
.setValidate(doValidate(settings)));
ResolutionCacheManager cacheMgr = getIvyInstance().getResolutionCacheManager();
new XmlReportOutputter().output(report, cacheMgr, new ResolveOptions());
if (graph) {
gengraph(cacheMgr, md.getModuleRevisionId().getOrganisation(),
md.getModuleRevisionId().getName());
}
if (dot) {
gendot(cacheMgr, md.getModuleRevisionId().getOrganisation(),
md.getModuleRevisionId().getName());
}
if (xml) {
FileUtil.copy(cacheMgr.getConfigurationResolveReportInCache(resolveId, "default"),
new File(getTodir(), outputname + ".xml"), null);
}
if (xsl) {
genreport(cacheMgr, md.getModuleRevisionId().getOrganisation(),
md.getModuleRevisionId().getName());
}
} catch (Exception e) {
throw new BuildException("impossible to generate graph for " + moduleRevisionId + ": " + e, e);
}
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:57,
代码来源:IvyRepositoryReport.java
示例19: gengraph
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
private void gengraph(ResolutionCacheManager cache, String organisation, String module)
throws IOException {
gen(cache, organisation, module, getGraphStylePath(cache.getResolutionCacheRoot()),
"graphml");
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:6,
代码来源:IvyRepositoryReport.java
示例20: gendot
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
private void gendot(ResolutionCacheManager cache, String organisation, String module)
throws IOException {
gen(cache, organisation, module, getDotStylePath(cache.getResolutionCacheRoot()), "dot");
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:5,
代码来源:IvyRepositoryReport.java
示例21: getCache
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
private ResolutionCacheManager getCache() {
return settings.getResolutionCacheManager();
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:4,
代码来源:RetrieveEngine.java
示例22: output
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
public void output(ReportOutputter[] outputters, ResolutionCacheManager cacheMgr,
ResolveOptions options) throws IOException {
for (ReportOutputter outputter : outputters) {
outputter.output(this, cacheMgr, options);
}
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:7,
代码来源:ResolveReport.java
示例23: setResolutionCacheManager
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
public synchronized void setResolutionCacheManager(ResolutionCacheManager resolutionCacheManager) {
this.resolutionCacheManager = resolutionCacheManager;
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:4,
代码来源:IvySettings.java
示例24: output
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
void output(ResolveReport report, ResolutionCacheManager cacheMgr,
ResolveOptions options) throws IOException;
开发者ID:apache,
项目名称:ant-ivy,
代码行数:3,
代码来源:ReportOutputter.java
示例25: getResolutionCacheManager
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
public ResolutionCacheManager getResolutionCacheManager() {
return AbstractResolver.this.getSettings().getResolutionCacheManager();
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:4,
代码来源:AbstractResolver.java
示例26: output
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
public void output(ResolveReport report, ResolutionCacheManager cacheMgr,
ResolveOptions options) {
}
开发者ID:apache,
项目名称:ant-ivy,
代码行数:4,
代码来源:XmlSettingsParserTest.java
示例27: doExecute
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
@Override
public void doExecute() throws BuildException {
prepareAndCheck();
DefaultModuleDescriptor md = (DefaultModuleDescriptor) getResolvedReport().getModuleDescriptor();
// this is a published artifact
String artName = getSettings().substitute(getName());
artName = artName == null ? md.getModuleRevisionId().getName() : artName;
String artType = getSettings().substitute(getType());
artType = artType == null ? "jar" : artType;
String artExt = getSettings().substitute(getExt());
artExt = artExt != null ? artExt : artType;
Map<String, String> extraAttributes = new HashMap<String, String>();
if (getClassifier() != null) {
md.addExtraAttributeNamespace("m", "http://ant.apache.org/ivy/maven");
extraAttributes.put("m:classifier", getClassifier());
}
MDArtifact artifact = new MDArtifact(md, artName, artType, artExt, null, extraAttributes);
String[] configurations = getConfs().split(",");
for (String configuration : configurations) {
if ("*".equals(configuration)) {
String[] declaredConfs = md.getConfigurationsNames();
for (String declaredConf : declaredConfs) {
artifact.addConfiguration(declaredConf);
md.addArtifact(declaredConf, artifact);
}
} else {
// create configuration if it doesn't exist
if (md.getConfiguration(configuration) == null) {
Configuration generatedConfiguration = new Configuration(configuration);
md.addConfiguration(generatedConfiguration);
}
artifact.addConfiguration(configuration);
md.addArtifact(configuration, artifact);
}
}
ResolutionCacheManager cacheManager = getSettings().getResolutionCacheManager();
File ivyFileInCache = cacheManager.getResolvedIvyFileInCache(md.getResolvedModuleRevisionId());
try {
XmlModuleDescriptorWriter.write(md, ivyFileInCache);
} catch (IOException e) {
throw new BuildException("Can't register specified artifact", e);
}
}
开发者ID:apache,
项目名称:ant-easyant-core,
代码行数:47,
代码来源:RegisterArtifact.java
示例28: checkProjectDependencies
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
public boolean checkProjectDependencies() {
execute();
try {
ResolutionCacheManager cacheMgr = getIvyInstance().getResolutionCacheManager();
String[] confs = splitConfs(getConf());
String resolveId = getResolveId();
if (resolveId == null) {
resolveId = ResolveOptions.getDefaultResolveId(getResolvedModuleId());
}
XmlReportParser parser = new XmlReportParser();
for (String conf : confs) {
File report = cacheMgr.getConfigurationResolveReportInCache(resolveId, conf);
parser.parse(report);
Artifact[] artifacts = parser.getArtifacts();
for (Artifact artifact : artifacts) {
ModuleRevisionId mrid = artifact.getModuleRevisionId();
if (mrid.getOrganisation().equals(getOrganisationToFind())) {
if (mrid.getName().equals(getModuleToFind())) {
log(mrid.getOrganisation() + "#" + mrid.getName() + " found in project dependencies !",
Project.MSG_DEBUG);
// use this version
loadCachePath(getOrganisationToFind(), getModuleToFind(), mrid.getRevision(),
getConfToFind(), getSettingsReference());
return true;
} else {
// if only organization is found in project
// dependencies use the same version with the
// required module
log("Only organisation : " + mrid.getOrganisation()
+ " was found in project dependencies !", Project.MSG_DEBUG);
loadCachePath(mrid.getOrganisation(), getModuleToFind(), mrid.getRevision(),
getConfToFind(), getSettingsReference());
return true;
}
}
}
}
} catch (Exception ex) {
throw new BuildException("impossible to check project dependencies: " + ex, ex);
}
return false;
}
开发者ID:apache,
项目名称:ant-easyant-core,
代码行数:46,
代码来源:ProjectDependencyStrategy.java
示例29: ResolutionCacheCleanable
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
public ResolutionCacheCleanable(ResolutionCacheManager manager) {
this.manager = manager;
}
开发者ID:apache,
项目名称:ant-ivyde,
代码行数:4,
代码来源:CleanCacheAction.java
示例30: addResolutionCleanable
点赞 2
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
private void addResolutionCleanable(List<Cleanable> cleanables, Ivy ivy) {
ResolutionCacheManager manager = ivy.getSettings().getResolutionCacheManager();
cleanables.add(new ResolutionCacheCleanable(manager));
}
开发者ID:apache,
项目名称:ant-ivyde,
代码行数:5,
代码来源:IvyMenuContributionItem.java
示例31: getResolutionCacheManager
点赞 1
import org.apache.ivy.core.cache.ResolutionCacheManager; //导入依赖的package包/类
ResolutionCacheManager getResolutionCacheManager();
开发者ID:apache,
项目名称:ant-ivy,
代码行数:2,
代码来源:ParserSettings.java