Commit Graph

174 Commits

Author SHA1 Message Date
Grzegorz Kossakowski fbe4dedd11 Remove trailing whitespace in API.scala 2013-04-27 00:31:31 +02:00
Mark Harrah bef8ce05b9 Properly track 'abstract override' modifier. Ref #726. 2013-04-15 14:12:15 -04:00
Mark Harrah 6def08e029 remove resident compiler code
The infrastructure for resident compilation still exists,
but the actual scalac-side code that was backported is removed.
Future work on using a resident scalac will use that invalidation
code directly from scalac anyway.
2013-04-09 20:13:06 -04:00
Mark Harrah 008c2928b6 note that mixing RangePositions into Global isn't necessary in 2.11 2013-03-13 12:40:03 -04:00
Mark Harrah f2d29d8678 Export approximate command lines executed for 'doc', 'compile', and 'console' 2013-02-28 17:59:38 -05:00
Jason Zaugg c597b48eda Stop using Predef.error
We'd like to remove this from 2.11.0.

This patch should be backported to 0.12.3.
2013-01-28 22:29:48 +01:00
Mark Harrah 070a87dda4 Call non-deprecated isRawType instead of isRaw 2013-01-16 10:26:32 -05:00
Grzegorz Kossakowski 4c1c31e190 Fix for dependency on class file corresponding to a package. (#620)
While trying to determine binary dependencies sbt lookups class files
corresponding to symbols. It tried to do that for packages and most of the
time would fail because packages don't have corresponding class file
generated. However, in case of case insensitive file system, combined
with special nesting structure you could get spurious dependency.
See added test case for an example of such structure.

The remedy is to never even try to locate class files corresponding to
packages.

Fixes #620.
2012-12-10 13:53:52 -05:00
Grzegorz Kossakowski ef39aeb9c1 Follow source layout convention supported by Eclipse.
Moved source files so directory structure follow package
structure. That makes it possible to use Scala Eclipse plugin
with sbt's source code.
2012-12-07 10:27:08 -08:00
Adriaan Moors f7be122eb4 Run apiExtractor after pickler (configurable)
Extract the api after picklers, since that way we see the same symbol
information/structure irrespective of whether we were typechecking
from source / unpickling previously compiled classes.

Previously, the apiExtractor phase ran after typer.

Since this fix is hard to verify with a test (it's based on the
conceptual argument above, and anecdotal evidence of incremental
compilation of a big codebase), we're providing a way to restore the
old behaviour: run sbt with -Dsbt.api.phase=typer.

This fixes #609.
2012-12-06 19:35:51 -05:00
Adriaan Moors cb0e723923 Fix #610: represent refinement typerefs stably
goal:

a representation of a type reference to a refinement class that's stable
across compilation runs (and thus insensitive to typing from source or
unpickling from bytecode)

problem:

the current representation, which corresponds to the owner chain of the
refinement:

  1. is affected by pickling, so typing from source or using unpickled
  symbols give different results (because the unpickler "localizes"
  owners -- this could be fixed in the compiler in the long term)

  2. can't distinguish multiple refinements in the same owner (this is
  a limitation of SBT's internal representation and cannot be fixed in
  the compiler)

solution:

expand the reference to the corresponding refinement type: doing that
recursively may not terminate, but we can deal with that by
approximating recursive references (all we care about is being sound for
recompilation: recompile iff a dependency changes, and this will happen
as long as we have one unrolling of the reference to the refinement)
2012-12-06 19:11:12 -05:00
Lex Spoon b7250bb528 Fix -Yrangepos. Unlike other settings, it requires that a mixin be added to Global. 2012-12-03 20:34:11 -05:00
Mark Harrah d6072275aa replace Symbol.nameString calls with simpleName(Symbol). Fixes #577.
nameString is only for printing and has different behavior when scalac is
given -uniqid.
2012-10-15 12:42:27 -04:00
Mark Harrah 18a03f0e25 API extraction: handle any type that is annotated, not just the spec'd simple type. Fixes #559. 2012-10-05 09:06:35 -04:00
Mark Harrah 42042a9d85 2.8.1 compatibility for compiler interface 2012-08-27 08:33:33 -04:00
Eugene Vigdorchik 1b814ae8b1 Extend reporter to be used by the IDE. 2012-07-24 15:35:06 -04:00
Eugene Vigdorchik b5a29987e6 Changes required to use sbt as-is from Scala-IDE. 2012-07-13 14:33:26 -04:00
Mark Harrah 0de4444665 sync resident compiler code 2012-06-18 08:18:39 -04:00
Mark Harrah f53d20a7a3 disable resident-compiler related code paths when it isn't being used. fixes #486.
The underlying issue with the resident compiler needs fixing, however.
2012-06-16 23:40:52 -04:00
Mark Harrah 919ac33c1a compiler interface compatibility hardening 2012-06-10 23:06:35 -04:00
Mark Harrah b7df87e2d8 compiler interface source compatibility with Scala 2.8.1/0 2012-06-02 19:03:57 -04:00
Mark Harrah 4bc993e0ba Revert "remove unneeded unlinking in compiler interface"
Unlinking is actually needed.

This reverts commit 1581d1b7e1.
2012-06-02 19:03:57 -04:00
Mark Harrah 1581d1b7e1 remove unneeded unlinking in compiler interface 2012-05-30 07:41:02 -04:00
Mark Harrah 2db0101eb8 resident compiler that passes all tests
core logic from odersky/scala/topic/inkling
2012-05-30 07:13:15 -04:00
Mark Harrah 63895a3d77 source compatibility with 2.8.1, where resident mode can't be supported 2012-05-19 18:20:20 -04:00
Mark Harrah 50ddd485af add a missing 'lazy' 2012-05-13 22:38:00 -04:00
Mark Harrah 208b46fd10 resident mode: package objects 2012-05-13 21:31:40 -04:00
Mark Harrah 864580aae1 approximate type parameters and references by name
not as accurate, but simpler.
2012-05-12 23:12:29 -04:00
Mark Harrah 00d0918714 workaround separate compilation and raw types 2012-05-12 23:12:29 -04:00
Mark Harrah 99a04466f1 move to revised warning interface in the compiler 2012-05-06 14:15:03 -04:00
Mark Harrah e537cbc474 second part of fix for excessive recompilations 2012-04-30 20:34:48 -04:00
Mark Harrah 5c8f212cf3 convert stray println to debug logging statement 2012-04-28 20:17:43 -04:00
Mark Harrah 408d11557d handle Java sources not compiled in Mixed configuration 2012-04-28 18:58:52 -04:00
Mark Harrah 6769c94208 basis for a resident compiler
unstable, but can be tested with -Dsbt.resident.limit=n
 n is the maximum Globals kept around
2012-04-28 18:58:52 -04:00
Mark Harrah 1cbb7ce93c print-warnings task for Scala 2.10+ to avoid needing to rerun 'compile' to see deprecation/unchecked warnings 2012-03-17 19:31:55 -04:00
Jason Zaugg a1cc62a598 Avoid copy-paste of Flags.MACRO with source-compatibility trickery. 2012-03-04 19:07:33 +01:00
Jason Zaugg 067917a0fb Macro def aware recompilation.
- Read macro modifier from method definition.
 - Always recompile downstream files after a file containing macro defs is recompiled.
 - Source is extended with a hasMacro attribute. Mark suggests that this might be better
   tracked in Relations, but I'm not sure how to make that change.
2012-03-04 17:35:51 +01:00
Mark Harrah d61ae7899f drop 2.7 compatibility in compiler reporter 2012-02-07 21:56:37 -05:00
Mark Harrah c17bf071d7 simpler compatibility fix works ok 2012-02-04 21:10:30 -05:00
Mark Harrah b5c4e5290e fix compiler interface to work with 2.10.0-SNAPSHOT 2012-01-19 11:00:24 -05:00
soc 8ec1b9a841 Fix messages like “class class ...”. 2012-01-04 16:20:22 +01:00
Mark Harrah cf450a963f drop more 2.7 compatibility code 2011-11-27 17:48:01 -05:00
Mark Harrah 6405f2a6cb cleanup 2.7 warn fatal setting compatibility 2011-11-04 18:39:25 -04:00
Mark Harrah 82ad44a701 preserve API information needed for detecting annotations on defs. fixes #232 2011-10-19 22:23:47 -04:00
Mark Harrah 1578341a10 add cleanupCommands setting to specify commands to run before interpreter exits. fixes #219 2011-10-16 17:27:36 -04:00
Mark Harrah 9d0cb47e0a force REPL startup to be synchronous. fixes #175. 2011-09-12 19:48:10 -04:00
Mark Harrah ff95799af7 drop 2.7 support, fix fatal warnings support. fixes #153 2011-08-17 21:50:46 -04:00
Mark Harrah 0b3ec05a81 support incremental recompilation when using exportJars. fixes #108 2011-07-18 17:14:22 -04:00
Mark Harrah bc5253e386 include retronym's compatibility patch, closes #5 2011-06-11 20:09:15 -04:00
Mark Harrah c0a21c1524 implement shortcut for API equality checking, fixes #18 2011-06-01 02:19:46 -04:00
Mark Harrah a94247d1b6 more release-worthy compile message and analysis toString 2011-05-29 19:17:31 -04:00
Mark Harrah e840d66622 Turn some errors in API into warnings+emptyType 2011-05-25 08:09:24 -04:00
Mark Harrah eef1fd8a10 fix #26 2011-05-25 07:57:14 -04:00
Mark Harrah 24dfb69400 an annotation can reference a non-simple type, fixes #24 2011-05-23 18:40:03 -04:00
Mark Harrah 9dec02ee51 fix analysis of Java sources being overwritten 2011-04-26 21:19:56 -04:00
Mark Harrah 801c0567fd handle information only options that disable a full compilation 2011-04-01 21:04:08 -04:00
Mark Harrah a79d06ab1f temporary fix for #4426 2011-04-01 21:03:44 -04:00
Mark Harrah d53d5fb7cf api extraction fixes for self types and expanded names 2011-03-11 16:57:15 -05:00
Mark Harrah 4f4ae170d3 work on plugins, added console-project, re-integrated more tests 2011-02-24 23:30:06 -05:00
Mark Harrah cc06667f3e handle constant types 2011-02-14 18:59:54 -05:00
Mark Harrah 2a4f7ac564 compiler interface: 2.9 compatibility
nme.LOCALCHILD -> tpename.LOCAL_CHILD
handle NullaryMethodType
2011-02-08 20:30:15 -05:00
Mark Harrah 04e16ee86c api extraction fixes
get members of nested modules by pulling from moduleClass
ignore classes ending with LOCALCHILD, which only appear with separate compilation
2010-11-09 20:49:23 -05:00
Mark Harrah 403fa42fa2 Type cache in API extraction for smaller cache size and faster I/O
manually implement Modifiers, use byte-size bit field
2010-10-30 17:46:56 -04:00
Mark Harrah a76d75bca6 more flexible scalac logging
the custom scalac Reporter now delegates to an instance of
  an sbt interface called xsbti.Reporter
handling compilation logging is now mainly done on the sbt-side of the
  compiler interface
the xsbti.Reporter interface provides access to richer information
  about errors and warnings, including source file, line, and offset
xsbti.Reporter can be implemented by users to get access to
  detailed information without needing to parse the logging output
the CompileFailed exception that is thrown when compilation fails now
  includes an array of the problems, providing detailed
  error and warning information that can, for example, be consumed
  by doing a mapFailure on 'compile' and using 'Compile.allProblems'
2010-10-23 16:34:22 -04:00
Mark Harrah 5ed8f3c042 improving incremental compilation
support lazy arguments in data type generator
SafeLazy implementation that explicitly clears the reference to the thunk
in API representation, drop synthetic modifier and merge deferred into abstract
handle cyclic structures in API generation, display, comparison, persistence
gzip compile cache file
bump to 2.8.1.RC3, project definition cleanup
fix main method detection to check for the right name
properly view inherited definitions
exclude constructors of ancestors
2010-10-22 21:55:16 -04:00
Mark Harrah 4164ad3529 fix detecting existence of default arguments 2010-09-27 18:48:12 -04:00
Mark Harrah ce9db82771 fixes to API extraction phase
reverse the mapping of vals/vars to
  private[this] fields and accessors
merge annotations from related members
don't handle bean getters/setters specially
  because they are indistinguishable from
  user-defined members as far as I can tell
2010-09-17 22:14:48 -04:00
Mark Harrah 0d5814e2b3 Rework external dependency tracking and multi-projects
Reduce AnalysisCallback interface:
  remove discovery
  simplify dependency notification methods
Use map of classpath entry to Analysis for locating
  source API for external dependencies
Handle classpath changes by locating class
  on classpath and either locating Analysis/Source
  as above or comparing Stamp.  This requires storing
  the class name of a binary dependency now.
Make this process aware of full classpath, including
  boot classpath
2010-09-17 21:59:43 -04:00
Mark Harrah 820a2b6851 remove discovery from Scala Analyzer phase 2010-09-17 21:38:03 -04:00
Mark Harrah ccf9714b4d fixes for API extraction phase
correct order of value parameters of a method
preserve source order of members
more information for unknown type error message
2010-09-17 21:30:47 -04:00
Mark Harrah 4db2c1df6a merge Pkg into Private
this better represents the original source
2010-09-17 21:29:29 -04:00
Mark Harrah 9bcd68d28c rework REPL support
allow bindings, which requires specifying the parent class loader
same code can be used for both 'console' and 'console-project' now
provide interface through main/Console
2010-09-04 08:18:06 -04:00
Mark Harrah d7b66458f2 first shot at general command/definition model 2010-07-17 12:07:41 -04:00
Mark Harrah d0fa1eb461 * move Environment classes to util/env module
* move TrapExit, SelectMainClass to run module
* rearrange some compilation-related code
* Jetty-related code moved to web module
2010-07-14 19:24:50 -04:00
Mark Harrah 6f3c699435 - Stuart's improvements to triggered execution
- continue splitting original sbt module
 * separated process, testing modules
 * various IO, logging, classpath migration
 * split out javac interface
2010-07-05 12:53:37 -04:00
Mark Harrah 37185c0fb6 discovery, persistence, frontend, and various fixes to incremental 2010-07-02 06:57:03 -04:00
Mark Harrah b2077ce60c more 2.8 updates, launcher compiles and runs with 2.8 2010-06-15 20:38:18 -04:00
Mark Harrah 33e957a47c support warn fatal options in 2.8.0.RC2 2010-05-13 18:31:37 -04:00
Mark Harrah a2f96255eb consoleOptions 2010-04-25 13:18:36 -04:00
Mark Harrah 77567b6ad3 Support for tests written in Java and annotation-based test frameworks 2010-03-28 00:05:40 -04:00
Mark Harrah 948aeb3f97 eliminate import warning 2010-03-26 16:15:52 -04:00
Mark Harrah 27816f32f6 Jason's patch to work with latest changes to CompilerCommand 2010-03-26 07:55:02 -04:00
Mark Harrah a438d389e2 compatibility with 2.8 trunk 2010-03-23 08:30:53 -04:00
Mark Harrah 7edcc68a92 support cross-compiling/bootstrapping 2010-03-22 20:42:59 -04:00
Mark Harrah 794d137051 Remove code no longer needed for running Scala code 2010-03-07 19:06:54 -05:00
Mark Harrah a33223a02c legal cleanup 2010-02-07 23:45:19 -05:00
Mark Harrah 743d4556ae Fix compiler interface to compile against 2.8 trunk 2010-02-05 18:58:52 -05:00
Mark Harrah 125e0adad8 Decrease compilation time of compiler interface by ~20% 2010-02-04 22:08:17 -05:00
Mark Harrah b6f017c508 Work with latest compiler changes. API is commented for stability in 0.7. 2010-02-04 21:04:22 -05:00
Mark Harrah a2758afd43 Fix main method detection involving Application 2010-01-30 21:40:25 -05:00
Mark Harrah e8eae7d7bb Look at names during flattenPhase.next to get proper class names 2010-01-26 09:10:42 -05:00
Mark Harrah af4f41e052 API: fix annotation handling 2010-01-24 00:11:43 -05:00
Mark Harrah af288bb199 API: base types with applied type parameters
Compile task: fix detection of classpath changes
Aggressive compiler seems to work on scalaz now
2010-01-23 11:52:39 -05:00
Mark Harrah 5f9f3729d1 work on source api parts 2010-01-22 20:17:49 -05:00
Mark Harrah 1673a2a3e2 Remove use of reflection for compatibility in Analyzer 2010-01-09 18:22:58 -05:00
Mark Harrah fb3cfd3b39 * Polymorphic type extraction
* Use simple names instead of full names where appropriate
 * Handle local classes, which have NoPrefix
2010-01-07 21:41:20 -05:00
Mark Harrah 6f6b795b39 * Basic API serialization
* Fixes to API extraction and equality checking
 * Reworked tracking
 * New compile infrastructure based on API changes
 * Example application for testing
2010-01-05 19:50:43 -05:00
Mark Harrah 8ebbb7b420 fix issue processing qualifiers in API phase 2009-12-31 18:55:35 -05:00
Mark Harrah bb0a3b3d2f Fix Scaladoc interface for 2.8.0.Beta1-RC4 and later. 2009-12-20 12:02:49 -05:00
Mark Harrah cbb0f1a0a8 Fix 2.8 external dependency tracking 2009-12-14 18:37:17 -05:00