1/* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 */ 19 20name := "accel" 21version := "0.1.0-SNAPSHOT" 22organization := "edu.washington.cs" 23 24def scalacOptionsVersion(scalaVersion: String): Seq[String] = { 25 Seq() ++ { 26 // If we're building with Scala > 2.11, enable the compile option 27 // switch to support our anonymous Bundle definitions: 28 // https://github.com/scala/bug/issues/10047 29 CrossVersion.partialVersion(scalaVersion) match { 30 case Some((2, scalaMajor: Long)) if scalaMajor < 12 => Seq() 31 case _ => Seq( 32 "-Xsource:2.11", 33 "-language:reflectiveCalls", 34 "-language:implicitConversions", 35 "-deprecation", 36 "-Xlint", 37 "-Ywarn-unused", 38 ) 39 } 40 } 41} 42 43def javacOptionsVersion(scalaVersion: String): Seq[String] = { 44 Seq() ++ { 45 // Scala 2.12 requires Java 8. We continue to generate 46 // Java 7 compatible code for Scala 2.11 47 // for compatibility with old clients. 48 CrossVersion.partialVersion(scalaVersion) match { 49 case Some((2, scalaMajor: Long)) if scalaMajor < 12 => 50 Seq("-source", "1.7", "-target", "1.7") 51 case _ => 52 Seq("-source", "1.8", "-target", "1.8") 53 } 54 } 55} 56 57scalaVersion := "2.11.12" 58 59resolvers ++= Seq( 60 Resolver.sonatypeRepo("snapshots"), 61 Resolver.sonatypeRepo("releases")) 62 63libraryDependencies ++= Seq( 64 "edu.berkeley.cs" %% "chisel3" % "3.1.7", 65 "edu.washington.cs" %% "vta" % "0.1.0-SNAPSHOT", 66) 67 68scalacOptions ++= scalacOptionsVersion(scalaVersion.value) 69javacOptions ++= javacOptionsVersion(scalaVersion.value) 70