com.threerings.presents.tools
Class GeneratedSourceMerger
java.lang.Object
com.threerings.presents.tools.GeneratedSourceMerger
public class GeneratedSourceMerger
- extends Object
Merges updates to a generated source file into a previously generated version of that source
while leaving changes outside marked sections alone.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_sectionDelimiter
protected final Pattern _sectionDelimiter
GeneratedSourceMerger
public GeneratedSourceMerger()
merge
public String merge(String newlyGenerated,
String previouslyGenerated)
throws Exception
- Returns
previouslyGenerated with marked sections updated from the same marked
sections in newlyGenerated. Everything outside these sections in
previouslyGenerated is returned as is. A marked section starts with //
GENERATED {name} START and ends with // GENERATED {name} END
If previouslyGenerated has a generated section replaced with //
GENERATED {name} DISABLED, that section will no longer be updated.
- Throws:
Exception
extractGeneratedSection
protected GeneratedSourceMerger.Section extractGeneratedSection(Matcher m,
String input)
- Returns a section name and its contents from the given matcher pointing to the start of a
section.
m is at the end of the section when this returns.