Commit Graph

910 Commits

Author SHA1 Message Date
Grzegorz Kossakowski 70036812ab 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 4fe0c02536 Break long argument list into multiple lines.
Some methods take a lot of arguments and I'm about to add one more
which will make them too long for easy reading.

This change is changes code formatting only. That's done on purpose
to make it easier to review other changes.
2013-02-19 12:18:26 -05:00
Grzegorz Kossakowski d6f4c5ae4f 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
Mark Harrah 9ab1b98d2a Use @compileTimeOnly for .value and .parsed methods.
Needed to set position on wrapper method for correct error message position.
2013-02-19 08:54:40 -05:00
Mark Harrah ae74fff88c When serially executing tests*, order tests by testOnly filter order
* parallelExecution in test := false

cc @bantonsson
2013-02-13 10:27:43 -05:00
Mark Harrah 4b61747dfc remove deprecated scaladocOptions 2013-02-13 08:12:51 -05:00
Mark Harrah 76e0a941ba Update to 2.10.1-RC1
Needed an explicit type in PMap to workaround an error.
Need to drop tuple assignment of parser.parsed in input task macro as a workaround
  for macro/resetAllAttrs/pattern matching/annotation issue in RC1.
2013-02-13 07:17:20 -05:00
Mark Harrah c0b1bb51e6 -Xlint 2013-02-04 17:30:31 -05:00
Mark Harrah 8cb7e23011 Load global plugins in their own class loader and replace the base loader with that. Fixes #272.
Also, replace the base classpath with the global classpath.
2013-02-01 13:10:27 -05:00
Mark Harrah 52954b3ae7 skip duplicate entries in PluginClassLoader 2013-02-01 13:10:26 -05:00
Mark Harrah b2eb4661df Support 'reload plugins' after ignoring a failure to load a project.
This can be used to debug problems with dependencies or code.
It won't help with .sbt files, however.
2013-01-29 17:47:29 -05:00
Mark Harrah 6c5cafb55b Remove support for deprecated alternative to project/ directory name. 2013-01-29 17:47:29 -05:00
Eugene Yokota 125727ba83 support binary version in launcher 2013-01-29 16:55:13 -05:00
Mark Harrah e47b8ab578 Make 'eval' command work when project isn't loaded. 2013-01-29 08:47:04 -05:00
Mark Harrah a57407375e Implement InputTask.~= to operate directly on the result type T instead of an InputTask[T]. 2013-01-28 18:01:35 -05:00
Mark Harrah 8d11d1087a Mark the tests failed exception as having already provided feedback 2013-01-28 17:14:53 -05:00
Mark Harrah 76a02c463f Temporarily use a Scala home with '++ /path/to/scala/home' 2013-01-28 17:14:53 -05:00
Mark Harrah 13ea342b7a use standard Context.weakTypeOf 2013-01-28 17:14:53 -05:00
Mark Harrah 076480b50a Reduce InputTask to the ideal wrapper around 'State => Parser[Initialize[Task[T]]]'
Ref #407.
2013-01-28 17:14:53 -05:00
Paolo G. Giarrusso 236143be8d Silence boring Eclipse warnings: catching all exceptions
Here I make explicit where catching all exceptions is intended.
Mark Harrah corrected one decision during review.
2013-01-22 09:05:15 -05:00
Paolo G. Giarrusso 19aaaea923 Fix compile error in Eclipse
Let's consider compile/inc/src/main/scala/sbt/CompileSetup.scala.
There are multiple Output types, and according to Eclipse importing
xsbti.compile.Output within the package sbt does not work because the
import is shadowed by sbt.Output.

However, compilation proceeds just fine within SBT. Reproducing the
example however gives the same warning, if the files are in the same
project. The problem here is probably that the shadowing Output
is declared in the same package but in another project, and that seems
to give different results in Eclipse and SBT, but relying on
that looks fragile.
Reading the spec is inconclusive since it doesn't match with Scalac's
behavior — see
https://groups.google.com/d/topic/scala-internals/-Rquc2HBYLk/discussion .

ForkTests has the same behavior as CompileSetup.
2013-01-22 09:05:15 -05:00
Mark Harrah 9013e00fdd Remove InputStatic and parsedResult.
This cleans up the InputTask implementation.  It no longer requires the hook
in setting loading (Load.finalTransforms) and has better types.
2013-01-18 18:49:26 -05:00
Mark Harrah a9ac6b3983 Configurable conflict manager and corresponding documentation on conflictManager, dependencyOverrides, and force(). Fixes #603. 2013-01-11 16:01:31 -05:00
Mark Harrah a48ee68d17 Additional convenience methods on Project for configuring the .sbt files processed.
The Project.setSbtFiles and addSbtFiles methods combined with the current sbt version
available from ComponentMangaer.version (suggestions for a better location are welcome),
should make it straightforward to load different .sbt files based on the sbt version.

Fixes #467.
2013-01-11 16:01:30 -05:00
Mark Harrah 36a3203226 API documentation for Project getters 2013-01-11 16:01:30 -05:00
Mark Harrah a152965933 Option to automatically manage API documentation mappings
Set autoAPIMappings := true to enable.

Then, set apiURL to the base URL of the API documentation for a project.
This will get stored in an extra attribute in the ivy.xml or as a property
a pom.xml.

When using managed dependencies that have set their apiURL, the -doc-external-doc
setting for scaladoc will be automatically configured.  Note that this option
will only be available in Scala 2.10.1 and so enabling autoAPIMappings for
earlier versions will result in an error from scaladoc.

For unmanaged dependencies or dependencies without an automatic apiURL, add the
(File,URL) mapping to apiMappings.  The File is the classpath entry and the URL
is the location of the API documentation.
2013-01-10 16:06:12 -05:00
Mark Harrah e5a9d31d6f Make exclude-classifiers per-user instead of per-build. Fixes #634. 2013-01-10 16:06:12 -05:00
Mark Harrah aff95baf0e Provide cacheDirectory via Streams instead of a separate setting
This is cleaner and makes it harder for the task author to have overlapping caches.
2013-01-10 16:06:12 -05:00
Mark Harrah 1ef258d88e Convenience method Project.configure(f,g) for g(f(proj)) to be used to apply plugin configuration provided as a Project=>Project transformation 2013-01-10 16:06:12 -05:00
Mark Harrah ae9b6d1e47 Support 'val p = project' via a 'project' macro 2013-01-10 16:06:12 -05:00
Mark Harrah aefad9c033 when looking for the enclosing val definition in definingValName, allow the macro to be in an expression 2013-01-10 16:06:12 -05:00
Mark Harrah a8b93dfed3 Project.in(File) for setting the base directory of a Project 2013-01-10 16:06:11 -05:00
Mark Harrah 87faa7191a API documentation for Project transforming methods 2013-01-10 16:06:11 -05:00
Mark Harrah f0a72e53e8 use proper separator in command tab completion 2013-01-03 11:37:40 -05:00
Mark Harrah aba717c0c5 cleanup imports in BuildStructure 2013-01-03 11:37:40 -05:00
Mark Harrah ea3e5c3548 Allow cleanKeepFiles to contain directories
The directory contents will be kept as will empty directories.
2012-12-19 10:17:56 -05:00
Mark Harrah 329b42453b move Eval test to correct location 2012-12-19 10:17:56 -05:00
Mark Harrah f6317a5c75 remove deprecated Extracted.evalTask 2012-12-19 10:17:56 -05:00
Mark Harrah dd66d8b17a API documentation in Extracted 2012-12-19 10:17:56 -05:00
Mark Harrah d156ccfe4e Further refinements to Scala version handling
- override location of resolved Scala jars when scalaInstance is unmanaged
- document current behavior: scalaHome, update, scalaInstance, autoScalaLibrary, managedScalaInstance
2012-12-16 18:56:22 -05:00
Mark Harrah 71f12fbcdb 2.9 compatibility for incremental compilation modules 2012-12-11 14:41:22 -05:00
Mark Harrah f388b07632 fix inputTask construction method and put sbt package object in proper directory 2012-12-09 20:40:41 -05:00
Mark Harrah e3745540c9 More cleanup of Scala version handling, including managedScalaInstance to control automatic 'scala-tool' configuration and dependencies. 2012-12-09 20:40:41 -05:00
Mark Harrah 912948f5c8 update 'apply' help string to include -cp option 2012-12-09 20:40:41 -05:00
Mark Harrah d4fd136192 support defining Projects in .sbt files
vals of type Project are added to the Build
2012-12-09 20:40:41 -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
Mark Harrah f55c8ca15e Tab completion of right side of setting in 'set' command no longer necessary with the new task syntax. 2012-12-06 19:11:07 -05:00
Mark Harrah 769ecbace5 add scala-tool configuration and dependencies when configuring via pom.xml/ivy.xml 2012-12-06 07:25:41 -05:00
Mark Harrah 8f25b07d71 -cp/-classpath option to 'apply' command 2012-12-04 21:08:39 -05:00
Mark Harrah 005b2b356f fix IO tests, which needed scala-compiler.jar on the classpath 2012-12-04 13:20:03 -05:00