Commit Graph

406 Commits

Author SHA1 Message Date
Ethan Atkins 5cfab4c9a9 Cleanup implementation of progress report
It was a bit cleaner to consolidate `extra` and
(previousLines|info).length into prevLength and currentLength.
2019-09-24 16:33:42 -07:00
Ethan Atkins 7597cdb19b Take terminal width into account in supershell
Sometimes if the progress lines are wider than the terminal width,
the supershell blank zone can expand indefinitely because be do not move
the cursor far enough up to properly re-fill the blank zone.
2019-09-24 10:59:53 -07:00
eugene yokota 3f20cc1583
Merge pull request #221 from eatkins/lazy-success-event-tag
Load SuccessEventTag lazily
2019-09-18 22:14:28 -04:00
Ethan Atkins b3165b5c8c Load SuccessEventTag lazily
It takes about a second to load scala.reflect.runtime.universe. If we
lazy load here, we can load scala.relect.runtime.universe in the
background to speed up the sbt start up time. See
0ebb7a5662.
2019-09-18 15:33:42 -07:00
Eugene Yokota 5d0793fece Scala 2.12.10 2019-09-11 23:02:50 -04:00
Josh Soref 747416173a https://apocalisp.wordpress.com 2019-09-05 14:10:59 -04:00
Ethan Atkins f20b275045 Fix supershell position bug
The previous implementation of supershell log line interlacing with
regular line interlacing relied on state in a global object. A somewhat
better approach is for each appender to hold a reference to a state
object. Every time tasks run, new appenders are created, so the state
should always reflect the current progress state.
2019-09-03 13:07:51 -07:00
Ethan Atkins 635316902d Allow supershell to work in no color mode
Supershell actually works quite well in no color mode. On the sbt side,
we still want to disable supershell automatically if the output is not a
terminal or no color is set, but this commit allows the user to force
supershell through -Dsbt.supershell or the useSuperShell setting even
when no color is set.
2019-09-02 11:10:42 -07:00
Ethan Atkins a5666e97b6 Manage progress padding
With this commit, I improved the padding management so that padding is
now added above the progress report. Whenever a line is logged at the
info or greater level, we can reduce the padding level by one since that
line has effectively filled in the padding.
2019-09-01 22:26:57 -07:00
Ethan Atkins d9fe5540f5 Interlace log lines with task progress
With the current supershell implementation, the progress display
flickers when there is heavy console logging during task evaluation.
This is because the console appender clears out the task progress and it
isn't restored until the next periodic super shell report (which
runs every 100ms by default). To remove the flickering, I reworked the
implementation to interlace the log lines with progress reports. In
order to ensure that the log lines remained contiguous, I had to apply
padding at the bottom of the supershell region whenever the new report
contained fewer lines than the old report. The report shifts down as new
log lines are appended. This isn't optimal, but I think removing
the flickering while preserving contiguous log lines is worth it.
2019-09-01 21:06:48 -07:00
xuwei-k dfe789d7c6 avoid deprecated /: and :\
use foldLeft and foldRight

https://github.com/scala/scala/blob/v2.13.0/src/library/scala/collection/IterableOnce.scala#L682-L686
2019-08-30 11:20:53 +09:00
xuwei-k 1f3ce5f9ee use Vector instead of List. avoid O(n) append 2019-08-29 21:44:31 +09:00
Ethan Atkins dcb8e18f0e Filter single semicolons from tab completions
Fixes https://github.com/sbt/sbt/issues/4989.
2019-08-27 09:01:53 -07:00
Ethan Atkins 4bb2f4e968 Used Seq instead of Stream
Streams generically perform poorly and weren't needed here.
2019-08-22 20:35:12 -07:00
Ethan Atkins 1700b89ea4 Parallelize Init.addLocal
During akka startup, addLocal was caused twice and prior to this change,
it took roughly 200ms per call on my computer. After this change, it
took about 100ms.
2019-08-22 20:35:11 -07:00
Eugene Yokota 39fdf70c21 reimplement stacktrace suppression
Ref https://github.com/sbt/sbt/issues/4964
2019-08-20 12:35:13 -04:00
Ethan Atkins a3ac4c76a6 Bump scalafmt
Intellij had issues resolving 2.0.0-RCX so it will be nice to be using
the latest.
2019-07-18 12:40:21 -07:00
Eugene Yokota 7de45416fa Scala 2.13.0 2019-07-14 12:47:43 -04:00
Ethan Atkins f2c8d4f436 Fix implicit numeric widening warning
I noticed in CI that a warning was printed for this file about implicit
numeric widening in the GigaBytes case.
2019-07-13 15:20:39 -07:00
Ethan Atkins 0172d118af Add parser for file size
At the suggestion of @eed3si9n, instead of specifying the file cache
size in bytes, we now specify it in a formatted string. For example,
instead of specifying 128 megabytes in bytes (134217728), we can specify
it with the string "128M".
2019-07-11 17:45:16 -07:00
Ethan Atkins 4e2c1858f2 Don't append empty comp.append
In some cases, comp.append could be an empty string. This would happen
if a parser was something like `(token(foo) <~ ;).+ <~ fo.?` because there were
no completions for the `fo` available anchor. The effect of this was
that tab would never complete foo;f to foo;foo, even though that was the
only possible completion. It would, _display_, foo as a possible
completion though.

This came up because the multi parser has a similar parser to that
described above and it broke tab completion to the right of a semi
colon.
2019-06-25 13:45:09 -07:00
Ethan Atkins 4c814752fb Support braces in multi command parser
We run into issues if we naively split the command input on ';' and
treat each part as a separate command unless the ';' is inside of a
string because it is also valid to have ';'s inside of braced
expressions, e.g. `set foo := { val x = 1; x + 1 }`. There was no parser
for expressions enclosed in braces. I add one that should parse any
expression wrapped in braces so long as each opening brace is matched by a
closing brace. The parser returns the original expression. This allows
the multi parser to ignore ';' inside of '{...}'.

I had to rework the scripted tests to individually run 'reload' and
'setUpScripted' because the new parser rejects setUpScripted because it
isn't a valid command until reload has run.
2019-06-19 16:12:45 -07:00
Dale Wijnand 4e89e8ace5
Document helper functions in BuildStructure
Also define LoadedBuildUnit#projects & BuildUnit#thisRootProject, &
cleanup AttributeKey & BasicAttributeMap
2019-06-02 23:28:53 +01:00
Ethan Atkins 72df8f674c Add support for managed task inputs
In my recent changes to watch, I have been moving towards a world in
which sbt manages the file inputs and outputs at the task level. The
main idea is that we want to enable a user to specify the inputs and
outputs of a task and have sbt able to track those inputs across
multiple task evaluations. Sbt should be able to automatically trigger a
build when the inputs change and it also should be able to avoid task
evaluation if non of the inputs have changed.

The former case of having sbt automatically watch the file inputs of a
task has been present since watch was refactored. In this commit, I
make it possible for the user to retrieve the lists of new, modified and
deleted files. The user can then avoid task evaluation if none of the
inputs have changed.

To implement this, I inject a number of new settings during project
load if the fileInputs setting is defined for a task. The injected
settings are:

allPathsAndAttributes -- this retrieves all of the paths described by
  the fileInputs for the task along with their attributes
fileStamps -- this retrieves all of the file stamps for the files
  returned by allPathsAndAttributes

Using these two injected tasks, I also inject a number of derived tasks,
such as allFiles, which returns all of the regular files returned by
allPathsAndAttributes and changedFiles, which returns all of the regular
files that have been modified since the last run.

Using these injected settings, the user is able to write tasks that
avoid evaluation if the inputs haven't changed.

foo / fileInputs += baseDirectory.value.toGlob / ** / "*.scala"
foo := {
  foo.previous match {
    case Some(p) if (foo / changedFiles).value.isEmpty => p
    case _ => fooImpl((foo / allFiles).value
  }
}

To make this whole mechanism work, I add a private task key:
val fileAttributeMap = taskKey[java.util.HashMap[Path, Stamp]]("...")
This keeps track of the stamps for all of the files that are managed by
sbt. The fileStamps task will first look for the stamp in the attribute
map and, only if it is not present, it will update the cache. This
allows us to ensure that a given file will only be stamped once per task
evaluation run no matter how the file inputs are specified. Moreover, in
a continuous build, I'm able to reuse the attribute map which can
significantly reduce latency because the default file stamping
implementation used by zinc is fairly expensive (it can take anywhere
between 300-1500ms to stamp 5000 8kb source files on my mac).

I also renamed some of the watch related keys to be a bit more clear.
2019-05-02 14:33:29 -07:00
Eugene Yokota e28e052b5b move super shell rendering to ConsoleAppender
Ref https://github.com/sbt/sbt/issues/4583
This moves the super shell rendering to ConsoleAppender with several improvements.

Instead of scrolling up, supershell is now changed to normal scrolling down, with more traditional cursor position. Before printing out the logs, last known progress reports are wiped out. In addition, there's now 5 lines of blank lines to accomodate for `println(...)` by tasks.
2019-04-21 03:59:19 -04:00
Eugene Yokota 95761b2ea1 Undo cursor tweaks around prompt 2019-04-20 23:51:13 -04:00
Eugene Yokota 98ec0075f4 apply formatting 2019-04-20 23:23:13 -04:00
Eugene Yokota 1e157b991a apply formatting 2019-04-20 03:23:54 -04:00
Ethan Atkins 6b82a8d07e Don't use usingTerminal
The usingTerminal method synchronizes the JLine object which can lead to
deadlock if multiple threads call it. When we just to want to read the
attributes of the terminal, but not modify it, there doesn't seem to be
any reason to use a lock.
2019-03-28 20:37:49 -07:00
Ethan Atkins 447ab5011c Reduce latency of InputStream polling
Calling InputStream.available has low overhead so there is no need to
have such a long input latency.
2019-03-28 20:37:49 -07:00
Ethan Atkins d178f13fc0 Rename generic parameter
I was seeing a number of compiler warnings about the type parameter
Scope:
    Settings.scala:55:12: type parameter Scope defined in trait Init shadows class Scope defined in package util. You may want to rename your type parameter, or possibly remove it.

I'm not sure why I wasn't seeing these before, but the fix is simple.
2019-03-28 08:31:10 -07:00
Ethan Atkins 9040e57932 Unseal Parser
Although this is technically in the internal package, it is exposed to
users when they write a custom input task. I do not think that we should
prevent users/plugin authors from writing their own parser
implementations if there is a different library they prefer. By my
count, there are 21 implementations of this interface in sbt, so it's
unlikely that there is much benefit from a pattern matching perspective.
2019-03-15 11:11:25 -07:00
Eugene Yokota d496a5dff5 Make showProgress configurable 2019-03-07 16:49:54 -05:00
Eugene Yokota 8215026bc3 Account for log line longer than the terminal width
widthHolder will hold on to the terminal width if supplied by sbt.
This avoids adding dependencies to JLine.
2019-03-07 16:42:10 -05:00
Eugene Yokota 8c85744d67 Use IO.Newline for stack trace 2019-03-07 16:39:47 -05:00
Eugene Yokota 3a6aa57747 log4j 2.11.2 2019-02-23 14:21:07 -05:00
Ethan Atkins efa52143d0 Make types private
While the AnyLeft and AnyRight types are necessary to make the extension
class work, I don't want to leak the AnyLeft or AnyRight traits into the
public api. It wasn't neceessary to annotate `some`, but it's good
practice to annotate anything public anyway.
2019-01-31 21:47:33 -08:00
Ethan Atkins 9b40a0e585 Add meaningful toString to TypeFunctions
It can be hard to debug these because the toString output for a kind
projector plugin provided lambda is inscrutable.
2019-01-31 21:47:33 -08:00
Ethan Atkins 16e7c70035 Lint TypeFunctions.scala 2019-01-31 21:47:33 -08:00
Eugene Yokota 9858bc29fb more tweaking on task progress
move the cursor up after the user enters command.
2018-11-29 04:40:40 -05:00
Eugene Yokota d58b302a97 Fix prompt for task progress 2018-11-16 23:05:51 -08:00
Eugene Yokota 9f202397e4 expose ANSI control sequences 2018-11-16 23:03:25 -08:00
eugene yokota f16997d3a9
Merge pull request #184 from eed3si9n/wip/progress
Adds sbt.color flag and sbt.progress flag
2018-10-02 08:58:38 -04:00
Eugene Yokota efe04c1cde Cleaning up code 2018-10-02 08:51:17 -04:00
Eugene Yokota 9bb244314d implement sbt.progress
This implements a logger that grows upward, instead towards bottom.
2018-10-01 05:50:35 -04:00
Eugene Yokota 53c9b84858 add sbt.color flag
This implements a new sbt.color flag that takes always/auto/never/true/false value as a replacement of current sbt.log.format=true/false flag.

When neither flags are set, the default behavior is to enable color when the terminal supports ANSI and it detects an stdout console (as opposed to redirects).

Fixes https://github.com/sbt/sbt/issues/4284
2018-09-30 21:00:09 -04:00
Eugene Yokota ab674321dc Scala 2.12.7 2018-09-28 02:27:45 -04:00
Eugene Yokota e121d969c4 openjdk11 2018-09-22 00:55:00 -04:00
Eugene Yokota 9f876009c8 Fix 2.10 build
Fixes #179
2018-09-22 00:35:20 -04:00
Eugene Yokota cf0467609d -Xfatal-warnings 2018-09-19 22:46:38 -04:00
Eugene Yokota 9beff33152 SIP-18 import
Adds SIP-18 import for unidoc purpose.
2018-09-19 22:03:32 -04:00
Eugene Yokota ef49a95b7d address more warnings 2018-09-18 17:45:24 -04:00
Eugene Yokota 4ff4f6e45e Update header 2018-09-14 04:53:36 -04:00
eugene yokota 965de89c64
Merge pull request #176 from sbt/1.2.x
Merge 1.2.x
2018-08-29 03:27:16 -04:00
Guillaume Martres 15522a0cbe Add Problem#rendered to customize how problems are shown
Dotty has its own logic for displaying problems with the proper file
path, position, and caret, but if we store this information in
Problem#message we end up with duplicated information in the output
since Zinc will prepend/append similar things (see
sbt.internal.inc.ProblemStringFormats). So far, we worked around this in
Dotty by using an empty position in the sbt bridge reporter, but this
means that crucial semantic information that could be used by a Build
Server Protocol implementation and other tools is lost. This commit
allows us to avoid by adding an optional `rendered` field to `Problem`:
when this field is set, its value controls what the user sees, otherwise
we fallback to the default behavior (the logic to do this will be added to
Zinc after this PR is merged and a new release of sbt-util is made).
2018-08-28 03:58:15 +09:00
Guillaume Martres e905b44a33 Follow-up to the fields added in #173
It turns out that there is more boilerplate to fill that I missed.

Also add deprecation notices.
2018-08-28 02:04:10 +09:00
Eugene Yokota 494f384c49 Formatting 2018-08-16 16:36:41 -04:00
Guillaume Martres 5e3a102606 xsbti.Position: Also add {start,end}{Line,Column}
Positions in the Language Server Protocol and Build Server Protocol are
line/column-based instead of offset-based, so this is more convenient.
Computing the line/column from the offset is possible but requires
reading the source file.
2018-08-14 02:04:55 +09:00
Guillaume Martres 78834527df xsbti.Position: add startOffset and endOffset
A position now has a start, an end, and a point (the existing `offset`),
just like it does in the Scala compiler. This information is especially
useful for displaying squiggly lines in an IDE.

This commit and the next one are required for https://github.com/sbt/zinc/pull/571
2018-08-14 02:04:43 +09:00
Kazuhiro Sera 59dbc0645e Fix the several typos detected by github.com/client9/misspell 2018-08-08 15:57:34 +09:00
Dale Wijnand b1d02bee30
Make checkTypeTag lenient on "scala." type prefix 2018-08-02 07:52:13 +01:00
Eugene Yokota 4ecb3a3f7c Fix bimcompat breakages in complete
Fixes https://github.com/sbt/sbt/issues/4268
2018-07-15 22:28:55 -04:00
xuwei-k ae1fdff968 use SAM type 2018-07-09 13:06:34 +09:00
xuwei-k 98eca81b17 use val instead of var 2018-07-08 22:35:31 +09:00
eugene yokota 773d35dadd
Merge pull request #4231 from steinybot/fix/3432
Add warning for unknown configurations
2018-06-27 20:59:43 -04:00
eugene yokota eb942f8e5f
Merge pull request #4003 from eed3si9n/wip/opt-delegation3
optimize scope delegation
2018-06-27 15:31:21 -04:00
Eugene Yokota 434e294f28 Fixes the stacktrace trimming
Ref https://github.com/sbt/sbt/issues/4121
Ref https://github.com/sbt/sbt/pull/4232
2018-06-27 06:37:36 -04:00
Jason Pickens c9aa0c5285 Add warning for unknown project configurations. 2018-06-27 18:25:10 +12:00
Eugene Yokota 2b52c7dea0 Merge branch '1.1.x' into wip/merge-1.1.x 2018-06-14 01:11:49 -04:00
xuwei-k 5ca377cd59 use foldLeft instead of /:
1c56f0af6d/src/library/scala/collection/IterableOnce.scala (L465)
2018-05-01 20:20:00 +09:00
Eugene Yokota d2e59fa165 Scala 2.12.6 and other dependencies
sbt 1.1.4
Scala 2.12.6
ScalaCheck 1.14.0
ScalaTest 3.0.5
Contraband 0.4.0
2018-04-28 03:52:33 -04:00
Dale Wijnand 8f4b8abb7b
Run scalafmt & test:scalafmt 2018-04-24 16:12:10 +01:00
Dale Wijnand 029952895b
Enforce invariant in StringTypeTag optimisation
Or, put differently, "Add a test for sbt/util#153".
2018-04-05 09:43:22 +01:00
Eugene Yokota 0c26b55882 Merge branch '1.1.x' into wip/merge-1.1.x 2018-03-26 22:46:04 -04:00
Eugene Yokota 07e26a1dcf don't use toStream
Ref #3979
toStream doesn't help performance.
2018-03-10 18:43:43 -05:00
Dale Wijnand 6f52437e95
Fix a "discarded non-Unit value" warning in FileExamplesTest 2018-03-06 11:54:12 +00:00
Dale Wijnand 21eb1f0f12
Cleanup Attributes 2018-03-06 11:54:12 +00:00
Dale Wijnand 44a2f1d92c
Kill utilTesting
No need for a 1-line, 1-class jar
2018-02-23 18:16:30 +00:00
Jason Zaugg d9b130d519 Optimize ConsoleAppender.appendLog 2018-02-23 14:52:45 +10:00
Dale Wijnand fc73203d0b
Fix validID & expand tests
Make sure that we generate valid ID (according to matches(ID, s)) so
that we properly test the new validID implementation.

And that's what led to the bug fix. :)
2018-02-19 18:42:24 +00:00
Dale Wijnand d66d0e34a9
Add prop-based test for the validID re-impl 2018-02-19 15:00:21 +00:00
Johannes Rudolph 0ebb7a5662
In initStringCodecs avoid reflect universe initialization
This showed up in profiling. It's known that TypeTags are expensive. Even
more so if the reflect universe is accessed during startup when the
class loading and JIT compiler are busy enough with other stuff.
2018-02-19 09:19:31 +01:00
Johannes Rudolph 9370a2adf0
Speedup Parsers.validID
It turned up in profiling sessions. Previously, it used parser combinators
which are somewhat slow especially when the JVM is still cold.

The grammar for ID is simple enough to afford this handwritten parser.
2018-02-19 09:13:12 +01:00
Jason Zaugg b68071a488 Cache evidence params for hot method 2018-02-17 14:59:36 +10:00
Dale Wijnand b0baf7de6d
Merge pull request #146 from dwijnand/SourcePosition
Give SourcePosition a macro instance creator
2018-02-09 12:38:47 +00:00
Dale Wijnand ada2a8aafa
Give SourcePosition a macro instance creator 2018-02-08 13:11:34 +00:00
Seth Tisue ba5b60300d fix typo in AbstractLogger.scala filename 2018-01-30 16:19:09 -08:00
Dale Wijnand 286758e2ba
Minor cleanups 2018-01-30 07:29:17 +00:00
Dale Wijnand 5daf10d6c7
Tweak the description of KList 2018-01-23 17:14:27 +00:00
Dale Wijnand df74f78300
Merge pull request #141 from sbt/1.1.x
Merge 1.1.x into 1.x
2018-01-10 14:14:57 +00:00
Antonio Cunei 0a1bd5a3b2 Change modifiedTime definitions 2017-12-22 00:13:27 +01:00
Antonio Cunei 8ba68eedfd Revert *ModifiedTime() calls to *lastModified*() calls
There are just too many instances in which sbt's code relies on
the `lastModified`/`setLastModified` semantics, so instead of moving
to `get`/`setModifiedTime`, we use new IO calls that offer the new
timestamp precision, but retain the old semantics.
2017-12-22 00:13:27 +01:00
Dale Wijnand 5ed25cbc56
Make EscHelpers.removeEscapeSequences handle partial escape sequences
Fixes #67
2017-12-21 17:09:30 +00:00
Eugene Yokota e835ce0689 bump plugins 2017-12-15 13:15:34 -05:00
Antonio Cunei d2338ff287 Removed a couple more direct imports of getModifiedTime() 2017-12-15 17:23:39 +01:00
Dale Wijnand 13a8d53369
Use IO.getModified over importing the method
.. and make getModifiedTimeOrZero private.
2017-12-13 15:47:15 +00:00
Dale Wijnand 4a5ff4fc0d
Remove all warnings from completeProj 2017-12-12 13:02:19 +00:00
Dale Wijnand 34136fb70b
Remove all warnings from logicProj 2017-12-12 13:02:19 +00:00
Dale Wijnand b80a6b217b
Remove all warnings from collectionProj 2017-12-12 13:02:18 +00:00
Antonio Cunei d03dfb3981 Moved Milli._ to IO. 2017-12-06 20:29:41 +01:00
Antonio Cunei ccf149e8bf Convert lastModified() calls to sbt.io.Milli.getModifiedTime() 2017-12-06 20:29:41 +01:00
Eugene Yokota 1388f4e52c Merge branch '1.0.x' into wip/bump_scala 2017-11-28 23:05:33 -05:00
xuwei-k b8086e0768 make strict some methods in Completions 2017-11-23 15:21:02 +09:00
Leonard Ehrenfried 3cc56ad0ba
Add performance test 2017-11-08 21:36:11 +01:00
Leonard Ehrenfried 48f9cf3be6
Disable calculation of log4j caller location information 2017-11-08 21:36:11 +01:00
Dale Wijnand 9f1d60be60
Rewrite to polymorphic function syntax 2017-10-25 10:23:46 +01:00
Dale Wijnand f662fdda8e
Rewrite to function syntax 2017-10-25 10:22:48 +01:00
Dale Wijnand fb17cc393f
Rewrite to inline syntax 2017-10-25 10:22:48 +01:00
Dale Wijnand 35c3542492
Get rid of Fn1 2017-10-25 10:21:00 +01:00
Dale Wijnand 34f9e56311
Introduce and use KList.Aux 2017-10-25 10:15:29 +01:00
Dale Wijnand 3cd8f4dadf
Simplify Initialize.joinAny 2017-10-25 10:15:29 +01:00
Dale Wijnand 81c5eaec33 Merge pull request #3633 from dwijnand/misc-2017-10-12
Misc 2017-10-12
2017-10-24 20:37:20 +01:00
Simon Schäfer dc5411836a Fix warnings in util-copmlete project
There were warnings because of
- unused pattern match values
- deprecations
- unused methods (`def unary_-` and `def -`)
2017-10-19 13:07:24 +02:00
Simon Schäfer 38f550deef Fix warnings in util-collection project
There were warnings because of
- unused pattern match values
- deprecations
- a Xlint bug in scalac
2017-10-19 13:07:24 +02:00
Dale Wijnand 86be5359e7
Initial scaladoc Initialize/Keyed/KeyedInitialize 2017-10-12 20:31:25 +01:00
Dale Wijnand a41727fb17
Add, configure & enforce file headers 2017-10-05 09:03:40 +01:00
Dale Wijnand f4eadfc259 Merge pull request #129 from sbt/1.0.x
Merge 1.0.x
2017-10-02 10:23:02 +01:00
Eugene Yokota 33a01f3ceb Unified slash syntax
Fixes sbt/sbt#1812

This adds unified slash syntax for both sbt shell and the build.sbt DSL.
Instead of the current `<project-id>/config:intask::key`,
this adds `<project-id>/<config-ident>/intask/key` where <config-ident> is the Scala identifier notation for the configurations like `Compile` and `Test`.

This also adds a series of implicits called `SlashSyntax` that adds `/` operators to project refererences, configuration, and keys such that the same syntax works in build.sbt.

These examples work for both from the shell and in build.sbt.

    Global / cancelable
    ThisBuild / scalaVersion
    Test / test
    root / Compile / compile / scalacOptions
    ProjectRef(uri("file:/xxx/helloworld/"),"root")/Compile/scalacOptions
    Zero / Zero / name

The inspect command now outputs something that can be copy-pasted:

    > inspect compile
    [info] Task: sbt.inc.Analysis
    [info] Description:
    [info] 	Compiles sources.
    [info] Provided by:
    [info] 	ProjectRef(uri("file:/xxx/helloworld/"),"root")/Compile/compile
    [info] Defined at:
    [info] 	(sbt.Defaults) Defaults.scala:326
    [info] Dependencies:
    [info] 	Compile/manipulateBytecode
    [info] 	Compile/incCompileSetup
    [info] Reverse dependencies:
    [info] 	Compile/printWarnings
    [info] 	Compile/products
    [info] 	Compile/discoveredSbtPlugins
    [info] 	Compile/discoveredMainClasses
    [info] Delegates:
    [info] 	Compile/compile
    [info] 	compile
    [info] 	ThisBuild/Compile/compile
    [info] 	ThisBuild/compile
    [info] 	Zero/Compile/compile
    [info] 	Global/compile
    [info] Related:
    [info] 	Test/compile
2017-09-28 01:01:43 -04:00
Eugene Yokota ddb6a13feb Provide JValue pass-through 2017-09-24 06:36:18 -04:00
Eugene Yokota 348a077797 implement tokenfile authentication 2017-09-21 23:05:48 -04:00
kczulko e9fa4201fb Fix review issue. Add 't.restore' before function call. 2017-09-14 09:34:06 +02:00
kczulko b6a3ca1937 Fix for text echo issue when running sbt. 2017-09-11 11:49:10 +02:00
eugene yokota cba6f83447 Merge pull request #122 from tom-walford/1.x
Cleaned up the deprecation messages to point to the correct classes.
2017-08-28 11:43:29 -04:00
tom.walford 83433d40e6 Cleaned up the deprecation messages to point to the correct classes. 2017-08-25 20:47:36 +01:00
Eugene Yokota b2be0f766a Attempt to solve the logger NPE issue
Fixes sbt/util#119

1. perform the string codec registration once.
2. add retries.
2017-08-25 12:01:34 -04:00
Eugene Yokota f74e3e66f1 Trying to reproduce sbt/util#119 2017-08-24 17:51:50 -04:00
Dale Wijnand 805b76f3d4
Add back, re-configure & re-enable Scalafmt 2017-08-10 16:35:23 +01:00
Dale Wijnand d31b9c5093
Add, configure & enable Scalafmt 2017-08-10 11:44:24 +01:00
Eugene Yokota 930489eba3 Fix ConsoleAppender to show full stack trace
This is modification of crash log event logging that was added in sbt/util#85.

Instead of using the hardcoded 0 as the default value, this introduces `setTrace(..)` to `ConsoleAppender` like `BasicLogger`. Also the default value is set to `Int.MaxValue` that will display the full stack trace.

Fixes sbt/sbt#3343
2017-07-26 00:03:07 -04:00
Eugene Yokota 5183f7ef81 Use event logging to send success
Fixes sbt/sbt#3213
2017-07-25 16:16:21 -04:00
Eugene Yokota 467617a4b9 Implement withRank 2017-07-25 01:50:53 -04:00
Eugene Yokota d796084ff4 Filter out color in CosoleAppender only
Fixes sbt/sbt#3348
Ref #101

The new logger, based on log4j separates the concern of the log producer (Logger) and the handlers that takes actions (Appender, e.g for displaying on Console). As such filtering of color should be performed only in the ConsoleAppender.
2017-07-24 23:54:25 -04:00
Eugene Yokota f6370063f4 Deprecate ansiCodesSupported from the logger 2017-07-24 23:20:05 -04:00
Eugene Yokota 7b2b7d696b Don't wrap InputStream for Windows
Ref #3282

We used to wrap InputStream so it will inject Thread.sleep, which then allows the thread to be cancelled, emulating a non-blocking readLine. This trick doesn't seem to work for Windows.
For non-Cygwin, actually just removing the wrapping does the job, but I couldn't get it to work for Cygwin.

To test, run some command via network, and then type `show name` into the terminal. On Cygwin, it will not respond.
2017-07-22 03:34:10 -04:00
Olli Helenius a38d3d6c69 Delegate ansiCodesSupported to ConsoleAppender
Fixes sbt/sbt#3336.
2017-07-18 19:57:57 +03:00
Martin Duhem ddcc909195 Re-fix ConsoleAppender
It turns out that calling `print` on `ConsoleOut` doesn't flush the
output. Remove `writeLine` and let `write` directly use `println`.
2017-07-17 14:36:03 +02:00
Dale Wijnand 81277cbf62 Merge pull request #99 from dwijnand/prereset
Add a RESET at the front of the appendLog line
2017-07-17 10:55:39 +01:00
Dale Wijnand e744985b6b
Add a RESET at the front of the appendLog line 2017-07-17 10:42:39 +01:00
Martin Duhem 28ab7ac79d
Fix logger printing too many newlines 2017-07-17 10:05:58 +02:00
Eugene Yokota 8d159b87a2 Fix test 2017-07-17 02:14:17 -04:00
eugene yokota 72f823c80b Merge pull request #91 from Duhemm/wip/cleanup-consoleappender
Cleanup `ConsoleAppender`
2017-07-15 13:17:02 -04:00
Eugene Yokota 8b5210f84d Bump to latest Contraband 2017-07-15 10:36:03 -04:00
eugene yokota 0e6e3a0a2c Merge branch '1.0' into wip/cleanup-consoleappender 2017-07-14 13:07:29 -04:00
jvican 18a73db57d
Remove unnecessary F0, F1 and Maybe
`F0`, `F1` and `Maybe` have become useless since Java 8 introduced
`Supplier`, `Function` and `Optional` in the default Java 8 standard
library.

Therefore, they are not necessary anymore. This change is required to
change some Zinc's and sbt APIs. They are not widely used, so the
changes will be small.
2017-07-14 15:56:34 +02:00
Eugene Yokota 19b3e47972 Fix casting error during initialization
While running scripted, you see

```
ERROR StatusLogger Unable to create custom ContextSelector. Falling back to default.
 java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.async.AsyncLoggerContextSelector to org.apache.logging.log4j.core.selector.ContextSelector
	at java.lang.Class.cast(Class.java:3369)
	at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:201)
	at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOfProperty(LoaderUtil.java:226)
	at org.apache.logging.log4j.core.impl.Log4jContextFactory.createContextSelector(Log4jContextFactory.java:97)
	at org.apache.logging.log4j.core.impl.Log4jContextFactory.<init>(Log4jContextFactory.java:58)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at java.lang.Class.newInstance(Class.java:442)
	at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:94)
	at org.apache.logging.log4j.spi.ThreadContextMapFactory.createThreadContextMap(ThreadContextMapFactory.java:73)
	at org.apache.logging.log4j.ThreadContext.init(ThreadContext.java:223)
	at org.apache.logging.log4j.ThreadContext.<clinit>(ThreadContext.java:202)
	at org.apache.logging.log4j.core.impl.ContextDataInjectorFactory.createDefaultInjector(ContextDataInjectorFactory.java:83)
	at org.apache.logging.log4j.core.impl.ContextDataInjectorFactory.createInjector(ContextDataInjectorFactory.java:67)
	at org.apache.logging.log4j.core.lookup.ContextMapLookup.<init>(ContextMapLookup.java:34)
	at org.apache.logging.log4j.core.lookup.Interpolator.<init>(Interpolator.java:117)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.<init>(AbstractConfiguration.java:125)
	at org.apache.logging.log4j.core.config.DefaultConfiguration.<init>(DefaultConfiguration.java:46)
	at org.apache.logging.log4j.core.layout.PatternLayout$Builder.build(PatternLayout.java:650)
	at org.apache.logging.log4j.core.layout.PatternLayout.createDefaultLayout(PatternLayout.java:487)
	at sbt.internal.util.ConsoleAppender.<init>(ConsoleAppender.scala:245)
```

This aims to workaround the casting error during PatternLayout.createDefaultLayout()
that was originally used for ConsoleAppender.
The stacktrace shows it's having issue initializing default DefaultConfiguration.
Since we currently do not use Layout inside ConsoleAppender, the actual pattern is not relevant.
2017-07-14 07:39:05 -04:00
Martin Duhem f55a509fdd
Cleanup `ConsoleAppender` 2017-07-11 16:08:58 +02:00
Dale Wijnand 9d7f7bf0ec
Remove modules that have moved back to sbt/sbt 2017-07-07 14:41:32 +01:00
Dale Wijnand dc2d4d613f
Format in-sourced util modules 2017-07-07 12:12:59 +01:00
Dale Wijnand 9494967e05
Upgrade util/lm/zinc & config build for util modules
Welcome back home!
2017-07-07 12:11:59 +01:00
Dale Wijnand a77d3146ab
Breakout Position to drop lm->collection dep 2017-07-07 09:50:39 +01:00