com.threerings.presents.tools
Class GeneratedSourceMerger

java.lang.Object
  extended by 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.


Constructor Summary
GeneratedSourceMerger()
           
 
Method Summary
 String merge(String newlyGenerated, String previouslyGenerated)
          Returns previouslyGenerated with marked sections updated from the same marked sections in newlyGenerated.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneratedSourceMerger

public GeneratedSourceMerger()
Method Detail

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


Copyright © 2011. All Rights Reserved.