Commit Graph

420 Commits

Author SHA1 Message Date
Mark Harrah 1048976844 jline/jansi fixes for windows. Fixes #763, fixes #562.
The startup script should set sbt.cygwin=true if running from cygwin.
This will set the terminal type properly for JLine if not already set.
If sbt.cygwin=false or unset and os.name includes "windows", JAnsi is
downloaded by the launcher and installed on standard out/err.

The value for jline.terminal is transformed from explicit jline.X to
the basic types "windows", "unix", or "none".  Now that sbt uses JLine
2.0, these types are understood by both sbt's JLine and Scala's.
Older Scala versions shaded the classes but not the terminal property
so both couldn't be configured with a class name at the same time.
2013-06-26 13:40:33 -04: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 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 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 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 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 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 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 c7ee375812 Remove env subproject, which hasn't been built or published in many releases. 2013-06-05 12:47:27 -04:00
Mark Harrah fa591364f7 local SyncVar implementation to deal with std lib deprecations 2013-05-27 19:12:39 -04:00
Mark Harrah 871aeb1502 Derived settings: handle scopeLocal in derive and allow triggering dependencies to be filtered 2013-05-09 17:28:50 -04:00
Mark Harrah 7ed56d3fcd Show defining locations when there are cycles between derived settings 2013-05-09 17:28:50 -04:00
Mark Harrah 4bb9633d6c only derive settings when all dependencies are defined 2013-05-09 17:28:49 -04:00
Mark Harrah 6c0f47ef48 Default settings, which give internal sbt settings something like Plugin.globalSettings. 2013-05-09 17:28:40 -04:00
Mark Harrah c863a03d89 support filtering the Scopes that a derived setting is applied in 2013-05-09 17:28:39 -04:00
Mark Harrah ea6eb01e6e more specific error when dependencies of a derived setting are undefined 2013-05-09 17:28:39 -04:00
Mark Harrah 60b714e8de require dynamic initialization to be explicitly enabled for derived settings 2013-05-09 17:28:39 -04:00
Mark Harrah 1b784082a3 ensure a derived setting is only injected into a scope once 2013-05-09 17:28:39 -04:00
Mark Harrah 994886ee51 display derived settings information in 'inspect' 2013-05-09 17:28:39 -04:00
Mark Harrah dfe418b3c3 Derived settings, which allows injecting settings wherever their dependencies are defined.
This is an advanced feature initially intended for internal sbt use.
2013-05-09 17:27:43 -04:00
Mark Harrah 626038bece Merge branch 'feature/inc-track-inherit' into 0.13 2013-05-01 19:25:01 -04:00
Mark Harrah a867d8e87c extract public inherited dependencies from Java class files 2013-05-01 17:54:10 -04:00
Mark Harrah f7ce8334c3 Merge remote-tracking branch 'scalatest/new-framework-api-12' into 0.13 2013-05-01 08:34:01 -04:00
Mark Harrah 4dc75343ae Record and persist public inheritance dependencies.
Includes placeholders for adding public inherited dependencies for Java classes.
2013-04-26 22:35:27 -04:00
cheeseng df9a475158 Normalize line endings. 2013-04-25 00:06:52 +08:00
Mark Harrah 81babda6f6 work around URI problems with encoding and resolving. Fixes #725 2013-04-12 12:47:44 -04:00
Mark Harrah 77001a4259 drop canonicalization of files on classpath and other cleanup. Fixes #723. 2013-04-09 20:13:06 -04:00
Mark Harrah b990a29c09 Undeprecate ScalaInstance.libraryJar, which will be reliable for modularized Scala. 2013-04-08 09:21:59 -04:00
Mark Harrah df5e79e3be API for evaluating a setting or task in multiple scopes 2013-03-27 09:17:53 -04:00
Mark Harrah 9ebb952525 Logger.Null that discards logged messages 2013-03-13 12:40:03 -04:00
Mark Harrah d6f78db0c9 Construct input tasks in multiple steps to allow input task reuse. Fixes #407. 2013-03-08 14:23:30 -05:00
Mark Harrah dde24d5e5a make classpaths exported 2013-02-28 17:59:38 -05:00
Mark Harrah 3e32c7d1f1 changes needed for tests for jline 2.10 2013-02-26 09:27:57 -05:00
Mark Harrah 45aae0cdc6 add Jline.createReader() back for source compatibility 2013-02-26 09:27:56 -05:00
Alex Dupre 92e99cfef0 Switch from JLine 1.0 to 2.10. 2013-02-26 07:39:33 -05:00
Mark Harrah 0cf702efd5 Move GlobalLogBacking.newLogger to GlobalLogging to make the role of GlobalLogBacking clearer. 2013-02-25 09:24:05 -05:00
Mark Harrah 6350a4b51d make GlobalLogging.backed less specific: AbstractLogger is fine 2013-02-25 09:24:05 -05:00
Mark Harrah f6d73128fc deprecations 2013-02-25 09:24:04 -05:00
Mark Harrah a61421dcb8 Split ConsoleOut into its own file, track the global ConsoleOut and use it instead of StandardMain.console 2013-02-25 09:24:04 -05:00
Mark Harrah 5b5577a187 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
Mark Harrah bd0f208302 Class loader that restricts loading to a classpath. Ref #661.
It is now used for consoleProject, run, and test.  This loader verifies
that all classes loaded through it came from a particular classpath or
from the "root" loader.  Root loader here is the launcher loader so that
those classes with native bindings come from that shared loader.
2013-02-21 20:44:26 -05:00
Mark Harrah cdf61683df Remove unused class loader implementations 2013-02-21 20:44: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 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