-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpublish.sbt
89 lines (72 loc) · 2.53 KB
/
publish.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// ### SCALADOC SETTINGS ### //
scalacOptions in (Compile, doc) ++= Seq(
"-no-link-warnings",
"-sourcepath", (scalaSource in Compile).value.toString,
"-doc-source-url", s"""https://github.com/melezov/scala-uuid/blob/${version.value}-${
CrossVersion.partialVersion(scalaVersion.value).get.productIterator.mkString(".")
}.x/src/main/scala\u20AC{FILE_PATH}.scala""",
)
// ### PUBLISH SETTINGS ### //
publishTo := Some(
if (version.value endsWith "-SNAPSHOT")
Opts.resolver.sonatypeSnapshots
else
Opts.resolver.sonatypeStaging
)
licenses += (("BSD-style", url("http://opensource.org/licenses/BSD-3-Clause")))
startYear := Some(2013)
scmInfo := Some(ScmInfo(
url("https://github.com/melezov/scala-uuid"),
"scm:git:https://github.com/melezov/scala-uuid.git",
Some("scm:git:[email protected]:melezov/scala-uuid.git"),
))
pomExtra :=
<developers>
<developer>
<id>melezov</id>
<name>Marko Elezović</name>
<url>https://github.com/melezov</url>
</developer>
</developers>
publishMavenStyle := true
publishArtifact in Test := false
pomIncludeRepository := { _ => false }
homepage := Some(url("https://github.com/melezov/scala-uuid"))
/*
// ### PROGUARD SETTINGS ### //
enablePlugins(SbtProguard)
proguardVersion in Proguard := "5.3"
proguardOptions in Proguard := {
val programVer = version.value
val scalaVer = scalaVersion.value
val scalaBinVer = scalaBinaryVersion.value
val baseDir = baseDirectory.value
val binaryDeps = (proguardBinaryDeps in Proguard).value
// read lib path from binary relations, failover to default Ivy cache location
val scalaJarName = s"scala-library-${scalaVer}.jar"
val scalaJarFile = binaryDeps find(_.name == scalaJarName) getOrElse (
Path.userHome / s"/.ivy2/cache/org.scala-lang/scala-library/jars/${scalaJarName}"
)
// Try javaHome, then runtime JVM
val jreMin = (javaHome.value).getOrElse(
new File(sys.props("java.home"))
)
val runtimeCandidates = Seq("/jre/lib/rt.jar", "/lib/rt.jar") map { jreMin / }
var runtimeJar = runtimeCandidates find { _.exists } getOrElse {
sys.error("Could not locate runtime jar in path: " + jreMin)
}
val jarName = s"scala-uuid_${scalaBinVer}-${programVer}.jar"
val inJar = s"${baseDir}/target/scala-${scalaBinVer}/${jarName}"
val outJar = s"${baseDir}/target/scala-${scalaBinVer}/proguard/${jarName}"
s"""
-injars '${inJar}'
-target 1.8
-libraryjars '${runtimeJar}'
-libraryjars '${scalaJarFile}'
-outjars '${outJar}'
-dontobfuscate
-optimizationpasses 32
-keep class io.jvm.uuid.** { *; }
""".trim.split("\n")
}
*/