Skip to content

Commit

Permalink
Improving loads of ruby libs
Browse files Browse the repository at this point in the history
  • Loading branch information
banshee committed Feb 22, 2012
1 parent 063655b commit da5e926
Showing 1 changed file with 12 additions and 10 deletions.
Expand Up @@ -23,13 +23,12 @@ import org.objectweb.asm.Type
import org.osgi.framework.BundleContext import org.osgi.framework.BundleContext


import com.restphone.androidproguardscala.RichPath.toRichPath import com.restphone.androidproguardscala.RichPath.toRichPath
import com.restphone.androidproguardscala.jruby.JrubyEnvironmentSetup import com.restphone.androidproguardscala.jruby.JrubyEnvironmentSetup._
import com.restphone.androidproguardscala.jruby.ProguardCacheJava import com.restphone.androidproguardscala.jruby.ProguardCacheJava


import RichFile.slurp import RichFile.slurp
import proguard.Initializer import proguard.Initializer



class AndroidProguardScalaBuilder extends IncrementalProjectBuilder { class AndroidProguardScalaBuilder extends IncrementalProjectBuilder {
import RichPath._ import RichPath._
import RichFile._ import RichFile._
Expand Down Expand Up @@ -179,15 +178,18 @@ class AndroidProguardScalaBuilder extends IncrementalProjectBuilder {
} }


lazy val rubyCacheController = { lazy val rubyCacheController = {
JrubyEnvironmentSetup.addJrubyJarfile(pathForJarFileContainingClass(classOf[org.jruby.Ruby])) addJrubyJarfile(pathForJarFileContainingClass(classOf[org.jruby.Ruby]))


loadClassIntoJRuby(classOf[org.objectweb.asm.Type]) List(
loadClassIntoJRuby(classOf[proguard.Initializer]) classOf[org.objectweb.asm.Type],
loadClassIntoJRuby(classOf[List[String]]) classOf[proguard.Initializer],
classOf[List[String]]) foreach { loadClassIntoJRuby(_) }


val jrubyLibDir = pluginDirectory / "lib_src/main/jruby" Iterable(
logMsg("adding dir to jruby" + jrubyLibDir) pluginDirectory / "lib_src/main/jruby",
JrubyEnvironmentSetup.addToLoadPath(jrubyLibDir.toString) pluginDirectory / "jruby_lib/main/jruby") map
objToString foreach
addToLoadPath


new ProguardCacheJava new ProguardCacheJava
} }
Expand All @@ -209,7 +211,7 @@ class AndroidProguardScalaBuilder extends IncrementalProjectBuilder {
} }


def loadJarIntoJRuby(path: String) = { def loadJarIntoJRuby(path: String) = {
JrubyEnvironmentSetup.addJarToLoadPathAndRequire(path) addJarToLoadPathAndRequire(path)
} }


val bundle = Platform.getBundle("com.restphone.androidproguardscala"); val bundle = Platform.getBundle("com.restphone.androidproguardscala");
Expand Down

0 comments on commit da5e926

Please sign in to comment.