Permalink
Browse files

Merge remote-tracking branch 'xeno-by/master'

  • Loading branch information...
2 parents 2eb7d9d + 91fa353 commit 43c40fe9b7b0746242635db55391fdd20943b50b @djspiewak committed Nov 19, 2011
View
@@ -1,2 +1 @@
-REM TODO
-java -classpath <RUNTIME_CLASSPATH> com.codecommit.cccp.agent.Main
+java -classpath <RUNTIME_CLASSPATH> com.codecommit.cccp.agent.Main %*
View
@@ -41,7 +41,7 @@ stage <<= (dependencyClasspath in Runtime, exportedProducts in Runtime) map { (d
}
// Expand the server invocation script templates.
writeScript(cpLibs.mkString(":").replace("\\", "/"), "agent/bin/server", "agent/dist/bin/server")
- writeScript("\"" + cpLibs.mkString(";").replace("/", "\\") + "\"", "agent/bin/server.bat", "agent/dist/bin/server.bat")
+ writeScript("\"" + cpLibs.map{lib => "%~dp0/../" + lib}.mkString(";").replace("/", "\\") + "\"", "agent/bin/server.bat", "agent/dist/bin/server.bat")
// copyFile(root / "README.md", root / "dist" / "README.md")
// copyFile(root / "LICENSE", root / "dist" / "LICENSE")
}
View
@@ -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"))
}
@@ -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
@@ -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,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"))
@@ -1 +1 @@
-java -classpath <RUNTIME_CLASSPATH> com.codecommit.cccp.server.Main
+java -classpath <RUNTIME_CLASSPATH> com.codecommit.cccp.server.Main %*
View
@@ -41,7 +41,7 @@ stage <<= (dependencyClasspath in Runtime, exportedProducts in Runtime) map { (d
}
// Expand the server invocation script templates.
writeScript(cpLibs.mkString(":").replace("\\", "/"), "server/bin/cccp-server", "server/dist/bin/cccp-server")
- writeScript("\"" + cpLibs.mkString(";").replace("/", "\\") + "\"", "server/bin/cccp-server.bat", "server/dist/bin/cccp-server.bat")
+ writeScript("\"" + cpLibs.map{lib => "%~dp0/../" + lib}.mkString(";").replace("/", "\\") + "\"", "server/bin/cccp-server.bat", "server/dist/bin/cccp-server.bat")
// copyFile(root / "README.md", root / "dist" / "README.md")
// copyFile(root / "LICENSE", root / "dist" / "LICENSE")
}

0 comments on commit 43c40fe

Please sign in to comment.