Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

Proguard is not using the build version of the scala library #3

Closed
weihsiu opened this issue Jan 16, 2010 · 6 comments
Closed

Proguard is not using the build version of the scala library #3

weihsiu opened this issue Jan 16, 2010 · 6 comments

Comments

@weihsiu
Copy link

weihsiu commented Jan 16, 2010

I am the guy who wrote the original AndroidProject. Thanks for a job well done!

I am using xsbt 0.6.10 with android-plugin and encountered an issue when building against scala-2.8.0.Beta1-RC7. Because xsbt is compiled in scala-2.7.7 but builds using scala-2.8.0, the injars parameter in the proguard task should include 2.8.0 scala-library instead of 2.7.7.

Below is the my patch:
diff --git a/src/main/scala/AndroidProject.scala b/src/main/scala/AndroidProject.scala
index 493c37c..40d587a 100644
--- a/src/main/scala/AndroidProject.scala
+++ b/src/main/scala/AndroidProject.scala
@@ -114,7 +114,7 @@ abstract class AndroidProject(info: ProjectInfo) extends DefaultProject(info) {
def proguardAction = proguardTask dependsOn(compile) describedAs("Optimize class files.")
def proguardTask = task {
val args = "-injars" :: mainCompilePath.absolutePath+File.pathSeparator+

  •                         FileUtilities.scalaLibraryJar.getAbsolutePath+"(!META-INF/MANIFEST.MF,!library.properties)"+
    
  •                         buildScalaInstance.libraryJar.getAbsolutePath+"(!META-INF/MANIFEST.MF,!library.properties)"+
                          (if (!proguardInJars.getPaths.isEmpty) File.pathSeparator+proguardInJars.getPaths.map(_+"(!META-INF/MANIFEST.MF)").mkString(File.pathSeparator) else "") ::  
            "-outjars" :: classesMinJarPath.absolutePath ::
            "-libraryjars" :: libraryJarPath.getPaths.mkString(File.pathSeparator) :: 
    
@jberkel
Copy link
Owner

jberkel commented Jan 31, 2010

I tried to apply your patch but the plugin doesn't compile anymore (using sbt 0.5.6, AndroidProject.scala:117: not found: value buildScalaInstance).

does your patch assume xsbt is used ?

@weihsiu
Copy link
Author

weihsiu commented Jan 31, 2010

unfortunately yes, buildScalaInstance is only available in xsbt.

@jberkel
Copy link
Owner

jberkel commented Jan 31, 2010

i've been meaning to try out xsbt anyway. i guess i'll apply your patch in a separate branch. xsbt will supersede sbt at some point, if i understand correctly?

@weihsiu
Copy link
Author

weihsiu commented Jan 31, 2010

yes, i think the new 0.6.12 version of xsbt is becoming the official 0.7 beta.
http://groups.google.com/group/simple-build-tool/browse_thread/thread/0cd3fd1ab6b14601

@jberkel
Copy link
Owner

jberkel commented Feb 2, 2010

nathan has added a hook for the scala library path (see latest commit). problem is that projects overriding it for use with xsbt will ony work with xsbt. another option would be to use reflection to dynamically adapt the path?

@jberkel
Copy link
Owner

jberkel commented Feb 7, 2010

version 0.4 supports sbt 0.5.6 and xsbt.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants