Commit Graph

207 Commits

Author SHA1 Message Date
James Roper 7d27fc226a Allow specifying sbt.boot.properties as a URI
This allows straight forward system independent generation of the
property, since URIs are well specified and only support one file
separator.
2013-11-06 20:33:52 -05:00
Josh Suereth b0f6f94839 Add in the ability to launch non xsbti.AppMain classes.
* Deprecate old mainClass method on appProvider
* Create entryPoint method which represnets class used to launch instead.
* Create PlainApplication to wrap static `main` methods.  Can return
  either Int, Exit or Unit.
* Detect supported 'plain' classes via reflection.
* Add new unit tests appropriate to the feature.
2013-11-06 12:29:51 -05:00
Mark Harrah a92b883e23 update to ScalaCheck 1.11.0 2013-11-04 11:28:40 -05:00
Mark Harrah 97e5ac8ec1 Read https+ftp proxy environment variables into system properties. Fixes #886. 2013-10-08 18:41:13 -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
William Benton 2a3462ac12 Additional options for Ivy resolvers.
Specify an Ivy resolver with ", descriptorOptional" to make Ivy
descriptor files optional for that repository or with
", skipConsistencyCheck" to disable Ivy consistency checks for
that repository.
2013-08-26 14:06:21 -04:00
William Benton e3ee1a9ac4 refactored case-match in ConfigurationParser.getRepositories 2013-08-26 14:06:21 -04:00
Mark Harrah c127461ea1 set jline.esc.timeout=0 to prevent it from creating a Thread 2013-07-18 15:41:45 -04:00
Marko Elezovic ebb6b2cf70 Whitespace OCD 2013-07-02 08:21:32 -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
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 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 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 2b5a088911 sbt.log.format should not be set by sbt, since that will not respect noformat 2013-05-27 19:12:39 -04:00
Mark Harrah 81babda6f6 work around URI problems with encoding and resolving. Fixes #725 2013-04-12 12:47:44 -04:00
Mark Harrah 28b12465df fix regex character filter in VersionParts 2013-03-18 09:52:57 -04:00
Josh Suereth f414214d6e Fixes #706 - Binary Compatibility lost in Launcher.
This checks to see if the new `crossVersionedValue` is actually implemented
by an AppID and delegates to the deprecated `crossVersioned` method if
there are any issues.   This preserves the binary compatibility from
folks using Launcher interface pre-0.13 and post-0.13.
2013-03-12 13:04:24 -04:00
Mark Harrah 56b85522b7 ivy cache: ignore the original resolver in more places. Fixes #704 2013-03-08 14:23:31 -05:00
Mark Harrah b8c11678d9 launcher: put ivy resolution cache in boot and clear each run, ignore original resolver 2013-03-08 14:23:31 -05:00
Mark Harrah 8c4ebabe19 remove JLine from the launcher
It is no longer necessary for it to be loaded in a stable class loader
and line reading in the launcher does not require anything more advanced
than java.io.Console.readLine(String).
Scala versions 2.8 and later use the version that goes through JAnsi
and for that it is sufficient to have JNA in a stable loader.
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 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 c815f57a79 Workaround for os deadlock detection at the process level. Fixes #650. 2013-02-05 10:27:19 -05:00
Mark Harrah 437c805f3d Fix ScalaProviderTest to work with new CrossValue type 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 824000009d Right precedence of sbt.boot.properties lookup, handle qualifier correctly. Fixes #651. 2013-01-23 12:48:54 -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
Mark Harrah 1d18532bf0 mark Typesafe repositories as bootOnly, remove Sonatype snapshots now that Scala is resolved by the project 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 b7084ffa1f fix scoping issue in launcher tests 2012-12-04 21:08:38 -05:00
Josh Suereth 4210936163 Adding app-repositories feature to Launcher.
* Added appRepositories method to Launcher interface
* Added 'bootOnly' configuration, such that repositories can be used only for boot and not applications.
* Added tests to ensure 'bootOnly' and 'mavenCompatible' behave well
* Updated documentation on launcher to reflect new options.
2012-12-04 13:10:10 -05:00
Josh Suereth e07dc32b7e Adding some documentation to Launcher interface.
* Documented most of the heavily used methods in Launcher.
* Need to decide whether or not getScala is 'deprecated' or just disuaded in the future.
2012-12-04 13:10:10 -05:00
Josh Suereth 0c08c1169e Bumped the Scalatest/Specs versions for 2.10.0-RC3
* Modified tests to use mutable Specs API
* Fixed a few minor specs issues.
2012-12-04 13:10:09 -05:00
Mark Harrah 8d6dd10798 2.10.0-M5, different arity generalization
1. KList[M[_]] now instead of KList[HL <: HList, M[_]]
  a. head, tail work properly in this variant
  b. disadvantage is that full type not easily transformed to new type constructor
2. AList abstracts on K[L[x]], a higher order type constructor.
 A. Instances written for:
  a. KList
  b. Seq[M[T]] for a fixed T
  c. TupleN
  d. single values
  e. operate on one type constructor when nested
 B. Main disadvantage is type inference.  It just doesn't happen for K[L[x]].
    This is mitigated by AList being used internally and rarely needing to construct a K.
2012-11-17 20:19:24 -05:00
Mark Harrah 1c1e5c4977 taking care of deprecations removed in Scala master 2012-11-14 11:48:06 -05:00
Eric Bowman 835ee0d1b3 XSBT-5: maven-style ivy repo support in the launcher config
Change-Id: I22c1ff126961d61d92e2e45a5b7eff329d3def90
Reviewed-on: https://gerrit.gilt.com/10950
Reviewed-by: Eric Bowman <ebowman@gilt.com>
Tested-by: Eric Bowman <ebowman@gilt.com>
2012-10-29 09:04:42 -04:00
Mark Harrah 113fdbaff1 fix launcher tests 2012-07-01 15:16:41 -04:00
Mark Harrah d8f5c39465 remove most occurrences of ScalaObject 2012-07-01 15:16:41 -04:00
Mark Harrah c9310db337 resolve Ivy home launcher setting to absolute path 2012-06-22 22:11:25 -04:00
Mark Harrah d9a8ec0c22 system property name: resolver->repository 2012-06-02 19:03:57 -04:00
Josh Suereth 76d24091fa Fixes from mark's suggestions.
* Puppies may rest easy from the removal of Option.get calls.
* better names for config values
* Added a helper method to avoid any possible code duplication, besides repeated def, val, match and for keywords.
  Looking for ways to remove this duplciation ASAP.
* Moved from pattern match to ._1, my most hated member.
2012-05-30 21:42:45 -04:00
Josh Suereth 8bca690e0a User may now override default resolvers with a config file. * Configuration parsing now looks for a ivy.resolver-config property for alternative resolver config. * ivy.resolver-config defaults to ~/.sbt/repositories * If the resolve config file exists, its [resolvers] section is used instead of sbt-launch.jar's * Attempted to re-use as much code as possible and add as little as needed. 2012-05-30 21:42:45 -04:00
Josh Suereth 52307d27a4 Adding ability to override resolvers from launcher. * Added key which pulls the repositories used by the launcher, if the API allows. * Added which configures whether or not should just use . * Added parsing to launcher so java property is used by default for override setting. 2012-05-30 21:42:45 -04:00
Mark Harrah ba13aec159 extra launcher properties paths for missing and unmatched sbt.version 2012-05-27 20:03:08 -04:00
Mark Harrah 1488bf2eff restore scala-tools-* repository names in launcher as aliases to sonatype-oss-* 2012-05-27 20:03:08 -04:00
Mark Harrah f39af0bab3 a more universal launcher
when a properties file is not otherwise explicitly specified,
the sbt.version from project/build.properties is used to select
the default properties file to use.  This launcher should be able
to launch:

 0.7.x
 0.10.{0,1}
 0.11.{0,1,2,3}
 0.12.x

Note that it can only launch the release versions of 0.10 and 0.11
listed above and in particular cannot launch snapshot versions.  All
0.12.x versions and 0.7.x versions should be supported, although only
0.7.7 was tested.
2012-05-24 21:50:25 -04:00
Mark Harrah e8b8be7547 more scala-tools replacements 2012-05-05 20:35:04 -04:00
Mark Harrah fa725ef9c9 replace scala-tools-snapshots with sonatype oss 2012-04-14 19:13:24 -04:00
Mark Harrah 13d3e7dde3 update to Scala 2.9.2 2012-04-13 17:47:12 -04:00