Commit Graph

58 Commits

Author SHA1 Message Date
Grzegorz Kossakowski 66a48b08c7 Handle compilation cancellation properly.
Incremental compiler didn't have any explicit logic to handle
cancelled compilation so it would go into inconsistent state.

Specifically, what would happen is that it would treat cancelled
compilation as a compilation that finished normally and try to
produce a new Analysis object out of partial information collected
in AnalysisCallback. The most obvious outcome would be that the
new Analysis would contain latest hashes for source files. The
next time incremental compiler was asked to recompile the same files
that it didn't recompile due to cancelled compilation it would think
they were already successfully compiled and would do nothing.

We fix that problem by following the same logic that handles compilation
errors, cleans up partial results (produced class files) and makes sure
that no Analysis is created out of broken state.

We do that by introducing a new exception `CompileCancelled`
and throwing it at the same spot as an exception signalizing compilation
errors is being thrown. We also modify `IncrementalCompile` to
catch that exception and gracefully return as there was no compilation
invoked.

NOTE: In case there were compilation errors reported _before_
compilation cancellations was requested we'll still report them
using an old mechanism so partial errors are not lost in case
of cancelled compilation.
2013-07-19 14:39:26 -07:00
Mark Harrah a1b793dc1e Merge ExtendedReporter into Reporter. 2013-05-27 19:12:39 -04:00
Mark Harrah bbd01021b2 fix compilation error in TestCallback 2013-04-27 16:28:45 -04:00
Mark Harrah 5f53b89509 Record and persist public inheritance dependencies.
Includes placeholders for adding public inherited dependencies for Java classes.
2013-04-26 22:35:27 -04:00
Mark Harrah 283ebc0dcb Export approximate command lines executed for 'doc', 'compile', and 'console' 2013-02-28 17:59:38 -05:00
Mark Harrah 0280216e02 Replace Scala jars in UpdateReport with ScalaProvider jars in more situations. Fixes #661.
Specifically, when the Scala version for sbt is the same as that for the project being built,
the jars in UpdateReport should be the same as those in ScalaProvider.  This is because the
loader will come from the ScalaProvider, which uses jars in the boot directory instead of the
cache.  The first part of the fix for #661 checks that loaded classes come from the classpath
and so they need to line up.
2013-02-21 20:44:26 -05:00
Grzegorz Kossakowski 39428a996d Introduce incremental compiler options.
Introduce a way to configure incremental compiler itself instead
of underlying Java/Scala compiler.

Specific list of changes in this commit:
  * Add a method to `xsbti.compile.Setup` that returns incremental
    compiler options as a `java.util.Map<String, String>`. We considered
    statis interface instead of a `Map` but based on mailing
    list feedback we decided that it's not the best way to go because
    static interface is hard to evolve it by adding new options.
  * Since passing `java.util.Map<String, String>` not very convenient
    we convert it immediately to `sbt.inc.IncOptions`
  * Add options argument to various methods/classes that implement
    incremental compilation so in the end options reach
    `sbt.inc.IncOptions` object
  * Add `incOptions` task that allows users to configure incremental
    compiler options in their build files. Default implementation of
    that tasks returns just `IncOptions.DEFAULT`
  * Both system property `xsbt.inc.debug` and `IncOptions.relationsDebug`
    trigger debugging of relations now. In the near future, we should
    deprecate use of `xsbt.inc.debug`.
2013-02-19 12:23:07 -05:00
Grzegorz Kossakowski 7c5d4c1692 Strip down trailing whitespace.
I have Eclipse configured to do that automatically when saving file.
I decided to finally commit those changes to files I touch a lot.
2013-02-19 12:18:26 -05:00
Paolo G. Giarrusso dd007f9442 Silence boring Eclipse warnings: unused imports 2013-01-22 09:05:15 -05:00
Mark Harrah aee2742932 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
Eugene Vigdorchik 2e8fdbdf05 Extend reporter to be used by the IDE. 2012-07-24 15:35:06 -04:00
Eugene Vigdorchik d0c1b536e8 Add xsbti.Reporter to required inputs instead of maxErrors. 2012-07-13 14:33:26 -04:00
Eugene Vigdorchik 550599bea0 Changes required to use sbt as-is from Scala-IDE. 2012-07-13 14:33:26 -04:00
Mark Harrah 4c1a979d8a 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 f3e49dcbfe cleanup compilation tests 2012-05-12 23:12:29 -04:00
Mark Harrah 25159137d7 approximate type parameters and references by name
not as accurate, but simpler.
2012-05-12 23:12:29 -04:00
Mark Harrah 05fb991488 move to revised warning interface in the compiler 2012-05-06 14:15:03 -04:00
Mark Harrah c6c6061639 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 acc03cb293 implement embedded interface 2012-04-18 16:01:45 -04:00
Mark Harrah 5d4b89c965 using some of the embedding interfaces 2012-04-18 11:02:52 -04:00
Mark Harrah 8fcc056223 API for embedding incremental compilation 2012-04-18 08:19:33 -04:00
Mark Harrah d4f8a615dd reorganize compilation modules 2012-04-18 08:08:25 -04:00
Mark Harrah 474cd75d06 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 27970799c8 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 d4c7544f9c API for embedding incremental compilation 2012-01-09 08:00:35 -05:00
Mark Harrah f0fe396b3a preserve API information needed for detecting annotations on defs. fixes #232 2011-10-19 22:23:47 -04:00
Mark Harrah 6b136f1c17 store hashes of API instead of full API. fixes #21 2011-10-05 18:09:27 -04:00
Mark Harrah 2c3fc0abd6 support incremental recompilation when using exportJars. fixes #108 2011-07-18 17:14:22 -04:00
Mark Harrah a152f157f5 implement shortcut for API equality checking, fixes #18 2011-06-01 02:19:46 -04:00
Mark Harrah 9904c165be an annotation can reference a non-simple type, fixes #24 2011-05-23 18:40:03 -04:00
Mark Harrah a9ee49ee1e starting to convert integration tests 2011-02-22 22:36:48 -05:00
Mark Harrah e6dcca1b42 handle constant types 2011-02-14 18:59:54 -05:00
Mark Harrah 9fcd42db32 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 d85f438035 make serializable abstract Lazy template 2010-10-30 11:56:40 -04:00
Mark Harrah 6402a766b5 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 7dca038bde 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 0425532275 fix tests, discovery
updated compile tests for new minimal AnalysisCallback
moved discovery to discovery/ subproject and updated for new approach
fixed discovery to only find public methods when searching for annotated definitions
extracting inherited definitions unimplemented in api/, so some discovery tests fail
moved discovery classes from sbt.inc package to sbt.compile
2010-10-06 08:24:13 -04:00
Mark Harrah 1f9c13e721 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 0b77a070dd merge Pkg into Private
this better represents the original source
2010-09-17 21:29:29 -04:00
Mark Harrah 64b19286ee more reorganization, mostly IO. Also, move class file analyzer and history code to separate projects 2010-06-13 22:59:29 -04:00
Mark Harrah 83fa048026 annotation detection test 2010-03-28 20:20:17 -04:00
Mark Harrah 4604682a1d Support for tests written in Java and annotation-based test frameworks 2010-03-28 00:05:40 -04:00
Mark Harrah dc7b7d5363 work on source api parts 2010-01-22 20:17:49 -05:00
Mark Harrah 2c083af736 Polymorphic types and fix parameterized type arguments to be Type and not just SimpleType 2010-01-07 21:38:39 -05:00
Mark Harrah c864dd90cc * 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 4bd6f9627b Fix tests 2009-11-29 22:12:36 -05:00
Mark Harrah d9ba74b24e Annotations on definintions and implicit parameters in 2.7 2009-11-24 23:01:05 -05:00
Mark Harrah fd2c309f9d Type member support, linearization instead of parents and add inherited members for structure 2009-11-22 22:54:17 -05:00
Mark Harrah d568fcef6f Reorder API definition file 2009-11-21 16:14:09 -05:00
Mark Harrah ec85abb0b9 Source API extractor 2009-11-21 15:53:04 -05:00