Skip to content

Restructuring repo and issues #1636

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

Merged
merged 55 commits into from
Nov 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
2d10c87
Move sbt-bridge
felixmulder Oct 11, 2016
2769e1b
separate lib from compiler
felixmulder Oct 18, 2016
805884c
Remove compiler when running applications via dotr
felixmulder Oct 19, 2016
6351c6c
Create dotty-lib.jar for run tests
felixmulder Oct 19, 2016
bbc46b4
Add dotty-library to classpath in dottydoc tests
felixmulder Oct 23, 2016
0bd9598
Add tags file to gitignore
felixmulder Oct 25, 2016
0da788c
Add bin project to separate scripted tests from compiler tests
felixmulder Oct 25, 2016
06a3d47
Move sjs, make sure that partest compiles everything in dirs
felixmulder Oct 26, 2016
aa700b6
Fix JUnit tests by always packaging everything
smarter Oct 28, 2016
02a29c9
Increanse Jenkins max heap for 1.3G to 1.5G
smarter Oct 28, 2016
0dc738d
Fix partest compilation of java-interop tests by moving them
smarter Oct 28, 2016
c65591c
PathResolver: fix priorityClassPath
smarter Oct 28, 2016
5c34122
Fix "sbt run"
smarter Oct 28, 2016
0c8e2a3
Fix pickle_pickleOK test
smarter Oct 28, 2016
8654ce8
dottyDependsOnBootedLib should not be a JUnit test
smarter Oct 28, 2016
f4d46f3
TastyPrinter: fix RefinedType printing
smarter Oct 29, 2016
b385542
Make homogenize apply HKApplys
felixmulder Nov 1, 2016
6a455fe
Move (most) unit tests to correct locations
felixmulder Nov 1, 2016
8a61ff4
Move compiler and compiler tests to compiler dir
felixmulder Nov 2, 2016
7879d0f
Fix rebuild on change in scripts
felixmulder Nov 3, 2016
5c293d0
Add `repl` command
felixmulder Nov 3, 2016
ba7d7a3
Add `dotc` command with sane classpath
felixmulder Nov 3, 2016
b2143a1
Make `dotr` run binaries similar to script in bin
felixmulder Nov 3, 2016
7fbb451
Update documentation for new sbt commands
felixmulder Nov 3, 2016
fcdb1c9
Remove unused examples dir, duplicate contained in tests/pos
felixmulder Nov 3, 2016
94a8177
Move `dottydoc` -> `doc-tool`
felixmulder Nov 3, 2016
8488557
Add packageAll alias in root project
smarter Nov 14, 2016
cc56d3d
Fix partest commands
smarter Nov 14, 2016
1b19afa
Run dotty tests with the correct baseDirectory
smarter Nov 14, 2016
c061baf
The root project now aggregates the other projects
smarter Nov 14, 2016
6acdc1e
Move bridge to correct location, fix unmanaged sources in build
felixmulder Nov 17, 2016
574a53f
Fix flags for default getters of constructors
smarter Nov 14, 2016
46f482e
TypedTreeCopier#Select: don't use unstable prefixes
smarter Nov 14, 2016
a7d25b9
-Ytest-pickler: homogenize template body output order
smarter Nov 14, 2016
717264b
-Ytest-pickler: avoid forcing anything when there's a difference
smarter Nov 14, 2016
49f2ffd
TreeUnpickler: Add missing case for ENUMconst
smarter Nov 14, 2016
19c4c24
bin/common: jar is dotty-compiler, not dotty
smarter Nov 16, 2016
ce23380
checkNoPrivateLeaks: handle references to companion members
smarter Nov 16, 2016
d3a4916
checkNoPrivateLeaks: handle defs in local classes
smarter Nov 16, 2016
1dee5b6
checkNoPrivateLeaks is now also done in TreeUnpickler
smarter Nov 17, 2016
830d469
Workaround last issue with -Ytest-pickler
smarter Nov 17, 2016
3693211
Do not force symbols of annotations when unpickling
smarter Nov 14, 2016
2d6a290
ExtractDependencies: correctly record inheritance on type alias
smarter Oct 13, 2016
e5b64f1
Move PatmatExhaustivityTest.scala in its proper place
smarter Nov 18, 2016
1806e28
Fix remaining tests with incorrect paths following move
smarter Nov 18, 2016
07923f1
Run some tests sequentially to avoid exhausting available memory
smarter Nov 19, 2016
90d7f97
Replace dotc task by run, make dotc an alias of run
smarter Nov 19, 2016
da1bfe3
Remove unnecessary aliases
smarter Nov 19, 2016
c3eb841
Make every project use the new directory structure
smarter Nov 19, 2016
9a0c1f7
Move benchmarks test to right location
felixmulder Nov 21, 2016
f582ee0
Rename sbt bin project to `dotty-bin-tests`
felixmulder Nov 21, 2016
799bd1a
Fix script choosing wrong artefact
felixmulder Nov 21, 2016
fee0b0e
Disable script tests, should be done by nightly
felixmulder Nov 21, 2016
e50afe9
Properly unpickle This trees without qualifier
smarter Nov 21, 2016
9222af0
TreeUnpickler: Workaround cyclic reference involving self-type
smarter Nov 21, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.log
*.swp
*~
tags

# sbt specific
dist/*
Expand Down Expand Up @@ -31,6 +32,7 @@ classes/

# Partest
dotty.jar
dotty-lib.jar
tests/partest-generated/
tests/locks/
/test-classes/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package dotty.tools.benchmarks


import org.scalameter.Key.reports._
import org.scalameter.PerformanceTest.OnlineRegressionReport
import org.scalameter.api._
import org.scalameter.{Context, History, currentContext, persistence}
import org.scalameter.reporting.RegressionReporter.Tester
import test.CompilerTest
import dotty.tools.dotc.CompilerTest

import scala.io.Source

Expand Down Expand Up @@ -46,13 +45,14 @@ object BenchTests extends OnlineRegressionReport {
implicit val defaultOptions = List("-d", outputDir)
val scala2mode = List("-language:Scala2")

val dottyDir = "./src/dotty/"
val dottyDir = "../compiler/src/dotty/"

val stdlibFiles = Source.fromFile("./test/dotc/scala-collections.whitelist", "UTF8").getLines()
val stdlibFiles = Source.fromFile("../compiler/test/dotc/scala-collections.whitelist", "UTF8").getLines()
.map(_.trim) // allow identation
.filter(!_.startsWith("#")) // allow comment lines prefixed by #
.map(_.takeWhile(_ != '#').trim) // allow comments in the end of line
.filter(_.nonEmpty)
.map("." + _)
.toList

def stdLib = compiler.compileList("compileStdLib", stdlibFiles, "-migration" :: scala2mode)
Expand Down
26 changes: 17 additions & 9 deletions bin/common
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function build_jar {

local sedjar="$3"
if [ "$sedjar" == "" ]; then
sedjar="/.*\.jar/p"
sedjar="/tests/d; /javadoc/d; /.*\.jar/p"
fi

if [ "$jar" == "" ]; then
Expand All @@ -74,6 +74,7 @@ function build_jar {
function update_packages {
echo "$INTERFACES_JAR" > $DOTTY_ROOT/.packages
echo "$MAIN_JAR" >> $DOTTY_ROOT/.packages
echo "$DOTTY_LIB_JAR" >> $DOTTY_ROOT/.packages
echo "$TEST_JAR" >> $DOTTY_ROOT/.packages
}

Expand All @@ -84,12 +85,16 @@ function build_all {
INTERFACES_JAR=$(build_jar dotty-interfaces/package interfaces/target)
printf "done\n"

printf "Building dotty..."
MAIN_JAR=$(build_jar package "target/scala-$SCALA_BINARY_VERSION")
printf "Building dotty-compiler..."
MAIN_JAR=$(build_jar dotty-compiler/package "compiler/target/scala-$SCALA_BINARY_VERSION")
printf "done\n"

printf "Building dotty library..."
DOTTY_LIB_JAR=$(build_jar dotty-library/package "library/target/scala-$SCALA_BINARY_VERSION")
printf "done\n"

printf "Building tests..."
TEST_JAR=$(build_jar test:package "target/scala-$SCALA_BINARY_VERSION" '/dotty.*-tests\.jar/p')
TEST_JAR=$(build_jar test:package "compiler/target/scala-$SCALA_BINARY_VERSION" '/dotty.*-tests\.jar/p')
printf "done\n"

update_packages
Expand All @@ -101,10 +106,11 @@ if [ ! -f "$DOTTY_ROOT/.packages" ]; then
else
IFS=$'\r\n' GLOBIGNORE='*' command eval 'JARS=($(cat $DOTTY_ROOT/.packages))'

if [ "${#JARS[@]}" == "3" ]; then
if [ "${#JARS[@]}" == "4" ]; then
INTERFACES_JAR="${JARS[0]}"
MAIN_JAR="${JARS[1]}"
TEST_JAR="${JARS[2]}"
DOTTY_LIB_JAR="${JARS[2]}"
TEST_JAR="${JARS[3]}"
else
echo "Failed to parse .packages file"
build_all
Expand All @@ -118,15 +124,17 @@ function check_jar {
local new_files="$(find "$DOTTY_ROOT/$3" \( -iname "*.scala" -o -iname "*.java" \) -newer "$2")"
if [ ! -z "$new_files" ]; then
printf "New files detected in $1, rebuilding..."
rm $2
eval "$4"
printf "done\n"
update_packages
fi
}

check_jar "dotty-interfaces" $INTERFACES_JAR "interfaces" 'INTERFACES_JAR=$(build_jar dotty-interfaces/package interfaces/target)'
check_jar "dotty" $MAIN_JAR "src" 'MAIN_JAR=$(build_jar package target/scala-$SCALA_BINARY_VERSION)'
check_jar "dotty-tests" $TEST_JAR "test" 'TEST_JAR=$(build_jar test:package target/scala-$SCALA_BINARY_VERSION /dotty.*-tests\.jar/p)'
check_jar "dotty-interfaces" $INTERFACES_JAR "interfaces/src" 'INTERFACES_JAR=$(build_jar dotty-interfaces/package interfaces/target)'
check_jar "dotty-compiler" $MAIN_JAR "compiler/src" 'MAIN_JAR=$(build_jar dotty-compiler/package compiler/target/scala-$SCALA_BINARY_VERSION)'
check_jar "dotty-library" $DOTTY_LIB_JAR "library/src" 'DOTTY_LIB_JAR=$(build_jar dotty-library/package library/target/scala-$SCALA_BINARY_VERSION)'
check_jar "dotty-tests" $TEST_JAR "compiler/test" 'TEST_JAR=$(build_jar dotty-compiler/test:package compiler/target/scala-$SCALA_BINARY_VERSION /dotty.*-tests\.jar/p)'

# Autodetecting the scala-library location, in case it wasn't provided by an environment variable
if [ "$SCALA_LIBRARY_JAR" == "" ]; then
Expand Down
8 changes: 4 additions & 4 deletions bin/dotc
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ trap onExit INT
classpathArgs () {
if [[ "true" == $bootstrapped ]]; then
check_jar "dotty-bootstrapped" $DOTTY_JAR "target" 'build_jar "test:runMain dotc.build" target' &> /dev/null
toolchain="$DOTTY_JAR:$SCALA_LIBRARY_JAR:$SCALA_REFLECT_JAR:$SCALA_COMPILER_JAR:$SBT_INTERFACE_JAR"
toolchain="$DOTTY_JAR:$DOTTY_LIB_JAR:$SCALA_LIBRARY_JAR:$SCALA_REFLECT_JAR:$SCALA_COMPILER_JAR:$SBT_INTERFACE_JAR"
else
toolchain="$SCALA_LIBRARY_JAR:$SCALA_REFLECT_JAR:$SCALA_COMPILER_JAR:$SBT_INTERFACE_JAR"
toolchain="$SCALA_LIBRARY_JAR:$DOTTY_LIB_JAR:$SCALA_REFLECT_JAR:$SCALA_COMPILER_JAR:$SBT_INTERFACE_JAR"
fi
bcpJars="$INTERFACES_JAR:$MAIN_JAR"
cpJars="$INTERFACES_JAR:$MAIN_JAR:$TEST_JAR"
bcpJars="$INTERFACES_JAR:$MAIN_JAR:$DOTTY_LIB_JAR"
cpJars="$INTERFACES_JAR:$MAIN_JAR:$DOTTY_LIB_JAR:$TEST_JAR"

if [[ -n "$cygwin" ]]; then
if [[ "$OS" = "Windows_NT" ]] && cygpath -m .>/dev/null 2>/dev/null ; then
Expand Down
3 changes: 1 addition & 2 deletions bin/dotr
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ DOTTY_ROOT="$( cd "$DOTTY_ROOT" >& /dev/null && pwd )/.." # absolute
# Load common functions and variables
source $DOTTY_ROOT/bin/common

# CLASS_PATH is derived from the DOTTY_ROOT and SCALA_LIBRARY_JAR
CLASS_PATH="-Xbootclasspath/a:.:$DOTTY_ROOT/target/scala-$SCALA_BINARY_VERSION/classes/:.:$SCALA_LIBRARY_JAR"
CLASS_PATH="-classpath .:$DOTTY_LIB_JAR:.:$SCALA_LIBRARY_JAR"

function runMain {
local jbin=$(which "java")
Expand Down
28 changes: 15 additions & 13 deletions test/scripts/TestDotc.scala → bin/test/TestScripts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import scala.io.Source
import scala.sys.process.{Process, ProcessLogger}
import java.io.{File => JFile, FileNotFoundException}

class TestDotc {
class TestScripts {
private val lineSep = util.Properties.lineSeparator
private def doUnlessWindows(op: => Unit) =
if (!System.getProperty("os.name").toLowerCase.contains("windows"))
Expand All @@ -28,11 +28,13 @@ class TestDotc {
}

try {
for (jar <- Source.fromFile(".packages").getLines())
for (jar <- Source.fromFile("./.packages").getLines())
delete(jar)

delete(".packages")
delete("src/dotty/tools/dotc/Dummy.scala")
delete("./.packages")
delete("./compiler/src/dotty/tools/dotc/Dummy.scala")
delete("./HelloWorld.class")
delete("./HelloWorld$.class")
} catch {
case _: FileNotFoundException => ()
}
Expand All @@ -45,15 +47,15 @@ class TestDotc {
* execute it using dotr
*/
@Test def buildAndRunHelloWorld = doUnlessWindows {
val (retDotc, dotcOutput) = executeScript("bin/dotc tests/pos/HelloWorld.scala")
val (retDotc, dotcOutput) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala")

// Check correct output of building and running dotc
assert(
retDotc == 0,
s"bin/dotc script did not run properly. Output:$lineSep$dotcOutput"
)

val (retDotr, dotrOutput) = executeScript("bin/dotr HelloWorld")
val (retDotr, dotrOutput) = executeScript("./bin/dotr HelloWorld")
assert(
retDotr == 0 && dotrOutput == "hello world",
s"Running hello world exited with status: $retDotr and output: $dotrOutput"
Expand All @@ -64,24 +66,24 @@ class TestDotc {
* rebuild dotty if needed
*/
@Test def rebuildIfNecessary = doUnlessWindows {
val (retFirstBuild, _) = executeScript("bin/dotc tests/pos/HelloWorld.scala")
assert(retFirstBuild == 0, "building dotc failed")
val (retFirstBuild, out1) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala")
assert(retFirstBuild == 0, s"building dotc failed: $out1")

// Create a new file
new JFile("src/dotty/tools/dotc/Dummy.scala").createNewFile()
// Create a new file to force rebuild
new JFile("./compiler/src/dotty/tools/dotc/Dummy.scala").createNewFile()

val (retSecondBuild, output) = executeScript("bin/dotc tests/pos/HelloWorld.scala")
val (retSecondBuild, output) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala")
assert(
retSecondBuild == 0 && output.contains("rebuilding"),
s"Rebuilding the tool should result in jar files being rebuilt. Status: $retSecondBuild, output:$lineSep$output")
}

/** if no changes to dotty, dotc script should be fast */
@Test def beFastOnNoChanges = doUnlessWindows {
val (retFirstBuild, _) = executeScript("bin/dotc tests/pos/HelloWorld.scala")
val (retFirstBuild, _) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala")
assert(retFirstBuild == 0, "building dotc failed")

val (ret, output) = executeScript("bin/dotc tests/pos/HelloWorld.scala")
val (ret, output) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala")
assert(
ret == 0 && !output.contains("rebuilding"),
s"Project recompiled when it didn't need to be. Status $ret, output:$lineSep$output")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import core.DenotTransformers.DenotTransformer
import core.Denotations.SingleDenotation

import dotty.tools.backend.jvm.{LabelDefs, GenBCode, CollectSuperCalls}
import dotty.tools.backend.sjs.GenSJSIR

/** The central class of the dotc compiler. The job of a compiler is to create
* runs, which process given `phases` in a given `rootContext`.
Expand Down Expand Up @@ -98,7 +97,6 @@ class Compiler {
new DropInlined, // Drop Inlined nodes, since backend has no use for them
new MoveStatics, // Move static methods to companion classes
new LabelDefs), // Converts calls to labels to jumps
List(new GenSJSIR), // Generate .js code
List(new GenBCode) // Generate JVM bytecode
)

Expand All @@ -117,20 +115,7 @@ class Compiler {
*/
def rootContext(implicit ctx: Context): Context = {
ctx.initialize()(ctx)
val actualPhases = if (ctx.settings.scalajs.value) {
// Remove phases that Scala.js does not want
phases.mapConserve(_.filter {
case _: FunctionalInterfaces => false
case _ => true
}).filter(_.nonEmpty)
} else {
// Remove Scala.js-related phases
phases.mapConserve(_.filter {
case _: GenSJSIR => false
case _ => true
}).filter(_.nonEmpty)
}
ctx.setPhasePlan(actualPhases)
ctx.setPhasePlan(phases)
val rootScope = new MutableScope
val bootstrap = ctx.fresh
.setPeriod(Period(nextRunId, FirstPhaseId))
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ object desugar {
DefDef(
name = meth.name.defaultGetterName(n),
tparams = meth.tparams.map(tparam => dropContextBound(toDefParam(tparam))),
vparamss = takeUpTo(normalizedVparamss, n),
vparamss = takeUpTo(normalizedVparamss.nestedMap(toDefParam), n),
tpt = TypeTree(),
rhs = vparam.rhs
).withMods(Modifiers(mods.flags & AccessFlags, mods.privateWithin))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
case tree: Select if qualifier.tpe eq tree.qualifier.tpe =>
tree1.withTypeUnchecked(tree.tpe)
case _ => tree.tpe match {
case tpe: NamedType => tree1.withType(tpe.derivedSelect(qualifier.tpe))
case tpe: NamedType => tree1.withType(tpe.derivedSelect(qualifier.tpe.widenIfUnstable))
case _ => tree1.withTypeUnchecked(tree.tpe)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class JavaPlatform extends Platform {
def classPath(implicit ctx: Context): ClassPath = {
if (currentClassPath.isEmpty)
currentClassPath = Some(new PathResolver().result)
currentClassPath.get
val cp = currentClassPath.get
//println(cp)
cp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something cleanup here?

}

// The given symbol is a method with the right name and signature to be a runnable java program.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ object PathResolver {
// security exceptions.
import AccessControl._

def firstNonEmpty(xs: String*) = xs find (_ != "") getOrElse ""
def firstNonEmpty(xs: String*) = xs find (_ != "") getOrElse ""

/** Map all classpath elements to absolute paths and reconstruct the classpath.
*/
Expand All @@ -47,6 +47,7 @@ object PathResolver {
def sourcePathEnv = envOrElse("SOURCEPATH", "")

def javaBootClassPath = propOrElse("sun.boot.class.path", searchForBootClasspath)

def javaExtDirs = propOrEmpty("java.ext.dirs")
def scalaHome = propOrEmpty("scala.home")
def scalaExtDirs = propOrEmpty("scala.ext.dirs")
Expand All @@ -55,20 +56,14 @@ object PathResolver {
def javaUserClassPath = propOrElse("java.class.path", "")
def useJavaClassPath = propOrFalse("scala.usejavacp")

override def toString = """
override def toString = s"""
|object Environment {
| scalaHome = %s (useJavaClassPath = %s)
| javaBootClassPath = <%d chars>
| javaExtDirs = %s
| javaUserClassPath = %s
| scalaExtDirs = %s
|}""".trim.stripMargin.format(
scalaHome, useJavaClassPath,
javaBootClassPath.length,
ppcp(javaExtDirs),
ppcp(javaUserClassPath),
ppcp(scalaExtDirs)
)
| scalaHome = $scalaHome (useJavaClassPath = $useJavaClassPath)
| javaBootClassPath = <${javaBootClassPath.length} chars>
| javaExtDirs = ${ppcp(javaExtDirs)}
| javaUserClassPath = ${ppcp(javaUserClassPath)}
| scalaExtDirs = ${ppcp(scalaExtDirs)}
|}""".trim.stripMargin
}

/** Default values based on those in Environment as interpreted according
Expand Down Expand Up @@ -194,7 +189,7 @@ class PathResolver(implicit ctx: Context) {
def javaUserClassPath = if (useJavaClassPath) Defaults.javaUserClassPath else ""
def scalaBootClassPath = cmdLineOrElse("bootclasspath", Defaults.scalaBootClassPath)
def scalaExtDirs = cmdLineOrElse("extdirs", Defaults.scalaExtDirs)
def priorityClassPath = cmdLineOrElse("prioritypath", "")
def priorityClassPath = cmdLineOrElse("priorityclasspath", "")
/** Scaladoc doesn't need any bootstrapping, otherwise will create errors such as:
* [scaladoc] ../scala-trunk/src/reflect/scala/reflect/macros/Reifiers.scala:89: error: object api is not a member of package reflect
* [scaladoc] case class ReificationException(val pos: reflect.api.PositionApi, val msg: String) extends Throwable(msg)
Expand All @@ -213,11 +208,11 @@ class PathResolver(implicit ctx: Context) {
* - Otherwise, if CLASSPATH is set, it is that
* - If neither of those, then "." is used.
*/
def userClassPath = (
def userClassPath = {
if (!settings.classpath.isDefault)
settings.classpath.value
else sys.env.getOrElse("CLASSPATH", ".")
)
}

import context._

Expand All @@ -243,7 +238,7 @@ class PathResolver(implicit ctx: Context) {
| javaBootClassPath = %s
| javaExtDirs = %s
| javaUserClassPath = %s
| useJavaClassPath = %s
| useJavaClassPath = %s
| scalaBootClassPath = %s
| scalaExtDirs = %s
| userClassPath = %s
Expand All @@ -260,7 +255,15 @@ class PathResolver(implicit ctx: Context) {
def containers = Calculated.containers

lazy val result: JavaClassPath = {
val cp = new JavaClassPath(containers.toIndexedSeq, context)
// Prioritize `dotty.jar` and `dotty-lib.jar` to shadow others
val (dottyJars, others) =
containers.partition(x => x.name.contains("dotty-lib.jar") || x.name.contains("dotty.jar"))
// Then any jars with `dotty` in the name - putting them before scala-library
val (dottyCp, remaining) =
others.partition(_.name.contains("dotty-"))

val cp = new JavaClassPath((dottyJars ++ dottyCp ++ remaining).toIndexedSeq, context)

if (settings.Ylogcp.value) {
Console.println("Classpath built from " + settings.toConciseString(ctx.sstate))
Console.println("Defaults: " + PathResolver.Defaults)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ScalaSettings extends Settings.SettingGroup {
val usejavacp = BooleanSetting("-usejavacp", "Utilize the java.class.path in classpath resolution.")
val verbose = BooleanSetting("-verbose", "Output messages about what the compiler is doing.")
val version = BooleanSetting("-version", "Print product version and exit.")
val pageWidth = IntSetting("-pagewidth", "Set page width", 120)
val pageWidth = IntSetting("-pagewidth", "Set page width", 80)

val jvmargs = PrefixSetting("-J<flag>", "-J", "Pass <flag> directly to the runtime system.")
val defines = PrefixSetting("-Dproperty=value", "-D", "Pass -Dproperty=value directly to the runtime system.")
Expand Down
Loading