Commit Graph

448 Commits

Author SHA1 Message Date
Mark Harrah e3e95f902d Merge remote-tracking branch 'benjy/analysis_test' into 0.13 2013-10-17 15:17:57 -04:00
Mark Harrah 715a5655ef Deprecate some methods replaced by PathFinder.pair 2013-10-17 15:00:48 -04:00
Benjy da6af7c5f7 Test for Analysis split/merge.
Requires scalacheck generators for Analysis and its subobjects. These
may be useful for other tests in the future.

Also fixes a bug in RelationTest.
2013-10-17 11:56:10 -07:00
Mark Harrah 1432d633e2 Merge remote-tracking branch 'benjy/relation' into 0.13 2013-10-13 22:27:10 -04:00
Benjy 6361013601 Add equals/hashCode to generated API datatype classes.
Equality is reference equality for classes that have lazy members
(currently Structure and ClassLike) and member equality for everything else.
This avoids the circularity issue due to lazy members.

Forces each class to be either abstract or final, to ensure that
the equals implementation is always correct.

Fixes toString to avoid infinite recursion.
2013-10-11 15:52:23 -07:00
Benjy 754334e31b Add merge, partition and groupBy methods to Relation.
Also add equals/hashCode to Relation.

Also add a basic test for groupBy.
2013-10-10 21:05:20 -07:00
Mark Harrah 0cd8849ec1 Work around various issues with Maven local repositories. Fixes #321.
* when mvn does a local 'install', it doesn't update the pom.xml last modified time if the pom.xml content hasn't changed
* an ivy.xml includes publicationDate, so an ivy.xml will always be touched even if the other content hasn't changed
* when Ivy checks if a snapshot is uptodate
  + it sees a SNAPSHOT, so it knows the module metadata and artifacts might change
  + it then checks the lastModified time of the metadata
  + if unchanged, it uses the cached information
  + if useOrigin is effectively false (either it is explicitly false or a resource is remote/isLocal=false),
    this means that a new artifact won't be retrieved
* the Ivy IBiblioResolver
  + must be used for Maven repositories for proper behavior (no FileResolver, for example)
  + only returns URLResources, even for file: URLs
  + a FileResource is needed in combination with useOrigin to avoid copying artifacts from .m2/repository/

This commit fixes the above by setting a custom URLRepository on a constructed IBiblioResolver.
This URLRepository returns FileResources for file: URLs and standard URLResources for others.
The returned FileResource has isLocal=true and sbt sets useOrigin=true by default, so the artifacts
are used from the origin.

If it turns out a similar situation happens when mvn publishes to remote repositories, it is likely the fix for
that would be to figure out how to disable the lastModified check on the metadata and always download the metadata.
This would be slower, however.
2013-10-10 21:36:11 -04:00
Mark Harrah d4aa7bf0e9 drop unused mutable data type generator 2013-10-08 13:38:33 -04:00
Mark Harrah 60426facba TrapExit support for multiple, concurrent managed applications. Fixes #831. 2013-10-02 09:13:45 -04:00
Mark Harrah ce348c4aea Minimal support for class file formats 51.0, 52.0 in incremental compiler. Fixes #842.
It is not currently possible to use a newer class file format than the one for the jvm sbt is running in.
2013-09-26 08:14:40 -04:00
James Roper 743ce99315 String upper/lower case no longer locale dependent
Fixed many instances of the Turkish i bug.

Spare a thought for the poor Turks!
2013-09-24 08:14:15 -04:00
Mark Harrah 9135ece3cd The Process methods that are redirection-like should not discard the exit code of the input.
Only piping should do that.  This addresses an inconsistency with Fork, where using the CustomOutput
OutputStrategy makes the exit code always zero.
2013-09-19 12:38:16 -04:00
Mark Harrah 2ac8b045ad Extra access methods for IPC 2013-09-18 10:27:19 -04:00
Mark Harrah 11a7151af3 Show source position of undefined setting. 2013-08-30 18:34:54 -04:00
Mark Harrah 983d87106b API docs for Attributes.scala 2013-08-16 14:22:14 -04:00
Mark Harrah 78178f8716 More API docs for the classpath module 2013-08-16 14:22:14 -04:00
Mark Harrah 50232c56af Cleaned up API docs for Relation. 2013-08-16 14:22:14 -04:00
Mark Harrah 8b103271a7 API docs for Parser(s). 2013-08-16 14:22:14 -04:00
Mark Harrah 6604437f7f Restore lower case hex digits to HexDigit Parser, accidentally removed in 8545e912da. 2013-08-16 14:22:14 -04:00
Mark Harrah 9d1d18cd71 remove duplicate relativize implementation from Path 2013-08-16 14:22:14 -04:00
Mark Harrah 0c95e44ad5 API docs for DeferredWriter and RichURI 2013-08-16 14:22:13 -04:00
Mark Harrah 8b3fd453b8 more API docs for Hash.scala 2013-08-16 14:22:13 -04:00
Mark Harrah faa308fe9a more API docs for IO.scala 2013-08-16 14:22:13 -04:00
Mark Harrah 245e3cee7c API docs for File/NameFilters 2013-08-16 14:21:45 -04:00
Mark Harrah 033829d4a0 init/restore instead of setEchoEnabled in order to handle full jline customizations. Fixes #822. 2013-07-19 20:03:06 -04:00
Mark Harrah 5fe35be7a3 specify explicit type to work around 2.11 volatile override error 2013-07-18 22:38:16 -04:00
Mark Harrah 036156413d disable JLine event expansion 2013-07-12 09:42:16 -04:00
Mark Harrah 001bd6cb9f Provide a better error message when an older launcher is used with 0.13 and JLine classes are incompatible. 2013-07-08 18:42:00 -04:00
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