forked from eed3si9n/jarjar-abrams
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sbt
More file actions
133 lines (116 loc) · 4.1 KB
/
Copy pathbuild.sbt
File metadata and controls
133 lines (116 loc) · 4.1 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import Dependencies._
ThisBuild / scalaVersion := scala212
ThisBuild / organization := "com.eed3si9n.jarjarabrams"
ThisBuild / organizationName := "eed3si9n"
ThisBuild / organizationHomepage := Some(url("http://eed3si9n.com/"))
ThisBuild / version := "1.8.2-SNAPSHOT"
ThisBuild / description := "utility to shade Scala libraries"
ThisBuild / licenses := Seq(
"Apache 2" -> new URL("https://www.apache.org/licenses/LICENSE-2.0.txt")
)
ThisBuild / homepage := Some(url("https://github.com/eed3si9n/jarjar-abrams"))
lazy val jarjar = project
.in(file("jarjar"))
.disablePlugins(ScalafmtPlugin)
.configs(IntegrationTest)
.settings(Defaults.itSettings)
.settings(nocomma {
organization := "com.eed3si9n.jarjar"
name := "jarjar"
crossScalaVersions := Vector(scala212)
crossPaths := false
autoScalaLibrary := false
libraryDependencies ++= Seq(
"org.ow2.asm" % "asm" % "9.2",
"org.ow2.asm" % "asm-commons" % "9.2",
"org.apache.ant" % "ant" % "1.9.9",
"org.apache.maven" % "maven-plugin-api" % "3.3.9",
"org.apache.commons" % "commons-lang3" % "3.8.1",
"junit" % "junit" % "4.12" % "it,test",
"com.github.sbt" % "junit-interface" % "0.13.2" % "it,test"
)
mainClass := Some("com.eed3si9n.jarjar.Main")
testFrameworks += new TestFramework("com.novocode.junit.JUnitFramework")
IntegrationTest / fork := true
IntegrationTest / envVars := Map(
"JARJAR_CLASSPATH" -> (Runtime / fullClasspath)
.value
.map(_.data).mkString(System.getProperty("path.separator"))
)
assemblyMergeStrategy := {
case PathList("module-info.class") => MergeStrategy.discard
case x if x.endsWith("/module-info.class") => MergeStrategy.discard
case x =>
val oldStrategy = (ThisBuild / assemblyMergeStrategy).value
oldStrategy(x)
}
})
lazy val jarjar_assembly = project
.settings(nocomma {
organization := "com.eed3si9n.jarjar"
crossScalaVersions := Vector(scala212)
crossPaths := false
autoScalaLibrary := false
name := "JarJar Assembly"
Compile / packageBin := (jarjar / assembly).value
})
lazy val core = project
.enablePlugins(ContrabandPlugin)
.dependsOn(jarjar)
.settings(nocomma {
name := "jarjar-abrams-core"
crossScalaVersions := Vector(scala212, scala213, scala211, scala210)
libraryDependencies ++= {
if (scalaVersion.value.startsWith("2.10.")) Nil
else Vector(verify % Test)
}
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value
Compile / managedSourceDirectories += (Compile / generateContrabands / sourceManaged).value
Compile / generateContrabands / sourceManaged := baseDirectory.value / "src" / "main" / "contraband-scala"
Test / sources := {
val orig = (Test / sources).value
if (scalaVersion.value.startsWith("2.10.")) Nil
else orig
}
testFrameworks += new TestFramework("verify.runner.Framework")
Compile / scalacOptions ++= {
if (scalaVersion.value.startsWith("2.13.")) Vector("-Xlint")
else Vector("-Xlint", "-Xfatal-warnings")
}
})
lazy val sbtplugin = project
.enablePlugins(SbtPlugin)
.dependsOn(core)
.settings(nocomma {
name := "sbt-jarjar-abrams"
Compile / scalacOptions ++= Vector("-Xlint", "-Xfatal-warnings")
scriptedLaunchOpts := {
scriptedLaunchOpts.value ++
Vector("-Xmx1024M", "-Dplugin.version=" + version.value)
}
pluginCrossBuild / sbtVersion := "1.2.8"
scriptedBufferLog := false
})
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/eed3si9n/jarjar-abrams"),
"scm:git@github.com:eed3si9n/jarjar-abrams.git"
)
)
ThisBuild / developers := List(
Developer(
id = "eed3si9n",
name = "Eugene Yokota",
email = "@eed3si9n",
url = url("http://eed3si9n.com")
)
)
ThisBuild / pomIncludeRepository := { _ =>
false
}
ThisBuild / publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots")
else Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
ThisBuild / publishMavenStyle := true