-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
27 lines (21 loc) · 814 Bytes
/
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
name := """play-openjpa"""
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayJava)
scalaVersion := "2.11.1"
libraryDependencies ++= Seq(
javaJdbc,
javaJpa,
"com.h2database" % "h2" % "1.4.181",
"org.apache.openjpa" % "openjpa-all" % "2.3.0"
)
lazy val enhance = taskKey[Unit]("Enhances model classes")
enhance <<= (fullClasspath in Runtime, runner, streams).map({(cp, run, s) =>
// only files from classpath are needed
val classpath = cp.files
// any options that need to be passed to the enhancer
val options = Seq()
// returns an option of errormessage
val result = run.run("org.apache.openjpa.enhance.PCEnhancer", classpath, options, s.log)
// if case of errormessage, throw an exception
result.foreach(sys.error)
}) triggeredBy(compile in Compile)