summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/settings/AbsScalaSettings.scala
Commit message (Collapse)AuthorAgeFilesLines
* Allow per-choice help in ChoiceSettingLukas Rytz2016-09-021-2/+2
|
* Require and target Java 8Jason Zaugg2015-05-261-0/+1
| | | | | | | | | | | | | | | - Require Java 8 in ant build - use -source 1.8 and -target 1.8 for javac - Default scalac's -target to `jvm-1.8`, ignore and deprecate attempts to use `jvm-1.{6.7}` - Remove fragile javap-app test. The feature itself is slated for removal. - Remove obsolete Java6 checkfile - Adapt DCE tests - Remove deprecated/redundant -target:jvm-1.6 from flags where the intent was to trigger generation of stack map frames. - Remove tests with -target:jvm-1.5 that tested without stack map frames - Ignore OpenJDK JVM warnings (via test/[files|scaladoc]/filters).
* Use Enumeration for MultiChoiceSettingSom Snytt2014-09-051-10/+14
| | | | | | | | | | | This is pretty easy, since a ValueSet is a BitSet. When the setting is updated, recompute the current set of values, which is cheap and succinct. Checking a flag is also easy and fast. Choices in MultiChoiceSettings may enable other choices.
* -Ystatistics accepts a list of phases, cleanups in MultiChoiceSettingLukas Rytz2014-09-021-1/+1
| | | | | MultiChoiceSetting and Xlint with its deprecated aliases is now a bit simpler, but there's still room for improvement, as noted in comments.
* SI-8736 Restore -language to former glorySom Snytt2014-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | MultiChoice allows -language to work like -Xlint. The bug as described was that the setting value was set instead of updated (++=) with additional flags. The unreported bug was that `_` no longer set all settings. The corrected behavior is that "contains" means "it was enabled, or _ was set and it was not disabled explicitly." That is the behavior of `-Xlint` but with a different mechanism, since each lint option is a Setting. A semantic difference is that -Xlint enables all the lint options, but -language does not enable all the language features. `scalac -X` does not explain this additional behavior of the `-Xlint` flag. Also worth noting that `scalac -feature -language unused.scala` failed in 2.11.1 but succeeds silently now.
* SI-8525 MultiChoice takes a helper functionSom Snytt2014-07-181-1/+1
| | | | | | Clean-up code review comments. MultiChoice takes a helper function for outputting help text.
* SI-8610 -Xlint is multichoice optionSom Snytt2014-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | Make -Xlint a "multichoice" option for purposes of option parsing. This allows turning on "lint with these warnings" instead of only "turn off these warnings but enable other lint warnings". ``` $ scalac -Xlint:warn-adapted-args linty.scala # lint plus a warning $ scalac -Xlint warn-adapted-args linty.scala # same $ scalac -Xlint linty.scala # same as now $ scalac -Xlint -- linty.scala # ok, not necessary $ scalac -Xlint _ -- linty.scala # another funky underscore ``` This would also enable Xlint options that are not standalone options, although that is not implemented in this commit. For example, `-Xlint:no-missing-interpolator` could be used to disable that warning. (There is no `-Xoption:flavor=off` syntax.) (`no-` switches would not be enabled by `_`.)
* SI-5905 Sanity check -language optionsSom Snytt2014-02-281-0/+2
| | | | | | | | | | The option names are hardcoded, but checked by a test. There are no hooks to verify options after the compiler is constructed. Introduced a `MultiChoiceSetting` required for the setting creation framework.
* SI-7681 Remove dead code in s.t.n.s.AbsScalaSettingsSimon Ochsenreither2013-07-201-7/+0
|
* Absolutized paths involving the scala package.Paul Phillips2013-05-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Confusing, now-it-happens now-it-doesn't mysteries lurk in the darkness. When scala packages are declared like this: package scala.collection.mutable Then paths relative to scala can easily be broken via the unlucky presence of an empty (or nonempty) directory. Example: // a.scala package scala.foo class Bar { new util.Random } % scalac ./a.scala % mkdir util % scalac ./a.scala ./a.scala:4: error: type Random is not a member of package util new util.Random ^ one error found There are two ways to play defense against this: - don't use relative paths; okay sometimes, less so others - don't "opt out" of the scala package This commit mostly pursues the latter, with occasional doses of the former. I created a scratch directory containing these empty directories: actors annotation ant api asm beans cmd collection compat concurrent control convert docutil dtd duration event factory forkjoin generic hashing immutable impl include internal io logging macros man1 matching math meta model mutable nsc parallel parsing partest persistent process pull ref reflect reify remote runtime scalap scheduler script swing sys text threadpool tools transform unchecked util xml I stopped when I could compile the main src directories even with all those empties on my classpath.
* Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013Heather Miller2012-11-021-1/+1
|
* update and normalize copyright noticeAdriaan Moors2012-08-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are the regexp replacements performed: Sxcala -> Scala Copyright (\d*) LAMP/EPFL -> Copyright $1-2012 LAMP/EPFL Copyright (\d*)-(\d*)(,?) LAMP/EPFL -> Copyright $1-2012 LAMP/EPFL Copyright (\d*)-(\d*) Scala Solutions and LAMP/EPFL -> Copyright $1-2012 Scala Solutions and LAMP/EPFL \(C\) (\d*)-(\d*) LAMP/EPFL -> (C) $1-2012 LAMP/EPFL Copyright \(c\) (\d*)-(\d*)(.*?)EPFL -> Copyright (c) $1-2012$3EPFL The last one was needed for two HTML-ified copyright notices. Here's the summarized diff: Created using ``` git diff -w | grep ^- | sort | uniq | mate git diff -w | grep ^+ | sort | uniq | mate ``` ``` - <div id="footer">Scala programming documentation. Copyright (c) 2003-2011 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div> - copyright.string=Copyright 2002-2011, LAMP/EPFL - <meta name="Copyright" content="(C) 2002-2011 LAMP/EPFL"/> - * Copyright 2002-2011 LAMP/EPFL - * Copyright 2004-2011 LAMP/EPFL - * Copyright 2005 LAMP/EPFL - * Copyright 2005-2011 LAMP/EPFL - * Copyright 2006-2011 LAMP/EPFL - * Copyright 2007 LAMP/EPFL - * Copyright 2007-2011 LAMP/EPFL - * Copyright 2009-2011 Scala Solutions and LAMP/EPFL - * Copyright 2009-2011 Scxala Solutions and LAMP/EPFL - * Copyright 2010-2011 LAMP/EPFL - * Copyright 2012 LAMP/EPFL -# Copyright 2002-2011, LAMP/EPFL -* Copyright 2005-2011 LAMP/EPFL -/* NSC -- new Scala compiler -- Copyright 2007-2011 LAMP/EPFL */ -rem # Copyright 2002-2011, LAMP/EPFL ``` ``` + <div id="footer">Scala programming documentation. Copyright (c) 2003-2012 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div> + copyright.string=Copyright 2002-2012 LAMP/EPFL + <meta name="Copyright" content="(C) 2002-2012 LAMP/EPFL"/> + * Copyright 2002-2012 LAMP/EPFL + * Copyright 2004-2012 LAMP/EPFL + * Copyright 2005-2012 LAMP/EPFL + * Copyright 2006-2012 LAMP/EPFL + * Copyright 2007-2012 LAMP/EPFL + * Copyright 2009-2012 Scala Solutions and LAMP/EPFL + * Copyright 2010-2012 LAMP/EPFL + * Copyright 2011-2012 LAMP/EPFL +# Copyright 2002-2012 LAMP/EPFL +* Copyright 2005-2012 LAMP/EPFL +/* NSC -- new Scala compiler -- Copyright 2007-2012 LAMP/EPFL */ +rem # Copyright 2002-2012 LAMP/EPFL ```
* Created infrastructure for testing icode + sett...Paul Phillips2011-08-221-1/+1
| | | | | | | | | | | | | | | | Created infrastructure for testing icode + settings/partest yak shaving. See enclosed test files/run/inline-ex-handlers.scala. To compare optimized and unoptimized icode after a given phase, all you need in a partest source file is this: import scala.tools.partest.IcodeTest object Test extends IcodeTest { override def printIcodeAfterPhase = "inlineExceptionHandlers" } Other things can be done, see IcodeTest.scala. Review by ureche.
* Wanting to deprecate -make, first I had to writ...Paul Phillips2011-03-301-9/+11
| | | | | | | | | | | | | | | Wanting to deprecate -make, first I had to write a way to deprecate -make. So there's that, now you can do val s = SomeSetting(...) withDeprecationMessage "don't use this" And it will do the usual deprecation things. And, deprecated -make. And couldn't resist fixing a bug in -make, it would crash if you gave it its own default option (i.e. -make:all.) Let's deprecate more! I also did further cleaning up of our help outputs. Do I smell a pulitzer in the making? No review.
* Accumulated work on fsc.Paul Phillips2011-03-181-2/+2
| | | | | | | | | | | | | | | | | | | | adds the following new options. -ipv4 Use IPv4 rather than IPv6 for the server socket absolute-cp Make -classpath elements absolute paths before sending to server max-idle -Set idle timeout in minutes for fsc (use 0 for no timeout) My question marks are what are the right defaults for the first two. Former behavior is to absolutize the classpath always and never prefer IPv4 sockets. I changed the default to not absolutize the classpath, with the option if you need it; I left the system default in place for the socket creation, but I have a feeling we should default to IPv4. My only hesitation is that the only way to request an IPv4 socket from java involves mutating a global system property. (Robustness FTW.) So for now, you have to give -ipv4. Closes #3626, #3785, #3788, #3789. Review by community.
* Changes to startup.Paul Phillips2011-02-221-0/+2
| | | | | | | | | | | | | | default. The -toolcp option now works. -D and -J options are passed as arguments to the runner program as well as to the underlying JVM, because they may be needed for such things as fsc talking to a server compiler. Added a new Settings type for -D and -J options. Deleted some dead settings code. There are dummy settings for -toolcp and -nobootcp so they can be seen in the help output, which needs a big cleanup. No review.
* Updated copyright notices to 2011Antonio Cunei2011-01-201-1/+1
|
* Imported sbt.Process into trunk, in the guise o...Paul Phillips2011-01-121-1/+1
| | | | | | | | | | | | | | | | | | | Imported sbt.Process into trunk, in the guise of package scala.sys.process. It is largely indistinguishable from the version in sbt, at least from the outside. Also, I renamed package system to sys. I wanted to do that from the beginning and the desire has only grown since then. Sometimes a short identifier is just critical to usability: with a function like error("") called from hundreds of places, the difference between system.error and sys.error is too big. sys.error and sys.exit have good vibes (at least as good as the vibes can be for functions which error and exit.) Note: this is just the first cut. I need to check this in to finish fixing partest. I will be going over it with a comb and writing documentation which will leave you enchanted, as well as removing other bits which are now redundant or inferior. No review.
* Tackling long standing issues with startup.Paul Phillips2010-12-071-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | anyone can offer any reason why it's not (long past) time to do this I can back the truck up. (But I will have a list of bourne shell scripts for you to write.) With this commit: 1) -J options are now passed to the underlying JVM, along with -D options which already were. scala -Dfoo=bar and scala -J-Dfoo=bar are identical (but -J can pass arbitrary arguments to the jvm: -J-verbose, -J-Xmx4G, etc.) 2) Eliminated DefinesSetting. It was ill-conceived because setting system properties must be done at JVM start to guarantee they will be seen where appropriate: by the time scala is involved it's too late. The starter script takes care of routing -D to the jvm, and no longer sends them along to scala as well. Since we have a new system package you can read any property in system.props, like this: % scala -Dp1="hi" -Dp2="bye" -e 'println(system.props filterKeys (_.length == 2))' Map(p2 -> bye, p1 -> hi) 3) After measuring that startup is a full second faster by putting the scala jars on the bootclasspath, I gave us a standard way to take advantage of this. It's not done by default, although we should seriously consider it (I'm familiar with the issues that have arisen in the past.) Reclaim your life, one startup second at a time. The flag is --usebootcp, as below: // Here's a way (in bash 4) to compare repl startup times each way while true ; do time pscala -i <(echo "system exit 0") ; done |& grep real while true ; do time pscala --usebootcp -i <(echo "system exit 0") ; done |& grep real Once again I find myself unable to nominate any plausible reviewer (if there were anyone interested in this stuff, they'd be doing it instead of me) so no review.
* Cleaned up and brought up to date the help text...Paul Phillips2010-12-051-4/+4
| | | | | | | | Cleaned up and brought up to date the help text for -X and -Y options. Made some enhancements to PhasesSetting, which are documented if you run scalac -X or -Y. (Try it!) Disabled some dead settings and renamed others to reflect their current purpose. No review.
* Mopping up after the deprecation of exit and er...Paul Phillips2010-12-051-1/+1
| | | | | | | | | | | | | | Mopping up after the deprecation of exit and error. It is decidedly non-trivial (at least for the IDE-impaired) to be completely sure of which error function was being called when there were about twenty with the same signature in trunk and they are being variously inherited, imported, shadowed, etc. So although I was careful, the possibility exists that something is now calling a different "error" function than before. Caveat programmer. (And let's all make it our policy not to name anything "error" or "exit" from here on out....) No review.
* More progress toward immutable Settings, and va...Paul Phillips2010-03-081-0/+40
More progress toward immutable Settings, and various cleanups encountered along the way. No review.