qiuwei / jing-trang

Automatically exported from code.google.com/p/jing-trang
Other
1 stars 1 forks source link

Make jing.jar runnable with scala #175

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Scala can in general run java jars with main-class attributes; you just 
substitute "java -jar" in the commandline for "scala".

But not jing. Jing.jar is weird in two ways that scala won't accept:
a) The Main-Class attribute uses slashes, when it should use periods
b) The Driver class isn't a public class, but is package-protected

I have verified that fixing both of those quirks makes jing.jar run with scala.

Trivial svn diff:

Index: mod/jing/mod.xml
===================================================================
--- mod/jing/mod.xml    (revision 2365)
+++ mod/jing/mod.xml    (working copy)
@@ -20,7 +20,7 @@
   <depends module="validate"/>
   <jar>
     <manifest>
-      <attribute name="Main-Class" 
value="com/thaiopensource/relaxng/util/Driver"/>
+      <attribute name="Main-Class" 
value="com.thaiopensource.relaxng.util.Driver"/>
       <attribute name="Class-Path"
         value="xercesImpl.jar xml-apis.jar saxon.jar saxon9.jar xalan.jar isorelax.jar resolver.jar"/>
     </manifest>
Index: mod/rng-validate/src/main/com/thaiopensource/relaxng/util/Driver.java
===================================================================
--- 
mod/rng-validate/src/main/com/thaiopensource/relaxng/util/Driver.java   (revision 
2365)
+++ 
mod/rng-validate/src/main/com/thaiopensource/relaxng/util/Driver.java   (working 
copy)
@@ -24,7 +24,7 @@
 import java.util.ArrayList;
 import java.util.List;

-class Driver {
+public class Driver {
   static private String usageKey = "usage";

   static public void setUsageKey(String key) {

Original issue reported on code.google.com by daniel.m...@crowdstrike.com on 30 Aug 2013 at 4:21