forked from spotify/scio-idea-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
46 lines (42 loc) · 1.79 KB
/
build.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
onLoad in Global := ((s: State) => { "updateIdea" :: s}) compose (onLoad in Global).value
lazy val scioIdeaPlugin: Project =
Project("scio-idea", file("."))
.enablePlugins(SbtIdeaPlugin)
.settings(
name := "scio-idea",
version := "0.1.11",
scalaVersion := "2.12.3", // aligned with IntelliJ's scala plugin
assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false),
ideaInternalPlugins := Seq(),
ideaExternalPlugins := Seq(IdeaPlugin.Zip("scala-plugin", url("https://plugins.jetbrains.com/plugin/download?updateId=41257"))),
aggregate in updateIdea := false,
assemblyExcludedJars in assembly <<= ideaFullJars,
ideaBuild := "173.3942.27",
libraryDependencies ++= Seq(
"com.google.guava" % "guava" % "19.0",
"org.scalatest" %% "scalatest" % "3.0.3" % "test"
)
)
lazy val ideaRunner: Project = project.in(file("ideaRunner"))
.dependsOn(scioIdeaPlugin % Provided)
.settings(
name := "ideaRunner",
version := "1.0",
scalaVersion := "2.12.3",
autoScalaLibrary := false,
unmanagedJars in Compile <<= ideaMainJars.in(scioIdeaPlugin),
unmanagedJars in Compile += file(System.getProperty("java.home")).getParentFile / "lib" / "tools.jar"
)
lazy val packagePlugin = TaskKey[File]("package-plugin", "Create plugin's zip file ready to load into IDEA")
packagePlugin in scioIdeaPlugin <<= (assembly in scioIdeaPlugin,
target in scioIdeaPlugin,
ivyPaths) map { (ideaJar, target, paths) =>
val pluginName = "scio-idea"
val ivyLocal = paths.ivyHome.getOrElse(file(System.getProperty("user.home")) / ".ivy2") / "local"
val sources = Seq(
ideaJar -> s"$pluginName/lib/${ideaJar.getName}"
)
val out = target / s"$pluginName-plugin.zip"
IO.zip(sources, out)
out
}