Ok short post how to shorten package time when using Scala.
So after you've run your packaging with proguard you should have your scala files under:
target/android-classes
so what you want to do is run the following:
jar cvf shrinked-scala-1.0.jar scala
This will create a file called shrinked-scala-1.0.jar which contains all the Scala files and methods you've used in your project so far.
Next we'll add the file to our local maven repository:
mvn install:install-file -Dfile=./shrinked-scala-1.0.jar -DgroupId=com.punchwolf.scala -DartifactId=shrinked-scala -Dversion=1.0 -Dpackaging=jar
Now that we have the package in your repository we can create a new profile that uses the original Scala for compilation only but takes the shrinked version in to the package as a dependency.
<profile>
<id>hacked</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<use.lazy.unpack>true</use.lazy.unpack>
<compile.scope>compile</compile.scope>
</properties>
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.punchwolf.scala</groupId>
<artifactId>shrinked-scala</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<build>
<plugins>
</plugins>
</build>
</profile>
The above profile uses the original scala-lang as provided scope (used in compilation) and the shrinked is used in compilation scope (is packaged in the APK).
what you'll also need to do is to have a default profile that uses proguard and the scala-lang in compilation scope.
now that you have these separated, you can run the following:
mvn clean package -P hacked
Now the compilation should be done without the proguard and your new package should be executable in your phone.
The drawback is that if you use a new Scala feature that you don't have in your shrinked-scala, the program will fail saying that there's no class found. So you'll need to run the proguard profile package again and generate the shrinked-scala.jar from the proguarded scala files.
This is not very useful in the early stage of development, but it's very useful when you have pretty stable set of Scala features you use in your project or if you are debugging something.