<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>src/LbdslCommand.java</filename>
    </added>
    <added>
      <filename>src/RunCommand.groovy</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -11,6 +11,17 @@ For more information or to hire the developer, contact Robert Fischer at robert
 The file &quot;lbdsl&quot; is the driver for this project.  Its jobs is to basically make sure your environment is set up right, and then to execute the appropate command.  
 
 +----------+
+| ENV VARS |
++----------+
+
+	* LBDSL_HOME: The home directory where the JAR will be assumed to live (by default) and the root of the properties files structure (see &quot;CUSTOMIZATION&quot;).  The directory will be created if it does not already exist.  Defaults to &quot;~/.lbdsl&quot;.
+	* LBDSL_JAR: The location of the Liquibase-DSL jar file.  Defaults to $LBDSL_HOME/lbdsl.jar
+	* LBDSL_CLASSPATH: The classpath to use when executing Liquibase-DSL.  The Liquibase-DSL jar file need not be specified in this classpath.
+	* JAVA_CMD: The command to use for Java.  Defaults to &quot;java&quot;.
+	* JAVA_OPTS: The options to specify to the Java command.  Defaults to &quot;-Xmx1024m -Xms256m&quot;.
+	* CLASSPATH: If set, appended after LBDSL_CLASSPATH to for the application classpath.
+
++----------+
 | COMMANDS |
 +----------+
 
@@ -19,7 +30,13 @@ The file &quot;lbdsl&quot; is the driver for this project.  Its jobs is to basically make
 +---------------+
 | CUSTOMIZATION |
 +---------------+
-One of the things &quot;lbdsl&quot; does is create a directory specified by the LBDSL_HOME environment variable, defaulting to ~/.lbdsl if the environment variable isn't set.  That directory is where it will expect to specify lbdsl.jar, unless you specify its location with the LBDSL_JAR environment variable.  That directory is also where configuration properties can be dropped.  Any file in that directory (or in a subdirectory of that directory) which ends in &quot;.groovy&quot; will be eval'ed and it will expect to get a map back.  Any file in that directory (or in a subdirectory of that directory) that ends in &quot;.properties&quot; will be expected to be a &quot;properties&quot; file, as defined by java.util.Properties#load(InputStream).  Any file in that directory (or in a subdirectory of that directory) that ends in &quot;.xml&quot; will be expected to be a properties XML file, as defined by java.util.Properties#loadFromXML(InputStream).  All of those properties, taken together, constitute the properties for lbdsl.
+One of the things &quot;lbdsl&quot; does is create a directory specified by the LBDSL_HOME environment variable: that directory is where configuration properties can be dropped.  Any file in that directory (or in a subdirectory of that directory) which ends in &quot;.groovy&quot; will be eval'ed and it will expect to get a map back.  Any file in that directory (or in a subdirectory of that directory) that ends in &quot;.properties&quot; will be expected to be a &quot;properties&quot; file, as defined by java.util.Properties#load(InputStream).  Any file in that directory (or in a subdirectory of that directory) that ends in &quot;.xml&quot; will be expected to be a properties XML file, as defined by java.util.Properties#loadFromXML(InputStream).  All of those properties, taken together, constitute the properties for lbdsl, which provide extension points, so you can write your own command, provide custom changesets, and the like.
+
++------------+
+| PROPERTIES |
++------------+
+
+	* lbdsl.packages.cmd: Packages to search when looking up commands and changesets, in order of priority.  The package &quot;liquibase.dsl.command&quot; will always be searched first.
 
 +------------------+
 | EXTENSION POINTS |</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -24,16 +24,18 @@ use File::Spec::Functions;
 
 use constant DEBUG =&gt; 0;
 
-sub java_run($;$) {
+sub java_run($$) {
 	my $cmd = ((shift @_) or die &quot;No class to execute provided&quot;);
 	my $args = ((shift @_) or &quot;&quot;);
+	my $exec = ((shift @_) or undef);
 	my $java = $ENV{'JAVA_CMD'} or die &quot;No java command provided&quot;;
 	my $home = $ENV{'LBDSL_HOME'} or die &quot;No LBDSL_HOME provided&quot;;
 	my $jar = $ENV{'LBDSL_JAR'} or die &quot;No LBDSL_JAR provided&quot;;
 	my $opts = ($ENV{'JAVA_OPTS'} or &quot;&quot;);
   my $doMe = &quot;$java $opts -Dlbdsl.home=$home -classpath $jar $cmd $args 2&gt;&amp;1&quot;;
 	print &quot;Executing: $doMe\n&quot; if DEBUG;
-  return `$doMe`;
+	exec($doMe);
+	die &quot;Failed to exec java: $!&quot;;
 }
 
 # Check to make sure we have a command
@@ -46,11 +48,14 @@ my $args = @ARGV ? (join &quot; &quot;, @ARGV) : &quot;&quot;;
 
 
 # Figure out our environment
-$ENV{'LBDSL_HOME'} = catdir($ENV{'HOME'}, '.lbdsl') unless $ENV{'LBDSL_HOME'};
+$ENV{'LBDSL_HOME'} = catdir($ENV{'HOME'}, '.lbdsl') unless $ENV{'LBDSL_HOME'} or !$ENV{'HOME'};
+$ENV{'LBDSL_HOME'} = catdir('.', '.lbdsl') unless $ENV{'LBDSL_HOME'};
 (mkdir $ENV{'LBDSL_HOME'} or die &quot;Cannot create lbdsl home at $ENV{'LBDSL_HOME'}: $!&quot;) unless -e $ENV{'LBDSL_HOME'};
 
 $ENV{'LBDSL_JAR'} = catfile($ENV{'LBDSL_HOME'}, 'lbdsl.jar') unless $ENV{'LBDSL_JAR'};
 die &quot;Cannot find the lbdsl jar: please ensure lbdsl.jar is at $ENV{'LBDSL_JAR'}\n&quot; unless -e $ENV{'LBDSL_JAR'};
+$ENV{'LBDSL_JAR'} = join(&quot;:&quot;, $ENV{'LBDSL_JAR'}, $ENV{'LBDSL_CLASSPATH'}) if($ENV{'LBDSL_CLASSPATH'});  # Append our classpath to LBDSL_JAR
+$ENV{'LBDSL_JAR'} = join(&quot;:&quot;, $ENV{'LBDSL_JAR'}, $ENV{'CLASSPATH'}) if($ENV{'CLASSPATH'});  						# Append global classpath to LBDSL_JAR
 
 $ENV{'JAVA_CMD'} = 'java' unless $ENV{'JAVA_CMD'} or !defined(`java -version 2&gt;&amp;1`);
 $ENV{'JAVA_CMD'} = `which java` unless $ENV{'JAVA_CMD'};
@@ -58,15 +63,5 @@ die &quot;Environment variable 'JAVA_CMD' is not set and cannot find 'java' on path:
 
 $ENV{'JAVA_OPTS'} = &quot;-Xmx1024m -Xms256m&quot; unless $ENV{'JAVA_OPTS'};
 
-# Retrieve and process the properties
-my $prop_str = java_run('liquibase.dsl.properties.PrintPerlProperties');
-print &quot;Properties: $prop_str\n&quot; if DEBUG;
-my %props =  eval($prop_str);
-
-$ENV{'LBDSL_JAR'} = join(&quot;:&quot;, $ENV{'LBDSL_JAR'}, $props{'lbdsl.classpath'}) if($props{'lbdsl.classpath'});  # Append classpath to LBDSL_JAR
-
 # Now execute the desired command
-my $runMe = java_run('liquibase.dsl.command.finder.FindCommand', $cmd);
-die &quot;Could not find command '$cmd'&quot; unless $runMe;
-exec(&quot;$ENV{'JAVA_CMD'} -Dlbdsl.home=$ENV{'LBDSL_HOME'} -classpath $ENV{'LBDSL_JAR'} $runMe $args&quot;);
-die &quot;Failed to exec java: $!&quot;;
+java_run('liquibase.dsl.command.exec.RunCommand', join(&quot; &quot;, $cmd, $args));</diff>
      <filename>lbdsl</filename>
    </modified>
    <modified>
      <diff>@@ -17,7 +17,7 @@ for jarfile in $( ls ../lib/*.jar ); do
 done
 
 echo &quot;Compiling Groovy source&quot;
-groovyc -classpath . ../../src/*.groovy
+groovyc -j --classpath . ../../src/*.java ../../src/*.groovy 
 
 echo &quot;Cleaning up META-INF and adding license information&quot;
 rm -f ./META-INF/MANIFEST.MF ./META-INF/LICENSE.txt ./META-INF/NOTICE.txt</diff>
      <filename>maker</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,7 @@ import liquibase.dsl.properties.*;
 
 class FindCommand {
 
+	/*
 	static void main(final String[] args) {
 		if(args.length &lt; 1) {
 			throw new IllegalArgumentException(&quot;USAGE: FindCommand command-name&quot;)
@@ -30,25 +31,26 @@ class FindCommand {
 		//cmd[0] = cmd[0].toUpperCase()
 		//cmd = cmd.toString()
 
-		def className = new FindCommand().find(cmd) { LbdslProperties.getProperties() }
-		if(className) {
-			println className;
+		Class runClass = new FindCommand().find(cmd) { LbdslProperties.getProperties() }
+		if(runClass) {
+			println runClass.toString();
 			System.exit(0);
 		} else {
 			System.exit(-1);
 		}
 	}
+	*/
 
-	String find(String cmd, def propFetcher) {
+	Class find(String cmd, def propFetcher) {
 
-		String out = findClass(&quot;liquibase.dsl.command&quot;, cmd)
+		Class out = findClass(&quot;liquibase.dsl.command&quot;, cmd)
 		if(out) {
 			return out;
 		}
 		
 		def props = propFetcher();	
-		if(props.get(&quot;lbdsl.packages&quot;)) {
-			def pkgs = props.get(&quot;lbdsl.packages&quot;).split(&quot;,&quot;)
+		if(props.get(&quot;lbdsl.packages.cmd&quot;)) {
+			def pkgs = props.get(&quot;lbdsl.packages.cmd&quot;).split(&quot;,&quot;)
 			while(pkgs) {
 				def tryPkg = pkgs.remove(0)
 				out = findClass(tryPkg, cmd)
@@ -61,9 +63,9 @@ class FindCommand {
 		return null
 	}
 
-	private String findClass(String pkg, String cmd) {
+	private Class findClass(String pkg, String cmd) {
 		try {
-			return Class.forName(pkg + &quot;.&quot; + cmd).getName()
+			return Class.forName(pkg + &quot;.&quot; + cmd)
 		} catch(ClassNotFoundException cnfe) {
 			return null
 		}</diff>
      <filename>src/FindCommand.groovy</filename>
    </modified>
    <modified>
      <diff>@@ -16,9 +16,11 @@ package liquibase.dsl.command
 //    along with Liquibase-DSL.  If not, see &lt;http://www.gnu.org/licenses/&gt;.
 //
 
-class HelloWorldCommand {
+import liquibase.dsl.command.api.LbdslCommand;
 
-	static void main(final String[] args) {
+class HelloWorldCommand implements LbdslCommand  {
+
+	void exec(final List&lt;String&gt; args) {
 		println &quot;Hello, world!&quot;
 	}
 </diff>
      <filename>src/HelloWorldCommand.groovy</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>90dc94d8fc3042e6a76488e52da677dc27658534</id>
    </parent>
  </parents>
  <author>
    <name>Robert Fischer</name>
    <email>robert.fischer@smokejumperit.com</email>
  </author>
  <url>http://github.com/RobertFischer/liquibase-dsl/commit/6a2b470032ec8788381cbb66b7d977cd3d835e7b</url>
  <id>6a2b470032ec8788381cbb66b7d977cd3d835e7b</id>
  <committed-date>2008-08-16T07:54:26-07:00</committed-date>
  <authored-date>2008-08-16T07:54:26-07:00</authored-date>
  <message>Updated the README to be more useful, reduced the number of java calls to make lbdsl faster, and changed the command structure to be a bit more OO-friendly.</message>
  <tree>70ac35ddba12e1f83b3b19a0b66716b43acac5d7</tree>
  <committer>
    <name>Robert Fischer</name>
    <email>robert.fischer@smokejumperit.com</email>
  </committer>
</commit>
