publish task now uses srcivypattern for ivy files finding for delivery

git-svn-id: https://svn.apache.org/repos/asf/incubator/ivy/trunk@483989 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Xavier Hanin 2005-06-16 18:36:46 +00:00
parent 138a20ef06
commit 2a5a07fcb1
3 changed files with 31 additions and 13 deletions

View File

@ -1,3 +1,5 @@
- publish task now uses srcivypattern for ivy files finding for delivery
version 1.1 - 2005-06-13
===============================
- remote configuration (if available) of ivyrep and ibiblio patterns and roots

View File

@ -1117,15 +1117,17 @@ public class Ivy implements TransferListener {
*
* @param pubrevision
* @param resolverName the name of a resolver to use for publication
* @param artifactsPattern a pattern to find artifacts to publish with the given resolver
* @param srcArtifactPattern a pattern to find artifacts to publish with the given resolver
* @param srcIvyPattern a pattern to find ivy file to publish, null if ivy file should not be published
* @return a collection of missing artifacts (those that are not published)
* @throws ParseException
*/
public Collection publish(ModuleRevisionId mrid, String pubrevision, File cache, String srcArtifactPattern, String resolverName, boolean publishivy, boolean validate) throws IOException {
public Collection publish(ModuleRevisionId mrid, String pubrevision, File cache, String srcArtifactPattern, String resolverName, String srcIvyPattern, boolean validate) throws IOException {
Message.info(":: publishing :: "+mrid);
Message.verbose("\tvalidate = "+validate);
long start = System.currentTimeMillis();
srcArtifactPattern = substitute(srcArtifactPattern);
srcIvyPattern = substitute(srcIvyPattern);
// 1) find the resolved module descriptor in cache
File ivyFile = getIvyFileInCache(cache, mrid);
if (!ivyFile.exists()) {
@ -1165,9 +1167,9 @@ public class Ivy implements TransferListener {
missing.add(artifact);
}
}
if (publishivy) {
if (srcIvyPattern != null) {
Artifact artifact = new MDArtifact(md, "ivy", "ivy", "xml");
if (!publish(artifact, srcArtifactPattern, resolver)) {
if (!publish(artifact, srcIvyPattern, resolver)) {
missing.add(artifact);
}
}

View File

@ -30,7 +30,7 @@ public class IvyPublish extends IvyTask {
private String _revision;
private String _pubRevision;
private File _cache;
private String _deliverivypattern;
private String _srcivypattern;
private String _status;
private String _pubdate;
private String _deliverTarget;
@ -47,11 +47,25 @@ public class IvyPublish extends IvyTask {
public void setCache(File cache) {
_cache = cache;
}
public String getDeliverivypattern() {
return _deliverivypattern;
public String getSrcivypattern() {
return _srcivypattern;
}
public void setSrcivypattern(String destivypattern) {
_srcivypattern = destivypattern;
}
/**
* @deprecated use getSrcivypattern instead
* @return
*/
public String getDeliverivypattern() {
return _srcivypattern;
}
/**
* @deprecated use setSrcivypattern instead
* @return
*/
public void setDeliverivypattern(String destivypattern) {
_deliverivypattern = destivypattern;
_srcivypattern = destivypattern;
}
public String getModule() {
return _module;
@ -118,8 +132,8 @@ public class IvyPublish extends IvyTask {
_cache = ivy.getDefaultCache();
}
_artifactspattern = getProperty(_artifactspattern, ivy, "ivy.publish.src.artifacts.pattern");
if (_deliverivypattern == null) {
_deliverivypattern = _artifactspattern;
if (_srcivypattern == null) {
_srcivypattern = _artifactspattern;
}
_status = getProperty(_status, ivy, "ivy.status");
if (_module == null || _organisation == null || _revision == null) {
@ -144,12 +158,12 @@ public class IvyPublish extends IvyTask {
}
ModuleRevisionId mrid = ModuleRevisionId.newInstance(_organisation, _module, _revision);
try {
File ivyFile = new File(_cache, IvyPatternHelper.substitute(_deliverivypattern, _organisation, _module, _pubRevision, "ivy", "ivy", "xml"));
File ivyFile = new File(_cache, IvyPatternHelper.substitute(_srcivypattern, _organisation, _module, _pubRevision, "ivy", "ivy", "xml"));
if (_publishivy && !ivyFile.exists()) {
IvyDeliver deliver = new IvyDeliver();
deliver.setProject(getProject());
deliver.setCache(getCache());
deliver.setDeliverpattern(getDeliverivypattern());
deliver.setDeliverpattern(getSrcivypattern());
deliver.setDelivertarget(_deliverTarget);
deliver.setDeliveryList(_deliveryList);
deliver.setModule(getModule());
@ -163,7 +177,7 @@ public class IvyPublish extends IvyTask {
deliver.execute();
}
Collection missing = ivy.publish(mrid, _pubRevision, _cache, _artifactspattern, _publishResolverName, _publishivy, doValidate(ivy));
Collection missing = ivy.publish(mrid, _pubRevision, _cache, _artifactspattern, _publishResolverName, _publishivy?_srcivypattern:null, doValidate(ivy));
if (_warnonmissing) {
for (Iterator iter = missing.iterator(); iter.hasNext();) {
Artifact artifact = (Artifact)iter.next();