Commit Graph

242 Commits

Author SHA1 Message Date
Jean-Rémi Desjardins ca736e55d3 Minor code cleanup 2014-12-03 09:56:34 -08:00
Eugene Yokota 47583fd2d0 boot package has its own error method 2014-10-10 17:57:08 -04:00
Eugene Yokota 3f958a5bce enable -deprecation for Scala 2.10
Enable -deprecation flag to catch old code being use when we migrate
things.
In this commit I moved error to sys.error.
2014-10-10 15:42:26 -04:00
Eugene Yokota c648a31c59 #1541. Launcher uses HTTPS Maven Central by default 2014-08-23 17:47:47 -04:00
Ben McCann 6508429d81 Fetch tyesafe artifacts using https. See http://blog.ontoillogical.com/blog/2014/07/28/how-to-take-over-any-java-developer/ 2014-08-16 16:17:07 -07:00
eugene yokota 23f9dc26c7 Merge pull request #1535 from sbt/fix/670
Fixes #670. Exclude http.proxyPassword from update.log
2014-08-16 17:11:10 -04:00
Eugene Yokota 6b6332a069 Fixes #670. Exclude http.proxyPassword from update.log 2014-08-15 18:25:06 -04:00
Havoc Pennington 705b60dc11 Use java Pattern directly in launcher instead of Scala API
This keeps the launch jar smaller
2014-08-15 15:34:11 -04:00
Havoc Pennington d7ca9c5637 Server launcher: Print errors running java -version to stderr
We forward errors from the spawned server to stderr, so we are
already using stderr and this should save someone some pain
vs. just swallowing the fail.
2014-08-15 15:24:21 -04:00
Havoc Pennington 081f6bac07 Ignore "java -version" IOException when launching servers
process.start and reading from the stderr stream could in
theory throw IOException, we want to return None then
rather than crashing.
2014-08-15 15:24:09 -04:00
Havoc Pennington 3a065dc047 Set Java memory options for server applications
The defaults here are copied from Activator which
in turn are probably copied from somewhere else.
They are of course basically arbitrary, but the
JVM's defaults if we don't set memory options
are insufficient to run most apps.

If the user sets any memory options in the configuration,
we completely leave them alone and don't set any of
our own. So it's always possible to override.
2014-08-15 11:07:19 -04:00
Roberto Tyley 0bada62349 Update misc tests and doc to reflect HTTPS access for Maven Central 2014-08-08 17:07:44 -04:00
Jacek Laskowski d1dbdfc816 Message and since parameters in @deprecated properly placed 2014-06-24 22:35:34 +02:00
Havoc Pennington 506d06bf67 Don't delete the server config file if SBT_SERVER_SAVE_TEMPS ne null
This allows people to reproduce failures by running the command line
by hand.

Fixes #1394
2014-06-05 11:18:22 -04:00
Havoc Pennington a72448b793 Flush output every time we write to it in StreamDumper
To try harder to get our errors displayed.
2014-06-05 11:09:59 -04:00
Havoc Pennington 63d9b638c3 Wait 5 seconds instead of 2 seconds to read stderr from launched server 2014-06-05 11:07:37 -04:00
Havoc Pennington d57f5ac180 put backticks around `yield` in Thread.yield 2014-05-29 12:32:10 -04:00
Havoc Pennington 007a8f2a70 ServerApplication: yield before we check on the dumper thread 2014-05-28 10:07:35 -04:00
Havoc Pennington 1e80d811a1 Read stderr from server for a short time before exiting
Previously we exited immediately without waiting to get any
error output.

This patch also adds the command line and directory to the
exception message on failure, in case the failure is due to
getting one of those wrong, for example.
2014-05-27 18:36:08 -04:00
Josh Suereth abffc3e1bd Bump expected 2.11 module versions so we can compile with 2.11
Add scala 2.11 test/build verification.

* Add 2.11 build configuratoin to travis ci
* Create command which runs `safe` unit tests
* Create command to test the scala 2.11 build
* Update scalacheck to 1.11.4
* Update specs2 to 2.3.11
* Fix various 2.11/deprecation removals
  and other changes.

Fix eval test failure in scala 2.11 with XML not existing.
2014-05-14 19:08:05 -04:00
Josh Suereth 244abd3b6f Scalariforming test code 2014-05-07 11:52:23 -04:00
Josh Suereth 39b68a2dfd Bring scala provider test to modern age of scala releases. 2014-05-07 11:48:45 -04:00
Eugene Yokota 785b0274ee some more source getting formatted 2014-05-02 18:07:05 -04:00
Eugene Yokota adb41611cf added scalariform 2014-05-01 12:50:07 -04:00
Josh Suereth f92206b785 Fixes issue with deadlocking server discovery on windows.
It turns out windows blocks until a process is finished when
you try to close the stderr handle, but not stdout.  Therefore,
we leave stderr open when we shut down, which lets the server
continue to run on windows.
2014-04-16 08:44:03 -04:00
Josh Suereth e2225c3c25 Merge pull request #1064 from jaceklaskowski/javadoc-changes
Javadoc changes
2014-04-07 10:02:35 -04:00
Dan Sanduleac c4f6217a70 Fix URITests to work under Windows 2014-04-04 10:10:40 +01:00
Dan Sanduleac 6abac450ef Retrieve dynamic app versions correctly 2014-02-10 09:18:41 +00:00
Josh Suereth 4207978f89 Merge pull request #1066 from jsuereth/wip/launcher-improvements
Launcher can now load servers in addition to regular applications.
2014-01-06 13:57:28 -08:00
Josh Suereth 418b854907 Launcher can now load servers in addition to regular applications.
* Add new ServerMain interface
* AppProvider can now choose to load ServerMain or AppMain classes
* Explicitly document what happens if something doesn't match an
  expected interface
* Improve error message on inability to load something.
* Parse new [server] section that denotes a service and is lock file
* Ability to serialize launch configurations.
* Attempt to look for active listening server via the lock file
* Forks the launcher itself to run servers from serialized launch configuration.
* Testing echo server.
* Tests to detect basic server functionality will work.
* Revamp all the documentation for the launcher, giving it its own section.
* Full documentation on launcher configuration files.

Revamp launcher documentation to be a bit more in-depth, and split bits into sections.
2014-01-06 16:54:45 -05:00
Jacek Laskowski dc246cade7 Javadoc changes 2014-01-06 14:08:02 +01:00
Jacek Laskowski a5b8dffc74 Unify warning to other schemes and use string interpolation 2014-01-02 09:18:54 -05:00
William Benton 3a1ad44c45 Support Ivy 2.3.0-final.
This entailed modifying ResolutionCache and the CustomPomParser
to reflect changes to the ResolutionCacheManager interface and
DefaultExtendsDescriptor class between Ivy 2.3.0-rc1 and
2.3.0-rc2. Specifically,

1. ResolutionCacheManager now includes two additional methods
that needed implementations in ResolutionCache:
getResolvedModuleDescriptor(mrid: ModuleRevisionId) and
saveResolvedModuleDescriptor(md: ModuleDescriptor). I adapted
the implementations for these (which are expressed primarily in
terms of other interface methods) from Ivy 2.3.0's
DefaultResolutionCacheManager.

2. Instead of taking a ModuleRevisionIdentifier and a resolved
ModuleRevisionIdentifier as its first two arguments, the
DefaultExtendsDescriptor constructor now takes a
ModuleDescriptor. This was a trivial change.

Note that ResolutionCache.getResolvedModuleDescriptor does not
appear to be used by Ivy as sbt uses Ivy and there is thus no
test coverage for its implementation. Also note that the
DefaultResolutionCacheManager object created in
Update.configureResolutionCache now requires a reference to an
IvySettings object; DRCM expects this to be non-null.
2013-12-13 14:24:37 -06:00
Josh Suereth ff71bca75c Drop some of the stack size of the launcher.
* Remove needless chained methods
* Attempt to create re-usable parsing methods.
2013-12-12 10:16:48 -05:00
Josh Suereth cfe14444b8 Document ComponentProvider interface. 2013-12-12 09:51:58 -05:00
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