From 3ed25c9bce6e26a1e78a525db77c9fe4a61ae2ac Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Thu, 26 Sep 2002 02:05:59 +0000 Subject: [PATCH] Sort the damned component map prior to writing it out so that additions are easy to see in a CVS diff. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1755 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../cast/bundle/tools/ComponentBundlerTask.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/cast/bundle/tools/ComponentBundlerTask.java b/src/java/com/threerings/cast/bundle/tools/ComponentBundlerTask.java index a64a1a60a..f7f9b6241 100644 --- a/src/java/com/threerings/cast/bundle/tools/ComponentBundlerTask.java +++ b/src/java/com/threerings/cast/bundle/tools/ComponentBundlerTask.java @@ -1,5 +1,5 @@ // -// $Id: ComponentBundlerTask.java,v 1.14 2002/09/23 18:53:01 mdb Exp $ +// $Id: ComponentBundlerTask.java,v 1.15 2002/09/26 02:05:59 mdb Exp $ package com.threerings.cast.bundle.tools; @@ -30,6 +30,7 @@ import org.apache.commons.digester.Digester; import com.samskivert.io.PersistenceException; import com.samskivert.util.HashIntMap; +import com.samskivert.util.SortableArrayList; import com.samskivert.util.StringUtil; import com.samskivert.util.Tuple; @@ -433,11 +434,22 @@ public class ComponentBundlerTask extends Task bout.newLine(); // write out the keys and values + SortableArrayList lines = new SortableArrayList(); Iterator keys = keySet().iterator(); while (keys.hasNext()) { Tuple key = (Tuple)keys.next(); Integer value = (Integer)get(key); String line = key.left + SEP_STR + key.right + SEP_STR + value; + lines.add(line); + } + + // sort the output + lines.sort(); + + // now write it to the file + int lcount = lines.size(); + for (int ii = 0; ii < lcount; ii++) { + String line = (String)lines.get(ii); bout.write(line, 0, line.length()); bout.newLine(); }