Commit Graph

3667 Commits

Author SHA1 Message Date
Mark Harrah a3d89dc865 Infrastructure for debugging natures and plugins.
* Can provide suggestions for how to define a plugin given a context (a loaded Project in practice).
* When a user requests an undefined key at the command line, can indicate whether any (deactivated) plugins provide the key.

TODO:
* Hook up to the key parser
* Implement 'help <plugin>'
* Determine how to best provide the context (the current project is often an aggregating root, which is not typically a useful context)
2014-02-19 23:04:10 -05:00
Josh Suereth 9969973d09 Merge pull request #1126 from jozic/no-def-package
explicitly disapprove plugins using default package
2014-02-19 09:13:39 -05:00
Eugene Platonov 3389906b01 explicitly disapprove plugins using default package 2014-02-18 23:11:59 -05:00
Jason Zaugg fc189675a6 Merge pull request #1125 from gkossakowski/compile-setup-nameHashing
Make change to CompileSetup backwards compatible.
2014-02-18 12:52:47 +01:00
Grzegorz Kossakowski 19ca7a1edc Make change to CompileSetup backwards compatible.
The c7f435026f introduced a new parameter
to the constructor of `CompileSetup` but it turns out that this class
is being used in zinc. Introduce an overloaded variant of that constructor
that preserves backwards compatibility.
2014-02-18 12:18:07 +01:00
Josh Suereth ef907b8c1d Merge pull request #1122 from gkossakowski/compile-setup-nameHashing
Include value of `nameHashing` flag in `CompileSetup`.
2014-02-17 18:01:49 -05:00
Grzegorz Kossakowski c7f435026f Include value of `nameHashing` flag in `CompileSetup`.
The CompileSetup class is being used to detect changes to arguments of
incremental compiler that affect result of compilation and trigger
recompilation. Examples of such arguments include, the target (output)
directory, Scala compiler options, Scala compiler version, etc.

By adding `nameHashing` to CompileSetup we have a chance to handle change
to that flag smoothly by throwing away old Analysis object and starting
with an empty one. That's implemented in AggressiveComile by extending
the logic that was responsible for detection of changes to CompileSetup
values. Thanks to this change we fix #1081.

Analysis formats has been updated to support persisting of newly added
value in CompileSetup. We used to not store the value of `nameHashing`
flag in persisted Analysis file and infer it from contents of relations
but that leads to issue #1071 when empty relations are involved. Given
the fact that CompileSetup stores `nameHashing` value now, we can just
use it when reading relations and fix #1071. This requires reading/writing
compile setup before reading relations. I decided to make that change even
if there's a comment saying that reading/writing relations first was done
intentionally.
2014-02-17 17:00:19 +01:00
Jason Zaugg bd943b8e83 using compat._ to plug source compatibility breakages
This commit makes the code source compatible across Scala 2.10.3
and https://github.com/scala/scala/pull/3452, which is proposed
for inclusion in Scala 2.11.0-RC1.

We only strictly need the incremental compiler to build on Scala
2.11, as that is integrated into the IDE. But we gain valuable
insight into compiler regressions by building *all* of SBT with
2.11.

We only got there recently (the 0.13 branch of SBT now fully cross
compiles with 2.10.3 and 2.11.0-SNAPSHOT), and this aims to keep
things that way.

Once 2.10 support is dropped, SBT macros will be able to exploit
the new reflection APIs in 2.11 to avoid the need for casting
to compiler internals, which aren't governed by binary compatibility.
This has been prototyped by @xeno-by: https://github.com/sbt/sbt/pull/1121
2014-02-17 14:53:59 +01:00
Simeon H.K. Fitch 9f43d0660d Revised documentation based on feedback from @jsuereth 2014-02-12 15:37:49 -05:00
Simeon H.K. Fitch 7f6abbaf35 Added basic documentation for DefinableSetting, inferring behavior from implementation. 2014-02-12 12:31:15 -05:00
Jason Zaugg 9428bb3344 Merge pull request #1114 from gkossakowski/scala-2.11.0-M8
Remove work-arounds for Scala 2.11 problematic dependencies
2014-02-12 15:27:23 +01:00
Josh Suereth c26a7a6a49 Merge pull request #1111 from D-Roch/patch-1
Update Community-Plugins.rst
2014-02-12 08:23:49 -05:00
Grzegorz Kossakowski 4a9981720a Remove work-arounds for Scala 2.11 problematic dependencies
The ff0fd6eec6 introduced some exclusions
that were necessary for getting sbt to resolve dependencies properly
against Scala 2.11.0-M7.

Scala 2.11.0-M8 fixed its dependency structure so we can get rid of those
exclusions now.
2014-02-12 14:12:20 +01:00
Grzegorz Kossakowski 53331d9328 Merge pull request #1113 from retronym/ticket/si-8263
Scala 2.11 compatibility
2014-02-12 14:05:47 +01:00
Jason Zaugg 4e073373da SI-8263 Avoid SOE in Symbol#logicallyEnclosingMember under Scala 2.11
Since the fix for SI-2066, Scala 2.11 calls logicallyEnclosingMember on the
`x` in the expansion of the task macro:

    InitializeInstance.app[[T0[x]](T0[java.io.File], T0[java.io.File]), Seq[java.io.File]]

This exposed the fact that SBT has created `T0` with `NoSymbol` as
the owner. This led to the a SOE.

I will also change the compiler to be more tolerant of this, but we
can observe good discipline in the macro and pick a sensible owner.
2014-02-12 13:30:46 +01:00
Jason Zaugg 9b4564f0cd SI-8262 Fix compilation with 2.11 due to shadowing of Range
We now have `global.Range`, so our wildcard import of `global._`
shadows `scala.Range`.

This commit fully qualifies that type so as to be compatible with
Scala 2.10 and 2.11.
2014-02-12 13:11:28 +01:00
Roch Delsalle 05d96912d1 Update Community-Plugins.rst
sbt-scct fork / published on central with 0.13 compatibility
2014-02-12 11:02:53 +01:00
Josh Suereth e4375b3e58 Merge pull request #1108 from dansanduleac/dynamic-app-launch
Launcher to retrieve dynamic app versions correctly
2014-02-11 08:07:00 -05:00
Dan Sanduleac 6abac450ef Retrieve dynamic app versions correctly 2014-02-10 09:18:41 +00:00
Mark Harrah 49bf842b3d Restructure Natures/AutoPlugin types
- remove AutoPlugin.provides
 * name comes from module name
 * AutoPlugin is Nature-like via Basic
- Project.addNatures only accepts varags of Nature values
 * enforces that a user cannot explicitly enable an AutoPlugin
 * drops need for && and - combinators
- Project.excludeNatures accepts varags of AutoPlugin values
 * enforces that only AutoPlugins can be excluded
 * drops need for && and - combinators
2014-02-08 10:23:31 -05:00
Mark Harrah e037731d81 TODO 2014-02-08 10:23:31 -05:00
Mark Harrah eb7da2f689 move Nature-related classes to Natures.scala 2014-02-08 10:23:31 -05:00
Mark Harrah 0fc5f1525e Generate error when multiple AutoPlugins provide the same Nature. 2014-02-08 10:23:31 -05:00
Mark Harrah 708a3b107b minor API updates 2014-02-08 10:23:31 -05:00
Mark Harrah 4feb7d3dc8 Fix typos in AutoPlugin API docs. 2014-02-08 10:23:31 -05:00
Suzanne Hamilton 4ab8074753 Fix formatting of inline code samples which are pluralized 2014-02-06 08:49:44 -05:00
Josh Suereth 85753e4035 Merge pull request #1100 from dansanduleac/sessionSettings2
Fixed SessionSettings replacing existing setting
2014-02-02 04:24:49 -08:00
Dan Sanduleac 083eb38bd2 [scripted] Session update without reload 2014-02-02 08:50:47 +00:00
Josh Suereth b7c50d4269 Merge pull request #1089 from dansanduleac/overwritePublish
Expose overwrite flag in IvyActions.publish
2014-02-01 07:56:41 -08:00
Josh Suereth f8536ad9a5 Merge pull request #1097 from kalmanb/0.13
Add sbt-ctags community plugin information
2014-01-30 00:36:11 -08:00
Josh Suereth b313d2db19 Merge pull request #1099 from ngocdaothanh/0.13
Add link to plugin xitrum-package (collects dependency .jar files for standalone Scala programs)
2014-01-28 06:26:05 -08:00
Josh Suereth bfa507affd Merge pull request #1098 from xerial/sbt-sonatype
Add a link to sbt-sonatype plugin in Using-Sonatype page
2014-01-28 04:34:16 -08:00
Josh Suereth 555087bdf4 Merge pull request #1101 from retronym/ticket/1031
Avoid compiler crash for naked `key.value` calls.
2014-01-28 04:31:23 -08:00
Josh Suereth 7241428137 Merge pull request #1102 from gkossakowski/inc-error-handling
Improve error handling in incremental compiler
2014-01-28 02:16:43 -08:00
Jason Zaugg 264e49a912 Avoid compiler crash for naked `key.value` calls.
Untyped trees underneath typed trees makes Jack and sad boy.
And they make superaccessors a sad phase.

The recent refactoring to retain original types in the trees
representing the argument to the task macro meant that the `value`
macro also was changed to try to avoid this untyped-under-typed
problem. However, it didn't go deep enough, and left the child
trees of the placeholder tree `InputWrapper.wrap[T](key)` untyped.

This commit uses `c.typeCheck` to locally typeheck that tree fully
instead.

Fixes #1031
2014-01-28 10:45:15 +01:00
Grzegorz Kossakowski bb8dd21620 Record the name of an Analysis file in case of a read failure.
Catch ReadException and wrap it in IOException that carries the name
of the file we failed to read in its message.

We have to catch exception and wrap them because in TextAnalysisFormat
we don't have an access to the file name (it operates using an abstract
reader).
2014-01-27 19:48:13 +01:00
Grzegorz Kossakowski 668ae8d8b1 Fix typo in assertion message in TextAnalysisFormat
Add missing string interpolation indicator in assertion message.
2014-01-27 19:41:04 +01:00
Dan Sanduleac 8bfab5313e Fixed SessionSettings replacing existing setting 2014-01-27 14:55:08 +00:00
Ngoc Dao 02a7fd8c83 Add link to xitrum-package (collects dependency .jar files for standalone Scala programs) 2014-01-27 19:16:23 +09:00
Taro L. Saito 91650c7f71 Add a link to sbt-sonatype plugin in Using-Sonatype page 2014-01-26 00:12:16 +09:00
kalmanb 9af1585e8d Add sbt-ctags community plugin information 2014-01-25 22:21:49 +13:00
Mark Harrah 162d8094ba Convert logic system test cases into unit tests.
Still TODO for auto-plugins/logic:

 * property-based tests for logic system
 * user documentation
 * (optional) 'about plugins' or similar to show more information about the auto-plugins for a project
 * (deferred) allow AutoPlugin to inject Commands directly?
 * (deferred) provide AutoPlugin functionality to arbitrary scopes instead of just at the Project level?
2014-01-24 14:37:04 -05:00
Mark Harrah 9264099594 API docs, better terminology for negative cycle checking in logic system. 2014-01-24 14:36:46 -05:00
Mark Harrah 1afd1931c4 Translate errors from logic system to Natures system. 2014-01-24 14:36:46 -05:00
Mark Harrah 5add7306c2 Acyclic negation checking in logic system that backs auto-plugins. 2014-01-24 14:36:36 -05:00
Mark Harrah 359170b0f4 Test for automatic handling of AutoImport, AutoPlugin, and Build from binary plugins. 2014-01-24 14:36:36 -05:00
Mark Harrah 09c76f29a3 Discover all sbt-related modules (not just Plugin) and write names to resources for use from binaries. 2014-01-24 14:36:20 -05:00
Mark Harrah 7a38338509 logic system/auto-plugins: Provide deprecated methods for binary compatibility 2014-01-24 14:35:59 -05:00
Mark Harrah 30658f98bb API documentation and comments related to natures 2014-01-24 14:34:15 -05:00
Mark Harrah b8619f4aae Main part of integrating natures into project loading. 2014-01-24 14:34:15 -05:00