Commit Graph

2650 Commits

Author SHA1 Message Date
Mark Harrah 0e426223ec Merge api-diff into 0.13 2013-06-25 07:24:08 -04:00
Grzegorz Kossakowski 0d2dc75115 Make api diff context size valuable configurable.
Add `apiDiffContextSize` option to `IncOptions` which allows one
to control the size (in lines) of a context used when printing
diffs for textual API representation.

The default value for `apiDiffContextSize` is 5 which seems to be
enough for most situations. This is verified by many debugging
sessions I performed when using api diffing functionality.
2013-06-25 00:04:45 -07:00
Grzegorz Kossakowski 025eae9103 Log API diffs using ShowAPI and java-diff-utils library.
Implement displaying API changes by using textual representation
of an API (ShowAPI) and good, old textual diff algorithm. We are
using java-diff-utils library that is distributed under Apache 2.0
license.

Notice that we have only soft dependency on java-diff-utils. It means
that we'll try to lookup java-diff-utils class through reflection
and fail gracefully if none is found on the classpath. This way
sbt is not getting any new dependency. If user needs to debug
api diffs then it's matter of starting sbt with
`-Dsbt.extraClasspath=path/to/diffutils.jar` option passed
to sbt launcher.
2013-06-25 00:04:39 -07:00
Mark Harrah aeab5bfdaa fix duplicate launcher upload 2013-06-24 20:06:38 -04:00
Mark Harrah 4c515d3aa0 Docs: note about Scala version override being dropped 2013-06-24 18:42:15 -04:00
Grzegorz Kossakowski ad718587bb Configure additional classpath through `sbt.extraClasspath`
Modify the default launcher configuration for sbt so extra classpath
entries for sbt can be configured through `sbt.extraClasspath` system
property.
2013-06-24 15:04:57 -07:00
Grzegorz Kossakowski f426f8ba7f Allow an empty string as a default in variable substitution.
Lanucher configuration parser would previously require a default
value in variable substitution pattern to be non-empty string.
This is an unnecessary restriction as empty value is sometimes
useful as in this example:

  resources: ${sbt.extraClasspath-}

This commit lifts this restriction so empty default values are
allowed. The change has been discussed with @harrah.
2013-06-24 15:04:57 -07:00
Mark Harrah f7ac74ab05 deprecate xml process constructors, which are replaced by proper string interpolation in Scala 2.10 2013-06-24 17:48:44 -04:00
Mark Harrah 311e3dca5c Docs: not necessary to run 'proguard' explicitly anymore 2013-06-24 14:49:16 -04:00
Mark Harrah aef6df3e20 handle undefined target directory in unique target check 2013-06-23 19:57:31 -04:00
Mark Harrah 3758357677 scripted test fixes 2013-06-23 19:57:31 -04:00
Mark Harrah 602c1759a1 Make ExecuteProgress listener configurable via executeProgress setting.
Experimental, so everything is private[sbt].
2013-06-23 19:57:30 -04:00
Mark Harrah 1cc2f57e15 Experimental task progress interface. Fixes #592.
Set sbt.task.timings=true to print timings for tasks.
This sample progress handler shows how to get names for tasks and
deal with flatMapped tasks.  There are still some tasks that make
it through as anonymous, which needs to be investigated.

A setting to provide a custom handler should come in a subsequent commit.
2013-06-23 19:57:30 -04:00
Mark Harrah ce1c8b0ebc Better auto project ID handling. Ref #776.
* Consolidate project ID validation and normalization into Project methods
* Provide an earlier and more detailed error message when the directory
  name can't be used for the project ID
2013-06-23 19:57:30 -04:00
Mark Harrah 6f0028e50d Use last path component of a URI in the staged path. 2013-06-23 19:57:30 -04:00
Mark Harrah 1a3ea6fb8b JLine 2.0 loads the -Djline.terminal=<class> option from the context loader, so set that in the launcher 2013-06-20 16:55:42 -04:00
Mark Harrah 26a0692fd3 build with 0.12.4-RC3 2013-06-20 16:55:17 -04:00
Mark Harrah 39f6456a81 source compatibility of ClasspathUtilities.isArchive for sbt-assembly
default parameters and eta-expansion don't interact well
2013-06-20 16:37:14 -04:00
Mark Harrah a3defe2556 update to Scala 2.10.2 final 2013-06-20 15:44:29 -04:00
Mark Harrah 5c653099b9 Update instructions for building from source 2013-06-20 15:44:29 -04:00
Mark Harrah 280e1b6d60 Build cleanup, publish launcher normally, pull it normally in scripted plugin
Still want to deploy the launcher to the previous path for compatibility with
existing scripts so that the transition to 0.13 is not impeded.
2013-06-20 15:44:29 -04:00
Mark Harrah f5febfae0e Docs: note fix for class loader cache 2013-06-20 14:28:05 -04:00
Mark Harrah 5dc671c7f8 Synchronize ClassLoaderCache and the Scala provider cache.
Construction of Scala providers was already properly synchronized jvm and machine-wide.
The cache on top of construction was not and neither was the newer ClassLoaderCache.
This could cause the same Scala version to be loaded in multiple class loaders, taking
up more permgen space and possibly decreasing performance due to less effective jit.

The issue is very rare in practice for 0.13 because of the low probability of contention
on ClassLoaderCache.  This is because the work for a cache miss is mainly the construction
of a URLClassLoader.  In 0.12, however, the work potentially involved network access and
class loading (not just class loader construction), thus greatly increasing the probability
of contention and thus duplicate work (i.e. class loader construction).

When there is contention, multiple class loaders are constructed and then preserved by the
scalaInstance task in each project throughout the first task execution.  Only when multiple
scalaInstance tasks execute simultaneously and only during the first execution does this occur.
(Technically, it could still happen later, but it doesn't in practice.)

This means that the number of duplicate class loaders should quickly saturate instead of growing
linearly with the number of projects.  It also means that the impact depends on the exact
tree structure of projects.  A linear chain of dependencies will be unaffected, but a build with
independent leaves may be limited by the number of cores.  The number of cores affects
the number of threads typically used by the task engine, which limits the number of concurrently
executing scalaInstance tasks.

In summary, this might affect the first, cold compilation of a multi-module project with
independent leaves on a multi-core machine with Scala version different from the version used
for sbt.  It might increase the maximum permgen requirements as well as slow the jit compilation
by up to one task execution.  Subsequent compilations should be unaffected and the permgen
utilization return to be as expected.
2013-06-19 21:38:06 -04:00
Mark Harrah 6091e60611 Show project version in 'about' 2013-06-19 19:18:40 -04:00
Mark Harrah 7796715e88 Move deprecated scala-tools conveniences to private[sbt] accessibility 2013-06-19 17:15:22 -04:00
Mark Harrah 464f093017 Handle newer predefined launcher types in boot overrides 2013-06-19 17:15:22 -04:00
Mark Harrah 9dce57b9fc remove task key definition from the build since it is now in sbt 2013-06-19 17:14:57 -04:00
Mark Harrah b1cba90332 Promote new State methods to public 2013-06-19 12:01:45 -04:00
Mark Harrah 284cddff70 set position on parameter references in task/setting macros 2013-06-19 11:53:11 -04:00
Mark Harrah 2f9d68e869 Require projects to have unique target directories.
Configuring projects so that target directories overlap is usually
unintentional and the error message that results is usually unrelated
to the cause.
2013-06-18 18:43:50 -04:00
Mark Harrah 52f1ed1819 Support dynamic evaluations of optional settings (Initialize.evaluate). 2013-06-18 18:29:01 -04:00
Mark Harrah 800bd3698a Add syntax summary to 'set' and 'inspect' help. Follow-up to #776. 2013-06-17 12:06:13 -04:00
Mark Harrah 53f75a85cc Basic named commands now print usage if the argument parser fails on empty input. Fixes #776.
The Help for these commands now needs to be cleaned up, since they were not written with
this feature in mind.  In particular,

* consider adding syntax summaries in the short help strings
* alternatively, add the syntax summary data elsewhere for use specifically by this feature
* display a better message when there is no short help string, such as
   "See 'help <command>' for usage." or just displaying the lower level error message, such as
   "Expected whitespace"
2013-06-17 12:06:13 -04:00
Mark Harrah 684dda144f SoftInvalid parser, which defers being invalid in order to preserve a failure message on empty input. 2013-06-17 12:06:13 -04:00
Mark Harrah a4bad86614 invalid/failure Parser construction methods now accept definitive flag 2013-06-17 12:06:13 -04:00
Mark Harrah c269706750 Merge failures from a,b in a|b when a,b fail on the same input position.
Previously, only the failures from b were used.
2013-06-17 12:06:13 -04:00
Mark Harrah 676c93043c 'definitive' Parser failures
Support a definitive flag for Failure that ignores later failures
instead of appending them.  This is useful to override the default
behavior of listing the failures of alternative parsers.
2013-06-17 12:06:13 -04:00
Mark Harrah 53e7960976 separate out help message functions 2013-06-17 12:06:13 -04:00
Mark Harrah 74438d0c72 handle empty help list in aligned printing 2013-06-17 12:06:13 -04:00
Mark Harrah 0780a6c08a Key parsing improvements. Ref #776.
* Explain context of expected ':' and '/' error messages
* Restore strict project ID parsing to get proper message about invalid project ID
2013-06-17 12:06:13 -04:00
xuwei-k 3f2133729b allow java varargs main
http://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.1.4
2013-06-16 15:47:47 -04:00
Mark Harrah 2ebf9f1a4a Docs: fixes, updates, reorganization 2013-06-16 10:21:21 -04:00
Mark Harrah a6f75a75ad Fully implement StaticScopes subclass of Initialize in order to support use in Task flatMap. Fixes #784. 2013-06-15 23:55:05 -04:00
Mark Harrah 8372d0a751 handle directory classpath entries in ClasspathFilter. Fixes #783. 2013-06-15 23:55:05 -04:00
Mark Harrah fb27f5558c Propagate taskDefinitionKey in Incompletes from flatMaps. Ref #784. 2013-06-15 23:55:05 -04:00
Mark Harrah 5a252fae3a ScopeFilter.debug to print accepted and rejected scopes 2013-06-10 17:05:11 -04:00
Mark Harrah 73c771eed8 scripted: test to support launching next sbt version
disabled because there is no next version to test yet
not sure how to make this handled automatically or to
avoid forgetting to reenable it
2013-06-10 17:05:11 -04:00
Mark Harrah 1c8d3cd9c8 scripted: launcher and scripted test versions are sbtVersion by default.
Ref #781.
2013-06-10 16:55:09 -04:00
Mark Harrah 16da91946b test case for #777 (custom testGrouping+no tests) 2013-06-07 13:31:27 -04:00
Mark Harrah cb3df0982f snapshot version for development 2013-06-06 20:06:07 -04:00