-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ab0a15
commit bad85d1
Showing
27 changed files
with
298 additions
and
121 deletions.
There are no files selected for viewing
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
nix-shell bin/clang.nix -A clangEnv | ||
nix-shell bin/scala-native.nix -A clangEnv |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
let | ||
pkgs = import <nixpkgs> {}; | ||
stdenv = pkgs.stdenv; | ||
sbtOracle = pkgs.sbt.override { | ||
jre = pkgs.oraclejdk8.jre; | ||
}; | ||
in rec { | ||
clangEnv = stdenv.mkDerivation rec { | ||
name = "clang-env"; | ||
shellHook = '' | ||
alias cls=clear | ||
''; | ||
CLANG_PATH = pkgs.clang + "/bin/clang"; | ||
CLANGPP_PATH = pkgs.clang + "/bin/clang++"; | ||
buildInputs = with pkgs; [ | ||
stdenv | ||
sbtOracle | ||
boehmgc | ||
clang | ||
]; | ||
}; | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=0.13.11 | ||
sbt.version = 0.13.13 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,32 @@ | ||
resolvers += Resolver.sonatypeRepo("snapshots") | ||
|
||
unmanagedSourceDirectories in Compile ++= { | ||
val root = baseDirectory.value.getParentFile | ||
|
||
Seq( | ||
root / "util/src/main/scala", | ||
root / "nir/src/main/scala", | ||
root / "tools/src/main/scala", | ||
root / "sbtplugin/src/main/scala" | ||
) | ||
"util", | ||
"nir", | ||
"tools", | ||
"sbt-scala-native" | ||
).map(dir => root / s"$dir/src/main/scala") | ||
} | ||
|
||
libraryDependencies += "org.eclipse.jgit" % "org.eclipse.jgit.pgm" % "3.2.0.201312181205-r" | ||
|
||
libraryDependencies += "com.lihaoyi" %% "fastparse" % "0.4.2" | ||
libraryDependencies ++= Seq( | ||
"org.scala-sbt" % "scripted-plugin" % sbtVersion.value, | ||
"org.eclipse.jgit" % "org.eclipse.jgit.pgm" % "3.2.0.201312181205-r", | ||
"com.lihaoyi" %% "fastparse" % "0.4.2", | ||
"com.lihaoyi" %% "scalaparse" % "0.4.2", | ||
compilerPlugin( | ||
"org.scalamacros" % "paradise" % "2.0.1" cross CrossVersion.full) | ||
) | ||
|
||
libraryDependencies += "com.lihaoyi" %% "scalaparse" % "0.4.2" | ||
addSbtPlugin("org.scala-native" % "sbt-cross" % "0.1.0-SNAPSHOT") | ||
addSbtPlugin("com.eed3si9n" % "sbt-dirty-money" % "0.1.0") | ||
|
||
libraryDependencies += compilerPlugin( | ||
"org.scalamacros" % "paradise" % "2.0.1" cross CrossVersion.full) | ||
|
||
addSbtPlugin("com.eed3si9n" % "sbt-dirty-money" % "0.1.0") | ||
|
||
libraryDependencies <+= (sbtVersion) { sv => | ||
"org.scala-sbt" % "scripted-plugin" % sv | ||
} | ||
scalacOptions ++= Seq( | ||
"-deprecation", | ||
"-unchecked", | ||
"-feature", | ||
"-encoding", | ||
"utf8" | ||
) |
25 changes: 25 additions & 0 deletions
25
sbt-scala-native/src/main/scala/scala/scalanative/sbtplugin/NativeCross.scala
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package scala.scalanative | ||
package sbtplugin | ||
|
||
import sbt._ | ||
import sbtcross._ | ||
|
||
import scala.language.implicitConversions | ||
|
||
trait NativeCross { | ||
val NativePlatform = sbtplugin.NativePlatform | ||
|
||
implicit def NativeCrossProjectBuilderOps( | ||
builder: CrossProject.Builder): NativeCrossProjectOps = | ||
new NativeCrossProjectOps(builder.crossType(CrossType.Full)) | ||
|
||
implicit class NativeCrossProjectOps(project: CrossProject) { | ||
def native: Project = project.projects(NativePlatform) | ||
|
||
def nativeSettings(ss: Def.SettingsDefinition*): CrossProject = | ||
nativeConfigure(_.settings(ss: _*)) | ||
|
||
def nativeConfigure(transformer: Project => Project): CrossProject = | ||
project.configurePlatform(NativePlatform)(transformer) | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
sbt-scala-native/src/main/scala/scala/scalanative/sbtplugin/NativePlatform.scala
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package scala.scalanative | ||
package sbtplugin | ||
|
||
import sbt._ | ||
import sbtcross._ | ||
|
||
case object NativePlatform extends Platform { | ||
def identifier: String = "native" | ||
def sbtSuffix: String = "Native" | ||
def enable(project: Project): Project = | ||
project.enablePlugins(ScalaNativePlugin) | ||
val crossBinary: CrossVersion = ScalaNativeCrossVersion.binary | ||
val crossFull: CrossVersion = ScalaNativeCrossVersion.full | ||
} |
Oops, something went wrong.