Skip to content

Build infrastructure #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 24, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
*.class
*.log

# sbt specific
dist/*
target/
lib_managed/
src_managed/
project/boot/
project/plugins/project/
project/local-plugins.sbt
.history

# Scala-IDE specific
.scala_dependencies
.cache
.classpath
.project
.settings
bin/

# idea
.idea
.idea_modules
13 changes: 7 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@

name := "dotty"

organization := "lamp"
scalaVersion in Global := "2.11.0-M7"

scalaVersion := "2.10.0"
version in Global := "0.1-SNAPSHOT"

scalaSource in Compile <<= baseDirectory / "src"
organization in Global := "org.scala-lang"

scalacOptions in Global ++= Seq("-feature", "-deprecation", "-language:_")
organizationName in Global := "LAMP/EPFL"

libraryDependencies <+= scalaVersion ( sv => "org.scala-lang" % "scala-reflect" % sv )
organizationHomepage in Global := Some(url("http://lamp.epfl.ch"))

scalaSource in Test <<= baseDirectory / "test"
homepage in Global := Some(url("http://scala-lang.org"))
5 changes: 0 additions & 5 deletions gitignore.SAMPLE

This file was deleted.

39 changes: 39 additions & 0 deletions project/Build.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import sbt._
import Keys._
import Process._

object MiniboxingBuild extends Build {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be named DottyBuild.
btw is there any reason to have a Scala build file? It seems that all settings here can be in .sbt.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, we could have build.sbt and it would suffice, but if we start preparing multiple projects, it will be easier to use an sbt project.


val defaults = Defaults.defaultSettings ++ Seq(
// set sources to src/, tests to test/ and resources to resources/
scalaSource in Compile <<= baseDirectory(_ / "src"),
javaSource in Compile <<= baseDirectory(_ / "src"),
scalaSource in Test <<= baseDirectory(_ / "test"),
javaSource in Test <<= baseDirectory(_ / "test"),
resourceDirectory in Compile <<= baseDirectory(_ / "resources"),
unmanagedSourceDirectories in Compile <<= (scalaSource in Compile)(Seq(_)),
unmanagedSourceDirectories in Test <<= (scalaSource in Test)(Seq(_)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason not to use the default sbt directory structure?
I would also write all this in sbt 0.13 style, e.g.,
scalaSource in Compile := baseDirectory.value / "src"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to break Martin's Eclipse project. And I also like "src" instead of "src/main/scala" when all I have is Scala code.


// include sources in eclipse (downloads source code for all dependencies)
//http://stackoverflow.com/questions/10472840/how-to-attach-sources-to-sbt-managed-dependencies-in-scala-ide#answer-11683728
com.typesafe.sbteclipse.plugin.EclipsePlugin.EclipseKeys.withSource := true,

// to get Scala 2.11
resolvers += Resolver.sonatypeRepo("releases"),

// get reflect and xml onboard
libraryDependencies ++= Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.scala-lang.modules" %% "scala-xml" % "1.0.0-RC7"),

// get junit onboard
libraryDependencies += "com.novocode" % "junit-interface" % "0.9" % "test",

// scalac options
scalacOptions in Global ++= Seq("-feature", "-deprecation", "-language:_"),

// main class
mainClass in (Compile, run) := Some("dotty.tools.dotc.Main")
)

lazy val dotty = Project(id = "miniboxing", base = file("."), settings = defaults)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id = "dotty"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sjrd, I forgot to replace miniboxing by dotty. :D

}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.12.2
sbt.version=0.13.0
3 changes: 3 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Add personal SBT plugins for IDEs, etc to `local-plugins.sbt`
//
// e.g. addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.1.0")

// Scala IDE project file generator
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.2.0")
18 changes: 17 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
dotty
=====

The experimental compiler for a Scala dialect based on DOT
The experimental compiler for a Scala dialect based on DOT.

### To get started:
```
sbt compile
sbt run
```
The tests (`sbt test`) don''t work yet.


### To use the Scala IDE:
```
sbt eclipse
```
Notes:
* You will need the Scala IDE for 2.11.0-M7
* There are 2 spurious version incompatibility warnings