added nim compilation task to sbt deploy task

switched to fake form with POST method for file download
This commit is contained in:
2017-09-28 22:11:29 +02:00
parent 7de186084d
commit ce06721e79
5 changed files with 43 additions and 22 deletions

View File

@@ -1,3 +1,5 @@
import xsbti.compile.CompileAnalysis
name := "jpacrepo"
organization := "com.oggio88"
@@ -44,6 +46,26 @@ artifactName := { (sv: ScalaVersion, module: ModuleID, artifact: Artifact) =>
//javacOptions += "-g"
val compileNim = TaskKey[File]("compileNim", "Compile nim code of web interface", KeyRanks.ATask)
compileNim := {
val result = new File("src/main/webapp/jpacrepo.js")
val cmd = s"nim js -d:release -d:serverURL= -o:${result.getPath} nim/jpacrepo.nim"
println(cmd)
sys.process.stringToProcess(cmd).! match
{
case 0 =>
case _ => throw new RuntimeException("Error occurred during deploy")
}
result
}
//compile in Compile <+= compileNim
packagedArtifact in(Compile, Keys.`package`) := {
val res = (packagedArtifact in(Compile, Keys.`package`)).value
val res2 = compileNim.value
res
}
val wildflyUsername = SettingKey[String]("wildfly-username", "The account username to use to connect to wildfly with jboss-cli.sh")
val wildflyPassword = SettingKey[String]("wildfly-password", "The account password to use to connect to wildfly with jboss-cli.sh")
val wildflyURL = SettingKey[String]("wildfly-url", "The username to use to connect to wildfly with jboss-cli.sh")
@@ -54,7 +76,6 @@ wildflyURL := "localhost:1234"
val deploy2Wildfly = TaskKey[Unit]("deploy2Wildfly", "Deploy to a wildfly server instance", KeyRanks.ATask)
deploy2Wildfly := {
val cmd = s"/opt/wildfly/bin/jboss-cli.sh " +
s"--controller='${wildflyURL.value}' " +
@@ -64,7 +85,7 @@ deploy2Wildfly := {
println(cmd)
sys.process.stringToProcess(cmd).! match
{
case 0 => "OK"
case 0 =>
case _ => throw new RuntimeException("Error occurred during deploy")
}
}