Skip to content
Browse files

implemented building and deployment infrastructure for jEdit plugin

  • Loading branch information...
1 parent 109460a commit 91fa353da1c199fcf430e461556a46e3c1f8daa8 @xeno-by xeno-by committed
Showing with 40 additions and 5 deletions.
  1. +23 −1 clients/jedit/build.sbt
  2. +12 −0 clients/jedit/local-deploy.bat
  3. +4 −3 clients/jedit/local-deploy.sh
  4. +1 −1 project/Project.scala
View
24 clients/jedit/build.sbt
@@ -1,5 +1,27 @@
+import IO._
+
name := "cccp-jedit-client"
unmanagedJars in Compile += {
- Attributed.blank(new File("/Applications/jEdit.app/Contents/Resources/Java/jedit.jar"))
+ var jedit = new File(System.getenv("JEDIT_HOME") + "/jedit.jar")
+ if (!jedit.exists) jedit = new File("/Applications/jEdit.app/Contents/Resources/Java/jedit.jar")
+ if (!jedit.exists) jedit = new File("c:/Program Files/jEdit/jedit.jar")
+ if (!jedit.exists) sys.error("jedit.jar was not found. please, set the JEDIT_HOME environment variable")
+ Attributed.blank(jedit)
+}
+
+exportJars := true
+
+stage <<= (dependencyClasspath in Runtime, exportedProducts in Runtime) map { (depCP, exportedCP) =>
+ // this task "borrowed" from ENSIME (thanks, Aemon!)
+ val jedit = Path("clients/jedit")
+ val log = LogManager.defaultScreen
+ delete(file("dist"))
+ log.info("Copying runtime environment to ./dist....")
+ createDirectories(List(
+ file("clients/jedit/dist"),
+ file("clients/jedit/dist/lib")))
+ // Copy the runtime jars
+ val deps = (depCP ++ exportedCP).map(_.data)
+ copy(deps x flat(jedit / "dist" / "lib"))
}
View
12 clients/jedit/local-deploy.bat
@@ -0,0 +1,12 @@
+@echo off
+
+if not defined JEDIT_HOME set JEDIT_HOME=c:\Program Files\jEdit
+if not exist "%JEDIT_HOME%" set JEDIT_HOME=%1
+
+if not exist "%JEDIT_HOME%" (
+ echo 'Must specify a valid destination for jEdit plugin JARs!'
+ exit -1
+)
+
+xcopy "%~dp0\dist\lib\cccp-jedit-client_2.9.1-0.1.jar" "%JEDIT_HOME%\jars\CCCP.jar" /y
+xcopy "%~dp0\dist\lib\scala-library.jar" "%JEDIT_HOME%\jars" /y
View
7 clients/jedit/local-deploy.sh
@@ -4,8 +4,9 @@ JEDIT_HOME=~/Library/jEdit
[ ! -d $JEDIT_HOME ] && JEDIT_HOME=$1
if [ ! -d $JEDIT_HOME ]; then
- echo 'Must specify a valid destination for jEdit plugin JARs!'
- exit -1
+ echo 'Must specify a valid destination for jEdit plugin JARs!'
+ exit -1
fi
-cp target/scala-2.9.1/cccp-jedit-client_2.9.1-0.1.jar $JEDIT_HOME/jars/CCCP.jar
+cp dist/lib/cccp-jedit-client_2.9.1-0.1.jar $JEDIT_HOME/jars/CCCP.jar
+cp dist/lib/scala-library.jar $JEDIT_HOME/jars/scala-library.jar
View
2 project/Project.scala
@@ -2,7 +2,7 @@ import sbt._
import Keys._
object CCCPBuild extends Build {
- lazy val root = Project(id = "cccp", base = file(".")) aggregate(server, agent)
+ lazy val root = Project(id = "cccp", base = file(".")) aggregate(server, agent, jeditClient)
lazy val server = Project(id = "cccp-server", base = file("server"))
lazy val agent = Project(id = "cccp-agent", base = file("agent")) dependsOn server
lazy val jeditClient = Project(id = "cccp-jedit-client", base = file("clients/jedit"))

0 comments on commit 91fa353

Please sign in to comment.
Something went wrong with that request. Please try again.