-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* replaced deprecated operators * now compiles only to sbt 1.0.0 * fixed binaryDeps * moved proguardOptions and proguardMerge into autoimport and added scripted plugin * fixed bintrayReleaseOnPublish = false * sbt 0.13.16 and 1.0.0 cross compilation * bintrayReleaseOnPublish fix * revert last commit * fixed scala-sbt-1.0 package directory structure * fixed configuration doesn't exist error and stack overflow * added akka test back * testing * all tests pass * change version back to 0.2.4-SNAPSHOT * make travis use jdk8 for scala 2.12 * make travis use jdk8 for scala 2.12 * applied the requested changes and fixed readme
- Loading branch information
Showing
23 changed files
with
329 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
project/project/ | ||
target/ | ||
.idea/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
language: scala | ||
|
||
jdk: oraclejdk8 | ||
|
||
script: sbt "^ publish-local" "^ scripted" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=0.13.9 | ||
sbt.version=0.13.16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0") | ||
addSbtPlugin("net.virtual-void" % "sbt-cross-building" % "0.8.1") | ||
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.1") | ||
|
||
libraryDependencies += "org.scala-sbt" % "scripted-plugin" % sbtVersion.value |
28 changes: 28 additions & 0 deletions
28
src/main/scala-sbt-0.13/com/typesafe/sbt/proguard/Sbt10Compat.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.typesafe.sbt.proguard | ||
|
||
import sbt.Keys.compile | ||
import sbt.{File, _} | ||
|
||
object Sbt10Compat { | ||
|
||
implicit class RichSbtFile(file: File) { | ||
def allPaths: PathFinder = file.*** | ||
} | ||
|
||
implicit def toProcessLogger(logger: Logger): scala.sys.process.ProcessLogger = | ||
new scala.sys.process.ProcessLogger { | ||
override def out(s: => String): Unit = (logger: sbt.ProcessLogger).info(s) | ||
override def err(s: => String): Unit = (logger: sbt.ProcessLogger).error(s) | ||
override def buffer[T](f: => T): T = (logger: sbt.ProcessLogger).buffer(f) | ||
} | ||
|
||
val getAllBinaryDeps: Def.Initialize[Task[Seq[java.io.File]]] = Def.task { | ||
(compile in Compile).value.relations.allBinaryDeps.toSeq | ||
} | ||
|
||
val ClasspathUtilities = sbt.classpath.ClasspathUtilities | ||
|
||
object DummyPath | ||
|
||
val SbtIoPath = DummyPath | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/scala-sbt-1.0/com/typesafe/sbt/proguard/Sbt10Compat.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.typesafe.sbt.proguard | ||
|
||
import sbt.{Def, Task, _} | ||
import sbt.internal.inc.Analysis | ||
import sbt.Keys.compile | ||
|
||
object Sbt10Compat { | ||
val getAllBinaryDeps: Def.Initialize[Task[Seq[java.io.File]]] = Def.task { | ||
((compile in Compile).value match { | ||
case analysis: Analysis => | ||
analysis.relations.allLibraryDeps.toSeq | ||
}) | ||
} | ||
|
||
val ClasspathUtilities = sbt.internal.inc.classpath.ClasspathUtilities | ||
|
||
val SbtIoPath = sbt.io.Path | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
package com.typesafe.sbt | ||
|
||
import com.typesafe.sbt.SbtProguard.autoImport.ProguardOptions.Filtered | ||
import com.typesafe.sbt.proguard.Merge | ||
import com.typesafe.sbt.proguard.Merge.Strategy | ||
import sbt.{File, SettingKey, _} | ||
|
||
trait ProguardKeys { | ||
val proguardVersion = settingKey[String]("proguard version") | ||
val proguardDirectory = settingKey[File]("proguard directory") | ||
val proguardConfiguration = settingKey[File]("proguard configuration") | ||
val proguardBinaryDeps = taskKey[Seq[File]]("proguard binary dependencies") | ||
val proguardInputs = taskKey[Seq[File]]("proguard inputs") | ||
val proguardLibraries = taskKey[Seq[File]]("proguard libraries") | ||
val proguardOutputs = taskKey[Seq[File]]("proguard outputs") | ||
val proguardDefaultInputFilter = taskKey[Option[String]]("proguard default input filter") | ||
val proguardInputFilter = taskKey[File => Option[String]]("proguard input filter") | ||
val proguardLibraryFilter = taskKey[File => Option[String]]("proguard library filter") | ||
val proguardOutputFilter = taskKey[File => Option[String]]("proguard output filter") | ||
val proguardFilteredInputs = taskKey[Seq[Filtered]]("proguard filtered inputs") | ||
val proguardFilteredLibraries = taskKey[Seq[Filtered]]("proguard filtered libraries") | ||
val proguardFilteredOutputs = taskKey[Seq[Filtered]]("proguard filtered outputs") | ||
val proguardMerge = taskKey[Boolean]("proguard merge") | ||
val proguardMergeDirectory = settingKey[File]("proguard merge directory") | ||
val proguardMergeStrategies = taskKey[Seq[Strategy]]("proguard merge strategies") | ||
val proguardMergedInputs = taskKey[Seq[Filtered]]("proguard merged inputs") | ||
val proguardOptions = taskKey[Seq[String]]("proguard options") | ||
val proguard = taskKey[Seq[File]]("proguard") | ||
|
||
object ProguardOptions { | ||
|
||
case class Filtered(file: File, filter: Option[String]) | ||
|
||
def noFilter(jar: File): Seq[Filtered] = Seq(Filtered(jar, None)) | ||
|
||
def noFilter(jars: Seq[File]): Seq[Filtered] = filtered(jars, None) | ||
|
||
def filtered(jars: Seq[File], filter: File => Option[String]): Seq[Filtered] = { | ||
jars map { jar => Filtered(jar, filter(jar)) } | ||
} | ||
|
||
def filtered(jars: Seq[File], filter: Option[String]): Seq[Filtered] = { | ||
jars map { jar => Filtered(jar, filter) } | ||
} | ||
|
||
def filterString(filter: Option[String]): String = { | ||
filter map { | ||
"(" + _ + ")" | ||
} getOrElse "" | ||
} | ||
|
||
def jarOptions(option: String, jars: Seq[Filtered]): Seq[String] = { | ||
jars map { jar => "%s \"%s\"%s" format(option, jar.file.getCanonicalPath, filterString(jar.filter)) } | ||
} | ||
|
||
def keepMain(name: String): String = { | ||
"""-keep public class %s { | ||
| public static void main(java.lang.String[]); | ||
|}""".stripMargin.format(name) | ||
} | ||
} | ||
|
||
object ProguardMerge { | ||
|
||
import Merge.Strategy.{matchingRegex, matchingString} | ||
|
||
import scala.util.matching.Regex | ||
|
||
def defaultStrategies = Seq( | ||
discard("META-INF/MANIFEST.MF") | ||
) | ||
|
||
def discard(exactly: String) = matchingString(exactly, Merge.discard) | ||
def first(exactly: String) = matchingString(exactly, Merge.first) | ||
def last(exactly: String) = matchingString(exactly, Merge.last) | ||
def rename(exactly: String) = matchingString(exactly, Merge.rename) | ||
def append(exactly: String) = matchingString(exactly, Merge.append) | ||
|
||
def discard(pattern: Regex) = matchingRegex(pattern, Merge.discard) | ||
def first(pattern: Regex) = matchingRegex(pattern, Merge.first) | ||
def last(pattern: Regex) = matchingRegex(pattern, Merge.last) | ||
def rename(pattern: Regex) = matchingRegex(pattern, Merge.rename) | ||
def append(pattern: Regex) = matchingRegex(pattern, Merge.append) | ||
} | ||
|
||
} |
Oops, something went wrong.