Trying to get proguard to work with Java7. It compiles and produces jar, but has removed too many files. webid
authorHenry Story <henry.story@bblfish.net>
Sat, 24 Dec 2011 17:54:05 +0100
branchwebid
changeset 164 b920b4d63786
parent 163 ed559ff1977b
child 165 27ebd9d380b0
child 166 fc3c5c54f72b
Trying to get proguard to work with Java7. It compiles and produces jar, but has removed too many files.
bin/runProguarded.sh
project/build.scala
project/plugins/build.sbt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/runProguarded.sh	Sat Dec 24 17:54:05 2011 +0100
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+#run the proguard compiled version of readwriteweb.
+
+java -Dnetty.ssl.keyStoreType=JKS -Dsun.security.ssl.allowUnsafeRenegotiation=true -Dsun.security.ssl.allowLegacyHelloMessages=true -Dnetty.ssl.keyStore=`pwd`/src/test/resources/KEYSTORE.jks -Dnetty.ssl.keyStorePassword=secret  -Xms64M -Xmx700M -XX:+CMSClassUnloadingEnabled -classpath  readwriteweb.jar org.w3.readwriteweb.netty.ReadWriteWebNetty --https 8443 test_www /2011/09
--- a/project/build.scala	Fri Dec 23 18:24:10 2011 +0100
+++ b/project/build.scala	Sat Dec 24 17:54:05 2011 +0100
@@ -78,14 +78,25 @@
   val proguardSettings:Seq[Setting[_]] =
     ProguardPlugin.proguardSettings ++ Seq[Setting[_]](
       minJarPath := new File("readwriteweb.jar"),
-      proguardOptions += keepMain("org.w3.readwriteweb.ReadWriteWebMain"),
+      proguardOptions += keepMain("org.w3.readwriteweb.netty.ReadWriteWebNetty"),
       proguardOptions += keepUnder("org.w3.readwriteweb"),
+      proguardOptions += keepUnder("org.apache.xerces"),
       proguardOptions += keepUnder("unfiltered"),
       proguardOptions += keepUnder("org.apache.log4j"),
       proguardOptions += keepUnder("com.hp.hpl.jena"),
-      proguardOptions += "-keep class com.hp.hpl.jena.rdf.model.impl.ModelCom"
+      proguardOptions += "-keep class com.hp.hpl.jena.rdf.model.impl.ModelCom",
+      makeInJarFilter <<= (makeInJarFilter) {
+        (makeInJarFilter) => {
+          (file) => file match {
+            case "slf4j-simple-1.6.4.jar" => makeInJarFilter(file) + ",!org/slf4j/**"
+            case _ => makeInJarFilter(file)
+          }
+        }
+      }
     )
 
+
+
   val projectSettings =
     Seq(
       resolvers += mavenLocal,
--- a/project/plugins/build.sbt	Fri Dec 23 18:24:10 2011 +0100
+++ b/project/plugins/build.sbt	Sat Dec 24 17:54:05 2011 +0100
@@ -6,7 +6,7 @@
 
 resolvers += "Proguard plugin repo" at "http://siasia.github.com/maven2"
 
-addSbtPlugin("com.github.siasia" % "xsbt-proguard-plugin" % "0.1")
+addSbtPlugin("com.github.siasia" % "xsbt-proguard-plugin" % "0.1-SNAPSHOT")
 
 resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"