Skip to content

Commit

Permalink
Merge pull request #12 from alexanderdean/master
Browse files Browse the repository at this point in the history
Add instructions on how to configure Proguard using Build.scala instead of build.sbt
  • Loading branch information
aolshevskiy committed Dec 11, 2011
2 parents e898d0a + bd1fdbd commit b891bb1
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions README.md
Expand Up @@ -23,15 +23,34 @@ In case if you have a xsbt version different from one used in Maven artifacts or

###Injecting the Plugin into desired project

Inject the proguard settings into your project through `build.sbt`:
####1. Using build.sbt

To inject the proguard settings into your project through `build.sbt`:

seq(ProguardPlugin.proguardSettings :_*)

Add proguard keep options in `build.sbt`. Main class keep example:

proguardOptions += keepMain("Test")

This will add a `proguard` action which will run Proguard and generate output in `target/<scala-version>/<project-name-version>.min.jar`. You may consult `min-jar-path` setting to see the actual path:
####2. In your Build.scala

Alternatively, you can configure the proguard settings within your project's `Build.scala` or equivalent:

import ProguardPlugin._
lazy val proguard = proguardSettings ++ Seq(
proguardOptions := Seq(keepMain("Test"))
)

And then include `proguard` in your `Project` definition as usual:

lazy val myProject = Project("my-project", file("."))
.settings(proguard: _*)
...

####Test

Either of these will add a `proguard` action which will run Proguard and generate output in `target/<scala-version>/<project-name-version>.min.jar`. You may consult `min-jar-path` setting to see the actual path:

> min-jar-path
[info] /home/siasia/projects/xsbt-proguard-test/target/scala-2.8.1.final/root_2.8.1-0.1.min.jar
Expand Down

0 comments on commit b891bb1

Please sign in to comment.