Last active
August 29, 2015 14:07
-
-
Save benhutchison/5e8e3a8d29eace84006f to your computer and use it in GitHub Desktop.
Script to init a new Scala JS/JVM cross-built project with an Intellij friendly layout. After running, just Open the directory in Intellij and Import. Uses https://github.com/lihaoyi/utest#jscrossbuild
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[ $# -eq 0 ] && { echo "Usage: $0 <projectName>"; exit 1; } | |
PROJECT=$1 | |
echo "Creating project in ./$PROJECT" | |
mkdir -p $PROJECT/{js,jvm,project} | |
mkdir -p $PROJECT/shared/src/{main,test}/{scala,resources} | |
cd $PROJECT | |
ln -s ../shared js/shared; ln -s ../shared jvm/shared | |
cat > project/plugin.sbt <<EOF | |
addSbtPlugin("org.scala-lang.modules.scalajs" % "scalajs-sbt-plugin" % "0.5.5") | |
addSbtPlugin("com.lihaoyi" % "utest-js-plugin" % "0.2.4") | |
EOF | |
cat > project/Build.scala <<EOF | |
import sbt._ | |
import Keys._ | |
import utest.jsrunner._ | |
object Build extends sbt.Build{ | |
lazy val cross = new JsCrossBuild( | |
name := "$PROJECT", | |
version := "0.1", | |
scalaVersion := "2.11.2" | |
) | |
lazy val root = cross.root | |
lazy val js = cross.js | |
lazy val jvm = cross.jvm | |
} | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment