@@ -56,10 +56,12 @@ val bootstrapScalaVersion = "2.11.5"
56
56
val scalaParserCombinatorsDep = " org.scala-lang.modules" %% " scala-parser-combinators" % versionNumber(" scala-parser-combinators" ) exclude(" org.scala-lang" , " scala-library" )
57
57
val scalaXmlDep = " org.scala-lang.modules" %% " scala-xml" % versionNumber(" scala-xml" ) exclude(" org.scala-lang" , " scala-library" )
58
58
val partestDep = " org.scala-lang.modules" %% " scala-partest" % versionNumber(" partest" ) exclude(" org.scala-lang" , " scala-library" )
59
+ val partestInterfaceDep = " org.scala-lang.modules" %% " scala-partest-interface" % " 0.5.0" exclude(" org.scala-lang" , " scala-library" )
59
60
val junitDep = " junit" % " junit" % " 4.11"
60
61
val junitIntefaceDep = " com.novocode" % " junit-interface" % " 0.11" % " test"
61
62
val jlineDep = " jline" % " jline" % versionProps(" jline.version" )
62
63
val antDep = " org.apache.ant" % " ant" % " 1.9.4"
64
+ val scalacheckDep = " org.scalacheck" %% " scalacheck" % " 1.11.4" exclude(" org.scala-lang" , " scala-library" )
63
65
64
66
lazy val commonSettings = clearSourceAndResourceDirectories ++ Seq [Setting [_]](
65
67
organization := " org.scala-lang" ,
@@ -111,7 +113,7 @@ val disableDocsAndPublishingTasks = Seq[Setting[_]](
111
113
packageBin in Compile := file(" !!! NO PACKAGING !!!" )
112
114
)
113
115
114
- lazy val scalaSubprojectSettings = commonSettings ++ Seq [ Setting [_]](
116
+ lazy val setJarLocation : Setting [_] =
115
117
artifactPath in packageBin in Compile := {
116
118
// two lines below are copied over from sbt's sources:
117
119
// https://github.com/sbt/sbt/blob/0.13/main/src/main/scala/sbt/Defaults.scala#L628
@@ -123,7 +125,7 @@ lazy val scalaSubprojectSettings = commonSettings ++ Seq[Setting[_]](
123
125
val resolvedArtifactName = s " ${resolvedArtifact.name}. ${resolvedArtifact.extension}"
124
126
buildDirectory.value / " pack/lib" / resolvedArtifactName
125
127
}
126
- )
128
+ lazy val scalaSubprojectSettings : Seq [ Setting [_]] = commonSettings :+ setJarLocation
127
129
128
130
lazy val generatePropertiesFileSettings = Seq [Setting [_]](
129
131
copyrightString := " Copyright 2002-2013, LAMP/EPFL" ,
@@ -179,6 +181,10 @@ lazy val compiler = configureAsSubproject(project)
179
181
180
182
lazy val interactive = configureAsSubproject(project)
181
183
.settings(disableDocsAndPublishingTasks : _* )
184
+ .settings(
185
+ scalaVersion := bootstrapScalaVersion,
186
+ ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true ) }
187
+ )
182
188
.dependsOn(compiler)
183
189
184
190
lazy val repl = configureAsSubproject(project)
@@ -230,6 +236,58 @@ lazy val junit = project.in(file("test") / "junit")
230
236
unmanagedSourceDirectories in Test := List (baseDirectory.value)
231
237
)
232
238
239
+ lazy val partestJavaAgent = (project in file(" ." ) / " src" / " partest-javaagent" ).
240
+ dependsOn(asm).
241
+ settings(commonSettings : _* ).
242
+ settings(
243
+ doc := file(" !!! NO DOCS !!!" ),
244
+ publishLocal := {},
245
+ publish := {},
246
+ scalaVersion := bootstrapScalaVersion,
247
+ ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true ) },
248
+ // Setting name to "scala-partest-javaagent" so that the jar file gets that name, which the Runner relies on
249
+ name := " scala-partest-javaagent" ,
250
+ // writing jar file to $buildDirectory/pack/lib because that's where it's expected to be found
251
+ setJarLocation,
252
+ // add required manifest entry - previously included from file
253
+ packageOptions in (Compile , packageBin) +=
254
+ Package .ManifestAttributes ( " Premain-Class" -> " scala.tools.partest.javaagent.ProfilingAgent" ),
255
+ // we need to build this to a JAR
256
+ exportJars := true
257
+ )
258
+
259
+ lazy val test = project.
260
+ dependsOn(compiler, interactive, actors, repl, scalap, partestExtras, partestJavaAgent, asm, scaladoc).
261
+ configs(IntegrationTest ).
262
+ settings(disableDocsAndPublishingTasks : _* ).
263
+ settings(commonSettings : _* ).
264
+ settings(Defaults .itSettings: _* ).
265
+ settings(
266
+ scalaVersion := bootstrapScalaVersion,
267
+ ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true ) },
268
+ libraryDependencies ++= Seq (partestDep, scalaXmlDep, partestInterfaceDep, scalacheckDep),
269
+ unmanagedBase in Test := baseDirectory.value / " files" / " lib" ,
270
+ unmanagedJars in Test <+= (unmanagedBase) (j => Attributed .blank(j)) map(identity),
271
+ // no main sources
272
+ sources in Compile := Seq .empty,
273
+ // test sources are compiled in partest run, not here
274
+ sources in IntegrationTest := Seq .empty,
275
+ fork in IntegrationTest := true ,
276
+ javaOptions in IntegrationTest += " -Xmx1G" ,
277
+ testFrameworks += new TestFramework (" scala.tools.partest.Framework" ),
278
+ testOptions in IntegrationTest += Tests .Setup ( () => root.base.getAbsolutePath + " /pull-binary-libs.sh" ! ),
279
+ definedTests in IntegrationTest += (
280
+ new sbt.TestDefinition (
281
+ " partest" ,
282
+ // marker fingerprint since there are no test classes
283
+ // to be discovered by sbt:
284
+ new sbt.testing.AnnotatedFingerprint {
285
+ def isModule = true
286
+ def annotationName = " partest"
287
+ }, true , Array ())
288
+ )
289
+ )
290
+
233
291
lazy val root = (project in file(" ." )).
234
292
aggregate(library, forkjoin, reflect, compiler, asm, interactive, repl,
235
293
scaladoc, scalap, actors, partestExtras, junit).settings(
0 commit comments