Skip to content

Topic/trait statics #21

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

Closed
wants to merge 52 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
1133991
SI-9539 Specify charset when reading ScalaSignatures, ...
soc Mar 15, 2016
76fd5a2
use Future#foreach instead of onSuccess in example code
xuwei-k Apr 5, 2016
ee3f4fe
Fix erasure for classOf[Unit], don't erase to classOf[BoxedUnit]
lrytz Apr 11, 2016
23159d2
Automate Eclipse settings and update project files: (#5091)
dragos Apr 20, 2016
65a7dfe
Updating README.md Eclipse version reference. (#5092)
jung-kim Apr 20, 2016
956923a
SI-9735 REPL prefer standard escapes for code text (#5086)
som-snytt Apr 20, 2016
684c314
SI-9734 Narrow type when import REPL history (#5084)
som-snytt Apr 20, 2016
04904be
CI: use java 6 for windows integration
adriaanm Apr 22, 2016
932162a
Merge pull request #5113 from adriaanm/ci-win-java6
adriaanm Apr 22, 2016
2dd311f
CI: hardcode java path in integrate/windows script
adriaanm Apr 22, 2016
0c5b42d
SI-9684 Deprecate JavaConversions
som-snytt Mar 26, 2016
3bf207b
Cleaned up Scaladoc for JavaConverters and non-deprecated friends
lrytz Apr 20, 2016
9c54117
Rename the (deprecated) implicit conversion methods in JavaConversions
lrytz Apr 20, 2016
9adfb0f
Merge commit '23159d2' into merge-2.11-to-2.12-apr-22
lrytz Apr 22, 2016
b3f2059
Merge commit '684c314' into merge-2.11-to-2.12-apr-22
lrytz Apr 22, 2016
6eef42e
Merge commit '2dd311f' into merge-2.11-to-2.12-apr-22
lrytz Apr 22, 2016
eb954ca
SI-9516 Fix the behavior of Int shift Long operations. (#5117)
sjrd Apr 23, 2016
cdc011f
Merge pull request #5109 from lrytz/pr5064
lrytz Apr 23, 2016
43f7a86
remove recursive classpath implementation
lrytz Apr 21, 2016
0f9a704
faster AggregateClassPath.findClass
lrytz Apr 21, 2016
2c1d1ad
Merge pull request #5115 from lrytz/merge-2.11-to-2.12-apr-22
lrytz Apr 25, 2016
93f209d
More efficient code for deciding if a mixin forwarder is needed (#5116)
lrytz Apr 25, 2016
24f6882
Avoid function chaining with reverse method
acdenhartog Apr 27, 2016
365ac03
SI-9762 Update to JLine 2.14.1
retronym Apr 27, 2016
6871bcc
SI-9762 Remove workaround after upstream fix in jline
retronym Apr 27, 2016
11dac0f
Merge pull request #5094 from lrytz/classOfUnit
adriaanm Apr 28, 2016
7bd8768
Fix the Eclipse classpaths for 2.12.0-M4. (#5136)
performantdata Apr 28, 2016
3d1b261
disable integrate/ide script on 2.11.x
SethTisue Apr 28, 2016
cf38506
Merge pull request #5139 from SethTisue/disable-integrate-ide
adriaanm Apr 28, 2016
ca382b7
SD-140 inline the correct default method
lrytz Apr 28, 2016
4c4c5e6
Merge pull request #5129 from retronym/ticket/9762
retronym Apr 29, 2016
0db65ea
Add examples to Exception object and group members (#5111)
janekdb May 2, 2016
5c2a2f7
SD-142 Avoid noisy log output in backend (#5134)
retronym May 2, 2016
86fe7de
SI-9752 never ignore blank lines when parsing code blocks (#5125)
gourlaysama May 2, 2016
1b1bc81
Emit a warning when a constant expression evaluates to an ArithmeticE…
liff May 2, 2016
30d6fce
Remove abstraction layer in classpath implementation
lrytz Apr 25, 2016
284571c
test PriorityQueue.reverse
acdenhartog May 2, 2016
fbd2e35
Merge pull request #5140 from lrytz/inlineDefaultMethods
retronym May 5, 2016
2726320
Merge pull request #5132 from acdenhartog/patch-1
retronym May 5, 2016
a46af82
Merge pull request #5112 from lrytz/dropRecursiveClasspath
retronym May 5, 2016
fa3ba5a
Merge pull request #5083 from xuwei-k/fix-Future-scaladoc
retronym May 5, 2016
2e7a3d7
Merge pull request #5042 from soc/SI-9539
retronym May 5, 2016
b74e4dd
Publish usable Scala distributions to Ivy repositories
szeiger Apr 26, 2016
d06ce96
Merge pull request #5128 from szeiger/wip/sbt-ivy-2.11
retronym May 10, 2016
38590c8
Merge commit 'cf38506' into merge/2.11.x-to-2.12.x-20160511
retronym May 10, 2016
1125d05
Merge commit 'd06ce96' into merge/2.11.x-to-2.12.x-20160511
retronym May 10, 2016
2ac295e
Lambda impl methods static and more stably named
retronym May 4, 2016
e430eb4
Emit trait method bodies in statics
retronym May 4, 2016
237c8b5
Revert pruning of redundant interfaces
retronym May 5, 2016
241d9f6
Assume trait methods are compiled to statics
retronym May 4, 2016
4a7bb82
Add impl restriction related to invokespecial to Java parents
retronym May 5, 2016
70e979d
Better diagnostic for optimizer crashes
retronym May 9, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Here, `<milestone>` is the milestone targeted by the PR (e.g., 2.11.6), and `<sh

## IDE Setup
### Eclipse
See `src/eclipse/README.md`.
See [src/eclipse/README.md](src/eclipse/README.md).

### IntelliJ 15
See [src/intellij/README.md](src/intellij/README.md).
Expand Down
72 changes: 50 additions & 22 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* What you see below is very much work-in-progress. The following features are implemented:
* - Compiling all classses for the compiler and library ("compile" in the respective subprojects)
* - Running JUnit tests ("test") and partest ("test/it:test")
* - Creating build/quick with all compiled classes and launcher scripts ("dist/mkQuick")
* - Creating build/quick with all compiled classes and launcher scripts ("˜")
* - Creating build/pack with all JARs and launcher scripts ("dist/mkPack")
* - Building all scaladoc sets ("doc")
* - Publishing ("publishDists" and standard sbt tasks like "publish" and "publishLocal")
Expand Down Expand Up @@ -84,7 +84,7 @@ lazy val publishSettings : Seq[Setting[_]] = Seq(
val mappings = artifacts.toSeq.map { case (a, f) =>
val typeSuffix = a.`type` match {
case "pom" => "-pom.xml"
case "bundle" | "jar" => ".jar"
case "jar" => ".jar"
case "doc" => "-docs.jar"
case tpe => s"-$tpe.${a.extension}"
}
Expand All @@ -99,6 +99,8 @@ lazy val publishSettings : Seq[Setting[_]] = Seq(
if (file.exists) List(Credentials(file))
else Nil
},
// Add a "default" Ivy configuration because sbt expects the Scala distribution to have one:
ivyConfigurations += Configuration("default", "Default", true, List(Configurations.Runtime), true),
publishMavenStyle := true
)

Expand Down Expand Up @@ -236,8 +238,8 @@ def fixPom(extra: (String, scala.xml.Node)*): Setting[_] = {
) ++ extra) }
}

/** Remove unwanted dependencies from the POM. */
def removePomDependencies(deps: (String, String)*): Setting[_] = {
/** Remove unwanted dependencies from the POM and ivy.xml. */
def removePomDependencies(deps: (String, String)*): Seq[Setting[_]] = Seq(
pomPostProcess := { n =>
val n2 = pomPostProcess.value.apply(n)
import scala.xml._
Expand All @@ -252,14 +254,40 @@ def removePomDependencies(deps: (String, String)*): Setting[_] = {
case n => Seq(n)
}
})).transform(Seq(n2)).head
},
deliverLocal := {
import scala.xml._
import scala.xml.transform._
val f = deliverLocal.value
val e = (new RuleTransformer(new RewriteRule {
override def transform(node: Node) = node match {
case e: Elem if e.label == "dependency" && {
val org = e.attribute("org").getOrElse("").toString
val name = e.attribute("name").getOrElse("").toString
deps.exists { case (g, a) =>
org == g && (name == a || name == (a + "_" + scalaBinaryVersion.value))
}
} => Seq.empty
case n => Seq(n)
}
})).transform(Seq(XML.loadFile(f))).head
XML.save(f.getAbsolutePath, e, xmlDecl = true)
f
}
}
)

val disableDocs = Seq[Setting[_]](
sources in (Compile, doc) := Seq.empty,
publishArtifact in (Compile, packageDoc) := false
)

val disablePublishing = Seq[Setting[_]](
publishArtifact := false,
// The above is enough for Maven repos but it doesn't prevent publishing of ivy.xml files
publish := {},
publishLocal := {}
)

lazy val setJarLocation: Setting[_] =
artifactPath in packageBin in Compile := {
// two lines below are copied over from sbt's sources:
Expand Down Expand Up @@ -397,43 +425,44 @@ lazy val compiler = configureAsSubproject(project)
"/project/description" -> <description>Compiler for the Scala Programming Language</description>,
"/project/packaging" -> <packaging>jar</packaging>
),
apiURL := None,
removePomDependencies(
("org.apache.ant", "ant"),
("org.scala-lang.modules", "scala-asm")
)
apiURL := None
)
.settings(removePomDependencies(
("org.apache.ant", "ant"),
("org.scala-lang.modules", "scala-asm")
): _*)
.dependsOn(library, reflect)

lazy val interactive = configureAsSubproject(project)
.settings(disableDocs: _*)
.settings(disablePublishing: _*)
.settings(
name := "scala-compiler-interactive",
description := "Scala Interactive Compiler",
publishArtifact := false
description := "Scala Interactive Compiler"
)
.dependsOn(compiler)

lazy val repl = configureAsSubproject(project)
.settings(disableDocs: _*)
.settings(disablePublishing: _*)
.settings(
connectInput in run := true,
publishArtifact := false,
run <<= (run in Compile).partialInput(" -usejavacp") // Automatically add this so that `repl/run` works without additional arguments.
)
.dependsOn(compiler, interactive)

lazy val replJline = configureAsSubproject(Project("repl-jline", file(".") / "src" / "repl-jline"))
.settings(disableDocs: _*)
.settings(disablePublishing: _*)
.settings(
libraryDependencies += jlineDep,
name := "scala-repl-jline",
publishArtifact := false
name := "scala-repl-jline"
)
.dependsOn(repl)

lazy val replJlineEmbedded = Project("repl-jline-embedded", file(".") / "target" / "repl-jline-embedded-src-dummy")
.settings(scalaSubprojectSettings: _*)
.settings(disablePublishing: _*)
.settings(
name := "scala-repl-jline-embedded",
// There is nothing to compile for this project. Instead we use the compile task to create
Expand Down Expand Up @@ -464,18 +493,17 @@ lazy val replJlineEmbedded = Project("repl-jline-embedded", file(".") / "target"
val outdir = (classDirectory in Compile).value
JarJar(inputs, outdir, config)
}),
publishArtifact := false,
connectInput in run := true
)
.dependsOn(replJline)

lazy val scaladoc = configureAsSubproject(project)
.settings(disableDocs: _*)
.settings(disablePublishing: _*)
.settings(
name := "scala-compiler-doc",
description := "Scala Documentation Generator",
libraryDependencies ++= Seq(scalaXmlDep, scalaParserCombinatorsDep, partestDep),
publishArtifact := false,
includeFilter in unmanagedResources in Compile := "*.html" | "*.css" | "*.gif" | "*.png" | "*.js" | "*.txt"
)
.dependsOn(compiler)
Expand All @@ -497,10 +525,10 @@ lazy val partestExtras = configureAsSubproject(Project("partest-extras", file(".
.dependsOn(replJlineEmbedded)
.settings(clearSourceAndResourceDirectories: _*)
.settings(disableDocs: _*)
.settings(disablePublishing: _*)
.settings(
name := "scala-partest-extras",
description := "Scala Compiler Testing Tool (compiler-specific extras)",
publishArtifact := false,
libraryDependencies += partestDep,
unmanagedSourceDirectories in Compile := List(baseDirectory.value)
)
Expand All @@ -510,8 +538,8 @@ lazy val junit = project.in(file("test") / "junit")
.settings(clearSourceAndResourceDirectories: _*)
.settings(commonSettings: _*)
.settings(disableDocs: _*)
.settings(disablePublishing: _*)
.settings(
publishArtifact := false,
fork in Test := true,
libraryDependencies ++= Seq(junitDep, junitIntefaceDep),
testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-v"),
Expand Down Expand Up @@ -543,9 +571,9 @@ lazy val test = project
.configs(IntegrationTest)
.settings(commonSettings: _*)
.settings(disableDocs: _*)
.settings(disablePublishing: _*)
.settings(Defaults.itSettings: _*)
.settings(
publishArtifact := false,
libraryDependencies ++= Seq(asmDep, partestDep, scalaXmlDep, scalacheckDep),
unmanagedBase in IntegrationTest := baseDirectory.value / "files" / "lib",
unmanagedJars in IntegrationTest <+= (unmanagedBase) (j => Attributed.blank(j)) map(identity),
Expand All @@ -572,8 +600,8 @@ lazy val test = project

lazy val manual = configureAsSubproject(project)
.settings(disableDocs: _*)
.settings(disablePublishing: _*)
.settings(
publishArtifact := false,
libraryDependencies ++= Seq(scalaXmlDep, antDep),
classDirectory in Compile := (target in Compile).value / "classes"
)
Expand Down Expand Up @@ -643,9 +671,9 @@ lazy val scalaDist = Project("scala-dist", file(".") / "target" / "scala-dist-di

lazy val root = (project in file("."))
.settings(disableDocs: _*)
.settings(disablePublishing: _*)
.settings(generateBuildCharacterFileSettings: _*)
.settings(
publishArtifact := false,
publish := {},
publishLocal := {},
commands ++= ScriptCommands.all,
Expand Down
9 changes: 4 additions & 5 deletions project/Osgi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import aQute.bnd.osgi.Constants._
import java.util.Properties
import sbt._
import sbt.Keys._
import scala.collection.JavaConversions._
import collection.JavaConverters._
import VersionUtil.versionProperties

/** OSGi packaging for the Scala build, distilled from sbt-osgi. We do not use sbt-osgi because it
Expand Down Expand Up @@ -40,7 +40,6 @@ object Osgi {
},
packagedArtifact in (Compile, packageBin) <<= (artifact in (Compile, packageBin), bundle).identityMap,
// Also create OSGi source bundles:
artifact in (Compile, packageBin) ~= (_.copy(`type` = "bundle")),
packageOptions in (Compile, packageSrc) += Package.ManifestAttributes(
"Bundle-Name" -> (description.value + " Sources"),
"Bundle-SymbolicName" -> (bundleSymbolicName.value + ".source"),
Expand All @@ -57,12 +56,12 @@ object Osgi {
headers foreach { case (k, v) => builder.setProperty(k, v) }
val includeRes = resourceDirectories.filter(_.exists).map(_.getAbsolutePath).mkString(",")
if(!includeRes.isEmpty) builder.setProperty(INCLUDERESOURCE, includeRes)
builder.getProperties.foreach { case (k, v) => log.debug(s"bnd: $k: $v") }
builder.getProperties.asScala.foreach { case (k, v) => log.debug(s"bnd: $k: $v") }
// builder.build is not thread-safe because it uses a static SimpleDateFormat. This ensures
// that all calls to builder.build are serialized.
val jar = synchronized { builder.build }
builder.getWarnings.foreach(s => log.warn(s"bnd: $s"))
builder.getErrors.foreach(s => log.error(s"bnd: $s"))
builder.getWarnings.asScala.foreach(s => log.warn(s"bnd: $s"))
builder.getErrors.asScala.foreach(s => log.error(s"bnd: $s"))
IO.createDirectory(artifactPath.getParentFile)
jar.write(artifactPath)
artifactPath
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/scala/tools/cmd/Property.scala
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ trait Property extends Reference {
propertiesToOptions(loadProperties(file))

def propertiesToOptions(props: java.util.Properties): List[String] = {
import scala.collection.JavaConversions._
propertiesToOptions(props.toList)
import scala.collection.JavaConverters._
propertiesToOptions(props.asScala.toList)
}
def propertiesToOptions(props: List[(String, String)]) = props flatMap propMapper
}
4 changes: 2 additions & 2 deletions src/compiler/scala/tools/nsc/GenericRunnerSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
package scala.tools.nsc

import java.net.URL
import scala.tools.util.PathResolverFactory
import scala.tools.util.PathResolver

class GenericRunnerSettings(error: String => Unit) extends Settings(error) {
lazy val classpathURLs: Seq[URL] = PathResolverFactory.create(this).resultAsURLs
lazy val classpathURLs: Seq[URL] = new PathResolver(this).resultAsURLs

val howtorun =
ChoiceSetting(
Expand Down
Loading