-
Notifications
You must be signed in to change notification settings - Fork 1
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
devilune
committed
Sep 14, 2019
0 parents
commit d367189
Showing
12 changed files
with
182 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
*.DS_Store | ||
*.class | ||
*.log | ||
*~ | ||
|
||
# sbt specific | ||
dist/* | ||
target/ | ||
lib_managed/ | ||
src_managed/ | ||
project/boot/ | ||
project/plugins/project/ | ||
project/local-plugins.sbt | ||
.history | ||
.dotty-ide.json | ||
.dotty-ide-artifact | ||
_site | ||
|
||
# Scala-IDE specific | ||
.scala_dependencies | ||
.cache | ||
.classpath | ||
.project | ||
.settings | ||
classes/ | ||
|
||
# idea | ||
.idea | ||
.idea_modules | ||
/.worksheet/ |
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,58 @@ | ||
dotty-graalvm.g8 | ||
================= | ||
A [Giter8][g8] template for [Dotty] using [GraalVM]. | ||
|
||
Template usage | ||
-------------- | ||
Using `sbt` version `1.3.0`, do: | ||
``` | ||
sbt new devilune/dotty-graalvm.g8 | ||
``` | ||
in the folder where you want to clone the template. | ||
|
||
Generated project usage | ||
-------------- | ||
Compile | ||
``` | ||
sbt compile | ||
``` | ||
|
||
Run | ||
``` | ||
sbt run | ||
``` | ||
|
||
Test | ||
``` | ||
sbt test | ||
``` | ||
|
||
Building native image | ||
``` | ||
sbt graalvm-native-image:packageBin | ||
``` | ||
|
||
Note: | ||
You need to install [GraalVM] and [GraalVM Native Image]. | ||
|
||
Edit | ||
``` | ||
sbt launchIDE | ||
``` | ||
|
||
See also [IDE support for Dotty]. | ||
|
||
Template license | ||
---------------- | ||
Written in 2019 by [devilune] | ||
|
||
To the extent possible under law, the author(s) have dedicated all copyright and related | ||
and neighboring rights to this template to the public domain worldwide. | ||
This template is distributed without any warranty. See <http://creativecommons.org/publicdomain/zero/1.0/>. | ||
|
||
[g8]: http://www.foundweekends.org/giter8/ | ||
[Dotty]: http://dotty.epfl.ch/ | ||
[IDE support for Dotty]: https://dotty.epfl.ch/docs/usage/ide-support.html | ||
[GraalVM]: https://www.graalvm.org | ||
[GraalVM Native Image]: https://www.graalvm.org/docs/reference-manual/aot-compilation/ | ||
[devilune]: https://github.com/devilune |
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,13 @@ | ||
// This build is for this Giter8 template. | ||
// To test the template run `g8` or `g8Test` from the sbt session. | ||
// See http://www.foundweekends.org/giter8/testing.html#Using+the+Giter8Plugin for more details. | ||
lazy val root = project | ||
.in(file(".")) | ||
.settings( | ||
name := "dotty-graalvm-template", | ||
test in Test := { | ||
val _ = (g8Test in Test).toTask("").value | ||
}, | ||
scriptedLaunchOpts ++= List("-Xms1024m", "-Xmx1024m", "-XX:ReservedCodeCacheSize=128m", "-XX:MaxPermSize=256m", "-Xss2m", "-Dfile.encoding=UTF-8"), | ||
resolvers += Resolver.url("typesafe", url("http://repo.typesafe.com/typesafe/ivy-releases/"))(Resolver.ivyStylePatterns) | ||
) |
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 @@ | ||
sbt.version=1.3.0 |
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 @@ | ||
addSbtPlugin("org.foundweekends.giter8" %% "sbt-giter8" % "0.11.0") |
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,37 @@ | ||
# sbt project compiled with Dotty using GraalVM | ||
|
||
## Usage | ||
|
||
Compile | ||
``` | ||
sbt compile | ||
``` | ||
|
||
Run | ||
``` | ||
sbt run | ||
``` | ||
|
||
Test | ||
``` | ||
sbt test | ||
``` | ||
|
||
Building native image | ||
``` | ||
sbt graalvm-native-image:packageBin | ||
``` | ||
|
||
Note: | ||
You need to install [GraalVM] and [GraalVM Native Image]. | ||
|
||
Edit | ||
``` | ||
sbt launchIDE | ||
``` | ||
|
||
See also [IDE support for Dotty]. | ||
|
||
[GraalVM]: https://www.graalvm.org | ||
[GraalVM Native Image]: https://www.graalvm.org/docs/reference-manual/aot-compilation/ | ||
[IDE support for Dotty]: https://dotty.epfl.ch/docs/usage/ide-support.html |
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,17 @@ | ||
val dottyVersion = "0.18.1-RC1" | ||
|
||
enablePlugins(GraalVMNativeImagePlugin) | ||
graalVMNativeImageOptions ++= Seq( | ||
"--initialize-at-build-time", | ||
) | ||
|
||
lazy val root = project | ||
.in(file(".")) | ||
.settings( | ||
name := "dotty-graalvm-simple", | ||
version := "0.1.0", | ||
|
||
scalaVersion := dottyVersion, | ||
|
||
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test" | ||
) |
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,2 @@ | ||
name=Dotty GraalVM Project Template | ||
description=A template to demonstrate a minimal Dotty application using GraalVM |
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 @@ | ||
sbt.version=1.3.0 |
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,2 @@ | ||
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.3.4") | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.4.1") |
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,11 @@ | ||
|
||
object Main { | ||
|
||
def main(args: Array[String]): Unit = { | ||
println("Hello world!") | ||
println(msg) | ||
} | ||
|
||
def msg = "I was compiled by dotty :)" | ||
|
||
} |
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,9 @@ | ||
|
||
import org.junit.Test | ||
import org.junit.Assert._ | ||
|
||
class Test1 { | ||
@Test def t1(): Unit = { | ||
assertEquals("I was compiled by dotty :)", Main.msg) | ||
} | ||
} |