Skip to content

Commit

Permalink
Temporarily insource Scalacheck 1.11.6
Browse files Browse the repository at this point in the history
This is a temporary measure until we release Scala
2.12.0. It means we are able to release milestones,
and RCs of Scala without needing a public release of
Scalacheck. While we've never had to wait very long
for these in the past (Thanks, Rickard!) we'd like
to spare the maintainer some work betwen now and 2.12.0.

After we release Scala 2.12.0, we'll revert to a binary
dependency on the standard Scalacheck.

I have replaced the scala-parser-combinator based
command line option parsing with a quick and dirty
version.

I've had to remove scalacheck as a SBT test framework
in our build. We don't use it directly as such (instead,
it is used indirectly through `partest --scalacheck`),
and it's test discovery (which we expect to return nothing)
fails after re-STARR-ing due to an unsolved problem with
SBT's testLoader including either STARR or sbt-launch.jar
on the classpath used to discover and spawn tests.

For the record, I tried the following to no avail:

```
// Two modifications are needed from the stock SBT configuration in order to exclude STARR
// from the classloader that performs test discovery.
//   - We make `isManagedVersion` hold by providing an explicit Scala version, in order to go into the desired
//     branch in `createTestLoader`
//   - We remove STARR from the classloader of the scala instance
def fixTestLoader = testLoader := {
  val s = scalaInstance.value
  val scalaInstance1 =
    new ScalaInstance(s.version, appConfiguration.value.provider.scalaProvider.loader(), s.libraryJar, s.compilerJar, s.extraJars, Some(s.actualVersion))
  assert(scalaInstance1.isManagedVersion)
  TestFramework.createTestLoader(Attributed.data(fullClasspath.value), scalaInstance1, IO.createUniqueDirectory(taskTemporaryDirectory.value))
}

```

f
  • Loading branch information
retronym committed Jun 27, 2016
1 parent 4e95083 commit 22dac31
Show file tree
Hide file tree
Showing 19 changed files with 3,653 additions and 23 deletions.
5 changes: 3 additions & 2 deletions build.sbt
Expand Up @@ -60,7 +60,6 @@ val scalaParserCombinatorsDep = scalaDep("org.scala-lang.modules", "scala-par
val scalaSwingDep = scalaDep("org.scala-lang.modules", "scala-swing")
val scalaXmlDep = scalaDep("org.scala-lang.modules", "scala-xml")
val partestDep = scalaDep("org.scala-lang.modules", "scala-partest", versionProp = "partest")
val scalacheckDep = scalaDep("org.scalacheck", "scalacheck", scope = "it")

// Non-Scala dependencies:
val junitDep = "junit" % "junit" % "4.11"
Expand Down Expand Up @@ -562,6 +561,7 @@ lazy val junit = project.in(file("test") / "junit")
fork in Test := true,
libraryDependencies ++= Seq(junitDep, junitInterfaceDep, jolDep),
testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-v"),
testFrameworks -= new TestFramework("org.scalacheck.ScalaCheckFramework"),
unmanagedSourceDirectories in Test := List(baseDirectory.value)
)

Expand Down Expand Up @@ -642,7 +642,7 @@ lazy val test = project
.settings(disablePublishing: _*)
.settings(Defaults.itSettings: _*)
.settings(
libraryDependencies ++= Seq(asmDep, partestDep, scalaXmlDep, scalacheckDep),
libraryDependencies ++= Seq(asmDep, partestDep, scalaXmlDep),
libraryDependencies ++= {
// Resolve the JARs for all test/files/lib/*.jar.desired.sha1 files through Ivy
val baseDir = (baseDirectory in ThisBuild).value
Expand All @@ -659,6 +659,7 @@ lazy val test = project
fork in IntegrationTest := true,
javaOptions in IntegrationTest += "-Xmx2G",
testFrameworks += new TestFramework("scala.tools.partest.sbt.Framework"),
testFrameworks -= new TestFramework("org.scalacheck.ScalaCheckFramework"),
testOptions in IntegrationTest += Tests.Argument("-Dpartest.java_opts=-Xmx1024M -Xms64M -XX:MaxPermSize=128M"),
testOptions in IntegrationTest += Tests.Argument("-Dpartest.scalac_opts=" + (scalacOptions in Compile).value.mkString(" ")),
testOptions in IntegrationTest += Tests.Setup { () =>
Expand Down
21 changes: 1 addition & 20 deletions build.xml
Expand Up @@ -319,7 +319,6 @@ TODO:
<prepareCross name="scala-parser-combinators" />
<prepareCross name="scala-swing"/>
<prepareCross name="partest"/>
<prepareCross name="scalacheck"/>

<artifact:dependencies pathId="asm.classpath" filesetId="asm.fileset">
<dependency groupId="org.scala-lang.modules" artifactId="scala-asm" version="${scala-asm.version}"/>
Expand All @@ -339,11 +338,6 @@ TODO:
</artifact:dependencies>
<copy-deps project="partest"/>

<artifact:dependencies pathId="scalacheck.classpath" filesetId="scalacheck.fileset" versionsId="scalacheck.versions">
<artifact:remoteRepository refid="extra-repo"/>
<dependency groupId="org.scalacheck" artifactId="scalacheck${scalacheck.cross}" version="${scalacheck.version.number}" />
</artifact:dependencies>

<artifact:dependencies pathId="repl.deps.classpath" filesetId="repl.fileset" versionsId="repl.deps.versions">
<dependency groupId="jline" artifactId="jline" version="${jline.version}"/>
</artifact:dependencies>
Expand Down Expand Up @@ -567,7 +561,6 @@ TODO:
<echo message="scala-swing.version.number = ${scala-swing.version.number}"/>
<echo message="jline.version = ${jline.version}"/>
<echo message="partest.version.number = ${partest.version.number}"/>
<echo message="scalacheck.version.number = ${scalacheck.version.number}"/>

<propertyfile file="versions.properties">
<entry key="starr.version" value="${starr.version}"/>
Expand All @@ -577,7 +570,6 @@ TODO:
<entry key="scala-swing.version.number" value="${scala-swing.version.number}"/>
<entry key="jline.version" value="${jline.version}"/>
<entry key="partest.version.number" value="${partest.version.number}"/>
<entry key="scalacheck.version.number" value="${scalacheck.version.number}"/>
</propertyfile>
</then></if>

Expand Down Expand Up @@ -922,7 +914,7 @@ TODO:
(but not scala-library, so we filter that one out...)
so we provide them: scala-[library/reflect/compiler], scalap built here,
scala-xml, scala-parser-combinators via external-modules-nocore,
scalacheck as part of `partest.classpath` -->
as part of `partest.classpath` -->
<restrict>
<path refid="partest.classpath"/>
<rsel:not><rsel:or>
Expand All @@ -933,17 +925,6 @@ TODO:
<pathelement location="${scala-parser-combinators}"/>
<!-- <pathelement location="${scala-swing}"/> -->

<restrict>
<path refid="scalacheck.classpath"/>
<rsel:not><rsel:or>
<rsel:name name="scala-library*.jar"/>
<rsel:name name="scala-compiler*.jar"/>
<rsel:name name="scala-reflect*.jar"/>
<rsel:name name="scala-parser-combinators*.jar"/>
<rsel:name name="scala-xml*.jar"/>
</rsel:or></rsel:not>
</restrict>

<!-- partest classes specific to the core compiler build -->
<pathelement location="${partest-extras.jar}"/>
<pathelement location="${partest-javaagent.jar}"/>
Expand Down
1 change: 1 addition & 0 deletions doc/LICENSE.md
Expand Up @@ -46,6 +46,7 @@ This license is used by the following third-party libraries:
This license is used by the following third-party libraries:

* jline
* scalacheck

### [BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause)
This license is used by the following third-party libraries:
Expand Down
32 changes: 32 additions & 0 deletions doc/licenses/bsd_scalacheck.txt
@@ -0,0 +1,32 @@
ScalaCheck LICENSE

Copyright (c) 2007-2013, Rickard Nilsson
All rights reserved.

Permission to use, copy, modify, and distribute this software in source
or binary form for any purpose with or without fee is hereby granted,
provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

3. Neither the name of the author nor the names of its contributors
may be used to endorse or promote products derived from this
software without specific prior written permission.


THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

0 comments on commit 22dac31

Please sign in to comment.