Commit Graph

158 Commits

Author SHA1 Message Date
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 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
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
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
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 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
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
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 f4eadfc259 Merge pull request #129 from sbt/1.0.x
Merge 1.0.x
2017-10-02 10:23:02 +01:00
Eugene Yokota ddb6a13feb Provide JValue pass-through 2017-09-24 06:36:18 -04: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 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 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
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 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 48d82f95c2
Breakout Position to drop lm->collection dep 2017-07-03 12:04:45 +01:00
Dale Wijnand 84180ec402
Move Showlines to logging to drop logging->collection dep 2017-07-03 12:04:45 +01:00
Dale Wijnand f8d67d6837
Move HListFormats to collection to drop cache->collection dep
Looks like the reason that util-cache depended on util-collection was to
define the sjson-new formats (HListFormats) for util-collection's HList.
Given that util-collection already depends on sjsonnew, HListFormats can
also be defined in util-collection.

All that was left then was (a) HListFormatSpec requires
sjsonnewScalaJson, so that was added in test scope, and (b) HListFormats
had to be dropped from sbt.util.CacheImplicits - HListFormats will have
to be imported and/or mixed-in where required downstream. For importing
convenience I defined a companion object.
2017-07-03 12:04:44 +01:00