pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1363347 - in /pig/trunk: ./ ivy/ src/org/apache/pig/parser/ src/org/apache/pig/tools/grunt/ src/org/apache/pig/tools/pigscript/parser/
Date Thu, 19 Jul 2012 14:19:56 GMT
Author: gdfm
Date: Thu Jul 19 14:19:55 2012
New Revision: 1363347

URL: http://svn.apache.org/viewvc?rev=1363347&view=rev
Log:
PIG-2706: Add clear to list of grunt commands (xalan via azaroth)

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/build.xml
    pig/trunk/ivy.xml
    pig/trunk/ivy/ivysettings.xml
    pig/trunk/ivy/libraries.properties
    pig/trunk/src/org/apache/pig/parser/DryRunGruntParser.java
    pig/trunk/src/org/apache/pig/tools/grunt/GruntParser.java
    pig/trunk/src/org/apache/pig/tools/pigscript/parser/PigScriptParser.jj

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1363347&r1=1363346&r2=1363347&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Thu Jul 19 14:19:55 2012
@@ -24,6 +24,8 @@ INCOMPATIBLE CHANGES
 
 IMPROVEMENTS
 
+PIG-2706: Add clear to list of grunt commands (xalan via azaroth)
+
 PIG-2823: TestPigContext.testImportList() does not pass if another javac in on the PATH (julien)
 
 PIG-2800: pig.additional.jars path separator should align with File.pathSeparator instead
of being hard-coded to ":" (jgordon via azaroth)

Modified: pig/trunk/build.xml
URL: http://svn.apache.org/viewvc/pig/trunk/build.xml?rev=1363347&r1=1363346&r2=1363347&view=diff
==============================================================================
--- pig/trunk/build.xml (original)
+++ pig/trunk/build.xml Thu Jul 19 14:19:55 2012
@@ -688,6 +688,7 @@
                 <include name="log4j*.jar" />
                 <include name="jsp-api*.jar" />
                 <include name="zookeeper*.jar" />
+                <include name="jansi-${jansi.version}.jar" />
             </zipgroupfileset>
             <fileset file="${basedir}/src/pig-default.properties" />
             <fileset file="${basedir}/src/main/jruby/pigudf.rb" />
@@ -772,6 +773,7 @@
                 <include name="jackson-core-asl-${jackson.version}.jar" />
                 <include name="guava-${guava.version}.jar" />
                 <include name="automaton-${automaton.version}.jar" />
+                <include name="jansi-${jansi.version}.jar" />
             </zipgroupfileset>
             <fileset file="${basedir}/src/pig-default.properties" />
             <fileset file="${basedir}/src/main/jruby/pigudf.rb" />

Modified: pig/trunk/ivy.xml
URL: http://svn.apache.org/viewvc/pig/trunk/ivy.xml?rev=1363347&r1=1363346&r2=1363347&view=diff
==============================================================================
--- pig/trunk/ivy.xml (original)
+++ pig/trunk/ivy.xml Thu Jul 19 14:19:55 2012
@@ -190,9 +190,11 @@
       conf="compile->master"/>
     <dependency org="org.codehaus.jackson" name="jackson-core-asl" rev="${jackson.version}"
       conf="compile->master"/>
+    <dependency org="org.fusesource.jansi" name="jansi" rev="${jansi.version}"
+      conf="compile->master"/>
     <dependency org="joda-time" name="joda-time" rev="${joda-time.version}" conf="compile->master"/>
     <dependency org="commons-lang" name="commons-lang" rev="${commons-lang.version}"
-  	  conf="compile->master"/>
+      conf="compile->master"/>
     <dependency org="com.google.guava" name="guava" rev="${guava.version}" conf="compile->master"
/>
     <dependency org="org.python" name="jython-standalone" rev="${jython.version}" conf="compile->master"/>
     <dependency org="rhino" name="js" rev="${rhino.version}" conf="compile->master"/>

Modified: pig/trunk/ivy/ivysettings.xml
URL: http://svn.apache.org/viewvc/pig/trunk/ivy/ivysettings.xml?rev=1363347&r1=1363346&r2=1363347&view=diff
==============================================================================
--- pig/trunk/ivy/ivysettings.xml (original)
+++ pig/trunk/ivy/ivysettings.xml Thu Jul 19 14:19:55 2012
@@ -33,9 +33,9 @@
   <property name="repo.jboss.org" value="http://repository.jboss.com/nexus/content/groups/public/"
override="false"/>
   <property name="repo.apache.snapshots" value="http://repository.apache.org/content/groups/snapshots-group/"
override="false"/>
   <property name="repo.dir" value="${user.home}/.m2/repository"/>
-  <property name="maven2.pattern"  value="[organisation]/[module]/[revision]/[module]-[revision](-[classifier])"/>

+  <property name="maven2.pattern" value="[organisation]/[module]/[revision]/[module]-[revision](-[classifier])"/>
   <property name="maven2.pattern.ext" value="${maven2.pattern}.[ext]"/>
-  <property name="snapshot.pattern"  value="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"/>
+  <property name="snapshot.pattern" value="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"/>
   <property name="resolvers" value="default" override="false"/>
   <property name="force-resolve" value="false" override="false"/>
   <!-- pull in the local repository -->

Modified: pig/trunk/ivy/libraries.properties
URL: http://svn.apache.org/viewvc/pig/trunk/ivy/libraries.properties?rev=1363347&r1=1363346&r2=1363347&view=diff
==============================================================================
--- pig/trunk/ivy/libraries.properties (original)
+++ pig/trunk/ivy/libraries.properties Thu Jul 19 14:19:55 2012
@@ -75,3 +75,4 @@ guice-servlet.version=2.0
 aopalliance.version=1.0
 jsr311-api.version=1.1.1
 mockito.version=1.8.4
+jansi.version=1.9
\ No newline at end of file

Modified: pig/trunk/src/org/apache/pig/parser/DryRunGruntParser.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/parser/DryRunGruntParser.java?rev=1363347&r1=1363346&r2=1363347&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/parser/DryRunGruntParser.java (original)
+++ pig/trunk/src/org/apache/pig/parser/DryRunGruntParser.java Thu Jul 19 14:19:55 2012
@@ -367,4 +367,8 @@ public class DryRunGruntParser extends P
         sb.append(script).append("\n");
     }
 
+	@Override
+	protected void printClear() {
+	}
+
 }

Modified: pig/trunk/src/org/apache/pig/tools/grunt/GruntParser.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/tools/grunt/GruntParser.java?rev=1363347&r1=1363346&r2=1363347&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/tools/grunt/GruntParser.java (original)
+++ pig/trunk/src/org/apache/pig/tools/grunt/GruntParser.java Thu Jul 19 14:19:55 2012
@@ -75,6 +75,8 @@ import org.apache.pig.tools.pigscript.pa
 import org.apache.pig.tools.pigstats.JobStats;
 import org.apache.pig.tools.pigstats.PigStats;
 import org.apache.pig.tools.pigstats.PigStats.JobGraph;
+import org.fusesource.jansi.Ansi;
+import org.fusesource.jansi.AnsiConsole;
 
 @SuppressWarnings("deprecation")
 public class GruntParser extends PigScriptParser {
@@ -406,12 +408,21 @@ public class GruntParser extends PigScri
             log.warn("'aliases' statement is ignored while processing 'explain -script' or
'-check'");
         }
     }
-    
+
+    @Override
+	protected void printClear() {
+        AnsiConsole.systemInstall();
+        Ansi ansi = Ansi.ansi();
+        System.out.println( ansi.eraseScreen() );
+        System.out.println( ansi.cursor(0, 0) );
+        AnsiConsole.systemUninstall();
+    }
+
     @Override
     protected void processRegister(String jar) throws IOException {
         mPigServer.registerJar(jar);
     }
-    
+
     @Override
     protected void processRegister(String path, String scriptingLang, String namespace) throws
IOException, ParseException {
         if(path.endsWith(".jar")) {

Modified: pig/trunk/src/org/apache/pig/tools/pigscript/parser/PigScriptParser.jj
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/tools/pigscript/parser/PigScriptParser.jj?rev=1363347&r1=1363346&r2=1363347&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/tools/pigscript/parser/PigScriptParser.jj (original)
+++ pig/trunk/src/org/apache/pig/tools/pigscript/parser/PigScriptParser.jj Thu Jul 19 14:19:55
2012
@@ -59,31 +59,33 @@ public abstract class PigScriptParser
         mConsoleReader = c;
         token_source.consoleReader = c;
     }
-    
+
 	abstract public void prompt();
-	
+
 	abstract protected void quit();
-	
+
 	abstract protected void printAliases() throws IOException;
 
+	abstract protected void printClear();
+
 	abstract protected void processFsCommand(String[] cmdTokens) throws IOException;
 
 	abstract protected void processShCommand(String[] cmdTokens) throws IOException;
-	
+
 	abstract protected void processSQLCommand(String cmdTokens) throws IOException;
-	
+
 	abstract protected void processDescribe(String alias) throws IOException;
 
 	abstract protected void processExplain(String alias, String script, boolean isVerbose, String
format, String target, List<String> params, List<String> files) throws IOException,
ParseException;
-	
+
 	abstract protected void processRegister(String jar) throws IOException;
-	
+
 	abstract protected void processRegister(String path, String scriptingEngine, String namespace)
throws IOException, ParseException;
 
 	abstract protected void processSet(String key, String value) throws IOException, ParseException;
-		
+
     abstract protected void processHistory(boolean withNumbers);
-    		
+
 	abstract protected void processCat(String path) throws IOException;
 
 	abstract protected void processCD(String path) throws IOException;
@@ -141,6 +143,7 @@ SKIP : {
 
 // commands
 TOKEN: {<CAT: "cat">}
+TOKEN: {<CLEAR: "clear">}
 TOKEN: {<FS: "fs">}
 TOKEN: {<SH:"sh">}
 TOKEN: {<CD: "cd">}
@@ -450,9 +453,11 @@ void parse() throws IOException:
 	<CAT>
 	(
 	t1 = GetPath()
-	{processCat(t1.image);}		
+	{processCat(t1.image);}
 	)+
 	|
+	Clear()
+	|
 	<CD>
 	(
 		t1 = GetPath()
@@ -581,6 +586,14 @@ void parse() throws IOException:
 	)
 }
 
+void Clear():
+{
+}
+{
+	<CLEAR>
+	{printClear();}
+}
+
 void Illustrate() throws IOException:
 {
 	Token t;
@@ -766,6 +779,8 @@ Token GetReserved () :
 	|
 	t = <CD>
 	|
+	t = <CLEAR>
+	|
 	t = <COPY>
 	|
 	t = <COPYFROMLOCAL>



Mime
View raw message