1
+ import Dependencies ._
1
2
import Util ._
2
3
3
4
lazy val scala212 = " 2.12.10"
4
5
5
- ThisBuild / headerLicense := Some (HeaderLicense .Custom (
6
- """ Scala compiler interface
6
+ ThisBuild / headerLicense := Some (
7
+ HeaderLicense .Custom (
8
+ """ Scala compiler interface
7
9
|
8
10
|Copyright Lightbend, Inc. and Mark Harrah
9
11
|
@@ -13,7 +15,8 @@ ThisBuild / headerLicense := Some(HeaderLicense.Custom(
13
15
|See the NOTICE file distributed with this work for
14
16
|additional information regarding copyright ownership.
15
17
|""" .stripMargin
16
- ))
18
+ )
19
+ )
17
20
18
21
def commonSettings : Seq [Setting [_]] = Seq (
19
22
Test / publishArtifact := false ,
@@ -26,7 +29,7 @@ def commonSettings: Seq[Setting[_]] = Seq(
26
29
)
27
30
28
31
lazy val compilerInterfaceRoot = (project in file(" ." ))
29
- .aggregate(compilerInterface)
32
+ .aggregate(compilerInterface, dummyBridge )
30
33
.settings(
31
34
publish / skip := true ,
32
35
crossScalaVersions := Vector (),
@@ -40,11 +43,11 @@ lazy val compilerInterfaceRoot = (project in file("."))
40
43
| /_/
41
44
|welcome to the build for sbt/compiler-interface.
42
45
|""" .stripMargin +
43
- (if (sys.props(" java.specification.version" ) != " 1.8" )
44
- s """ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
46
+ (if (sys.props(" java.specification.version" ) != " 1.8" )
47
+ s """ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
45
48
| Java version is ${sys.props(" java.specification.version" )}. We recommend 1.8.
46
49
|!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! """ .stripMargin
47
- else " " )
50
+ else " " )
48
51
},
49
52
)
50
53
@@ -63,13 +66,24 @@ lazy val compilerInterface = (project in file("compiler-interface"))
63
66
crossPaths := false ,
64
67
autoScalaLibrary := false ,
65
68
mimaPreviousArtifacts := Set (
66
- " 1.0.0" , " 1.0.1" , " 1.0.2" , " 1.0.3" , " 1.0.4" , " 1.0.5" ,
67
- " 1.1.0" , " 1.1.1" , " 1.1.2" , " 1.1.3" ,
68
- " 1.2.0" , " 1.2.1" , " 1.2.2" ,
69
- ) map (version =>
70
- organization.value %% moduleName.value % version
71
- cross (if (crossPaths.value) CrossVersion .binary else CrossVersion .disabled)
72
- ),
69
+ " 1.0.0" ,
70
+ " 1.0.1" ,
71
+ " 1.0.2" ,
72
+ " 1.0.3" ,
73
+ " 1.0.4" ,
74
+ " 1.0.5" ,
75
+ " 1.1.0" ,
76
+ " 1.1.1" ,
77
+ " 1.1.2" ,
78
+ " 1.1.3" ,
79
+ " 1.2.0" ,
80
+ " 1.2.1" ,
81
+ " 1.2.2" ,
82
+ ) map (
83
+ version =>
84
+ organization.value %% moduleName.value % version
85
+ cross (if (crossPaths.value) CrossVersion .binary else CrossVersion .disabled)
86
+ ),
73
87
mimaBinaryIssueFilters ++= {
74
88
import com .typesafe .tools .mima .core ._
75
89
import com .typesafe .tools .mima .core .ProblemFilters ._
@@ -85,6 +99,33 @@ lazy val compilerInterface = (project in file("compiler-interface"))
85
99
},
86
100
)
87
101
102
+ lazy val dummyBridge = (project in file(" dummy-bridge" ))
103
+ .dependsOn(compilerInterface)
104
+ .settings(
105
+ name := " Dummy Compiler Bridge" ,
106
+ scalaVersion := " 2.13.1" ,
107
+ publish / skip := true ,
108
+ exportJars := true ,
109
+ libraryDependencies += " org.scala-lang" % " scala-compiler" % scalaVersion.value,
110
+ testFrameworks += new TestFramework (" verify.runner.Framework" ),
111
+ libraryDependencies ++= Seq (verify % Test , sbtIo % Test ),
112
+ // we need to fork because in unit tests we set usejavacp = true which means
113
+ // we are expecting all of our dependencies to be on classpath so Scala compiler
114
+ // can use them while constructing its own classpath for compilation
115
+ Test / fork := true ,
116
+ // needed because we fork tests and tests are ran in parallel so we have multiple Scala
117
+ // compiler instances that are memory hungry
118
+ Test / javaOptions ++= {
119
+ val si = (Test / scalaInstance).value
120
+ val bridge = (Compile / packageBin).value
121
+ List (
122
+ " -Xmx1G" ,
123
+ " -Dtest.bridgejar=" + bridge.toString,
124
+ " -Dtest.sijars=" + si.allJars.toList.mkString(sys.props(" path.separator" ))
125
+ )
126
+ },
127
+ )
128
+
88
129
ThisBuild / organization := " org.scala-sbt"
89
130
ThisBuild / organizationName := " sbt"
90
131
ThisBuild / organizationHomepage := Some (url(" https://www.scala-sbt.org/" ))
@@ -100,11 +141,15 @@ ThisBuild / developers := List(
100
141
)
101
142
102
143
ThisBuild / description := " a binary contract between Zinc and Scala compilers"
103
- ThisBuild / licenses := List (" Apache-2.0" -> new URL (" http://www.apache.org/licenses/LICENSE-2.0.txt" ))
144
+ ThisBuild / licenses := List (
145
+ " Apache-2.0" -> new URL (" http://www.apache.org/licenses/LICENSE-2.0.txt" )
146
+ )
104
147
ThisBuild / homepage := Some (url(" https://github.com/sbt/compiler-interface" ))
105
148
106
149
// Remove all additional repository other than Maven Central from POM
107
- ThisBuild / pomIncludeRepository := { _ => false }
150
+ ThisBuild / pomIncludeRepository := { _ =>
151
+ false
152
+ }
108
153
ThisBuild / publishTo := {
109
154
val nexus = " https://oss.sonatype.org/"
110
155
if (isSnapshot.value) Some (" snapshots" at nexus + " content/repositories/snapshots" )
0 commit comments