-
Notifications
You must be signed in to change notification settings - Fork 189
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
Change into educational example #77
Closed
+35
−51
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,55 +1,39 @@ | ||
// See README.md for license details. | ||
|
||
def scalacOptionsVersion(scalaVersion: String): Seq[String] = { | ||
Seq() ++ { | ||
// If we're building with Scala > 2.11, enable the compile option | ||
// switch to support our anonymous Bundle definitions: | ||
// https://github.com/scala/bug/issues/10047 | ||
CrossVersion.partialVersion(scalaVersion) match { | ||
case Some((2, scalaMajor: Long)) if scalaMajor < 12 => Seq() | ||
case _ => Seq("-Xsource:2.11") | ||
} | ||
} | ||
} | ||
|
||
def javacOptionsVersion(scalaVersion: String): Seq[String] = { | ||
Seq() ++ { | ||
// Scala 2.12 requires Java 8. We continue to generate | ||
// Java 7 compatible code for Scala 2.11 | ||
// for compatibility with old clients. | ||
CrossVersion.partialVersion(scalaVersion) match { | ||
case Some((2, scalaMajor: Long)) if scalaMajor < 12 => | ||
Seq("-source", "1.7", "-target", "1.7") | ||
case _ => | ||
Seq("-source", "1.8", "-target", "1.8") | ||
} | ||
} | ||
} | ||
|
||
name := "chisel-module-template" | ||
|
||
version := "3.3-SNAPSHOT" | ||
|
||
scalaVersion := "2.12.10" | ||
|
||
crossScalaVersions := Seq("2.12.10", "2.11.12") | ||
|
||
resolvers ++= Seq( | ||
Resolver.sonatypeRepo("snapshots"), | ||
Resolver.sonatypeRepo("releases") | ||
) | ||
|
||
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full) | ||
|
||
// Provide a managed dependency on X if -DXVersion="" is supplied on the command line. | ||
val defaultVersions = Seq( | ||
"chisel-iotesters" -> "1.5-SNAPSHOT", | ||
"chiseltest" -> "0.3-SNAPSHOT" | ||
// Common properties shared for a whole build | ||
ThisBuild / scalaVersion := "2.12.12" | ||
// These settings are mainly for publishing, they should be customized by the user | ||
ThisBuild / organization := "edu.berkeley.cs" | ||
ThisBuild / version := "3.3-SNAPSHOT" // SNAPSHOT is used to indicate development | ||
|
||
// A project is a compilation unit | ||
// Many projects are fine with just one (like this example), but complex builds may have multiple | ||
// The properties scoped in "ThisBuild" above are shared between all projects | ||
lazy val chiselTemplate = (project in file(".")) | ||
.settings( | ||
name := "chisel-module-template", | ||
libraryDependencies ++= Seq( | ||
// Fundamentally, Chisel is just a Scala library, so we depend on it as a library | ||
// Chisel 3 is versioning is of the style "3.<major>.<minor>" | ||
// Chisel maintains binary compatibility between minor versions | ||
// We use '+' to pull newest minor version | ||
"edu.berkeley.cs" %% "chisel3" % "3.3.+", | ||
// By default, dependencies are in the "main" scope, projects also have a "test" scope | ||
// main code lives in "src/main/", test is found in "src/test/" | ||
// The following depenencies will only be available in "src/test/" | ||
"edu.berkeley.cs" %% "chisel-iotesters" % "1.4.+" % "test", | ||
// Leading with a 0 indicates less stability so it's generally good to pin a specific version, | ||
// It's also reasonable to pin specific versions for the above dependencies as well | ||
"edu.berkeley.cs" %% "chiseltest" % "0.2.2" % "test" | ||
), | ||
scalacOptions ++= Seq( | ||
// Required options for Chisel code | ||
"-Xsource:2.11", | ||
// Recommended options | ||
"-language:reflectiveCalls", | ||
"-deprecation", | ||
"-feature", | ||
"-Xcheckinit" | ||
) | ||
) | ||
|
||
libraryDependencies ++= defaultVersions.map { case (dep, ver) => | ||
"edu.berkeley.cs" %% dep % sys.props.getOrElse(dep + "Version", ver) } | ||
|
||
scalacOptions ++= scalacOptionsVersion(scalaVersion.value) | ||
|
||
javacOptions ++= javacOptionsVersion(scalaVersion.value) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nix iotesters, pin versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potentially only have dependency on
chiseltest