How to configure sbt-proguard plugin in Build.scala

I want to use the sbt-proguard plugin in my project, but I need to configure it in the Build.scala file.

I read the documentation, but there is only an example build.sbt file that will not work in my case. I need to know how to configure the plugin for my Build.scala file.

Here's the repo link: https://github.com/sbt/sbt-proguard/blob/master/README.md#example

FYI : I use scala.version = 2.11.4 and sbt.version = 0.13.5

+6
source share
1 answer

(Note: sbt currently recommends multi-project build.sbt instead of build.scala.)

Some of the sbt plugins use a test script that installs fake builds under src/sbt-test . If you find it, it may contain good samples on how to configure the plugin.

sbt-proguard created a sample called akka , allegedly used by the Akka project.

 import sbt._ import sbt.Keys._ import com.typesafe.sbt.SbtProguard._ object SampleBuild extends Build { import ProguardKeys.{ mergeStrategies, merge, options } import ProguardOptions.keepMain import ProguardMerge.append lazy val proguardAkka = Project( id = "proguard-akka", base = file("."), settings = Defaults.defaultSettings ++ proguardSettings ++ Seq( scalaVersion := "2.10.1", libraryDependencies += "com.typesafe.akka" %% "akka-remote" % "2.1.2", merge in Proguard := true, mergeStrategies in Proguard += append("reference.conf"), options in Proguard += keepMain("A"), options in Proguard += keepMain("B"), options in Proguard += "-dontoptimize", // reduce time for proguard options in Proguard += ProguardConf.akka ) ) } object ProguardConf { val akka = .... } 
+1
source

Source: https://habr.com/ru/post/981229/


All Articles