diff --git a/WHATSNEW b/WHATSNEW index 1bbd39583..0ae7100eb 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -279,6 +279,10 @@ Other changes: * will now detect and successfully extract self-extracting archives. Bugzilla Report 16213. +* has a new attribute "converteol" that can be used to + control the automatic line-end conversion performed on ASCII files. + Bugzilla Report 18884. + Changes from Ant 1.5.2 to Ant 1.5.3 =================================== diff --git a/docs/manual/OptionalTasks/starteam.html b/docs/manual/OptionalTasks/starteam.html index 7b33168b3..07fac40c5 100644 --- a/docs/manual/OptionalTasks/starteam.html +++ b/docs/manual/OptionalTasks/starteam.html @@ -176,6 +176,16 @@ of checkout. no yes + + convertEOL + If true, (default) all ascii files will have their end-of-line + characters adjusted to that of the local machine on checkout. This is normally + what you'd want but if for some reason you don't want that to happen, set it to false + and the files will be checked out with whatever end-of-line characters are used on + the server. + yes + +

Examples

diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamCheckout.java b/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamCheckout.java index 74793fd29..c4ab13df3 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamCheckout.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamCheckout.java @@ -98,6 +98,14 @@ public class StarTeamCheckout extends TreeBasedTask { */ private boolean deleteUncontrolled = true; + /** + * holder for the deleteUncontrolled attribute. If true, + * (default) local non-binary files will be checked out using the local + * platform's EOL convention. If false, checkouts will preserve the + * server's EOL convention. + */ + private boolean convertEOL = true; + /** * flag (defaults to true) to create all directories * that are in the Starteam repository even if they are empty. @@ -117,6 +125,16 @@ public class StarTeamCheckout extends TreeBasedTask { this.deleteUncontrolled = value; } + /** + * Set whether or not files should be checked out using the + * local machine's EOL convention. + * Optional, defaults to true. + * @param value the value to set the attribute to. + */ + public void setConvertEOL(boolean value) { + this.convertEOL = value; + } + /** * Sets the label StarTeam is to use for checkout; defaults to the most recent file. * The label must exist in starteam or an exception will be thrown. @@ -277,7 +295,8 @@ public class StarTeamCheckout extends TreeBasedTask { log(" Items will be checked out with Exclusive locks."); } else if (this.lockStatus == Item.LockType.UNLOCKED) { - log(" Items will be checked out unlocked (even if presently locked)."); + log(" Items will be checked out unlocked " + +"(even if presently locked)."); } else { log(" Items will be checked out with no change in lock status."); @@ -291,9 +310,14 @@ public class StarTeamCheckout extends TreeBasedTask { if (this.deleteUncontrolled) { log(" Local items not found in the repository will be deleted."); } + log(" Items will be checked out " + + (this.convertEOL + ? "using the local machine's EOL convention" + : "without changing the EOL convention used on the server")); log(" Directories will be created"+ - (this.createDirs ? " wherever they exist in the repository, even if empty." - : " only where needed to check out files.")); + (this.createDirs + ? " wherever they exist in the repository, even if empty." + : " only where needed to check out files.")); } /** @@ -520,7 +544,7 @@ public class StarTeamCheckout extends TreeBasedTask { } } eachFile.checkout(this.lockStatus, - !this.useRepositoryTimeStamp, true, true); + !this.useRepositoryTimeStamp, this.convertEOL, true); } } }