Commit Graph

33 Commits

Author SHA1 Message Date
Julien Richard-Foy 72bfb3f45a Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
eugene yokota b3aae681bf
Merge pull request #6711 from xuwei-k/fix-scala-2-13-warn
fix Scala 2.13 warnings
2021-11-14 21:53:57 -05:00
xuwei-k 535b15b83e fix Scala 2.13 warnings 2021-11-14 22:59:34 +09:00
xuwei-k aa8b1141f8 Update scalatest 2021-11-14 22:03:59 +09:00
João Ferreira dd411cac9f introduce a new new Input/Output: FileInput/FileOutput
* FileInput avoids the intermediate String parsing of PlainInput
* FileOuput also avoid the intermediate String representation of PlainOutput
2020-11-25 14:04:56 +00:00
Ethan Atkins c5f0ee0e59 Don't use last modified time of directories in doc
I noticed that sbt does a _lot_ of no-op docs in the sbt project.
Through some debugging, I determined that this was because the target
directory last modified time of some of the dependent projects would
change between runs. I'm not really sure why that was happening but
instead of computing the last modified time of the directory, we should
be checking the last modified time of the directory contents.

After this change a no-op `doc` in the sbt project returns in less than
one second on my mac. Before, it was more like 25-60 seconds (the upper
bound is one runs `doc` because `sbtRoot/doc` takes about a minute).
2020-01-13 13:11:09 -08:00
Ethan Atkins ad59e71b1a Add util headers
None of the util files had headers.
2019-12-08 10:29:22 -08:00
Alexey Vakhrenev c9e07b6010 fix FileHash equality 2019-08-29 18:03:00 +03:00
Ethan Atkins 7f112052bf Unbreak binary compatibility
We discovered in the community build that 1.3.0-RC4 breaks the
lucidchart scalafmt plugins. We can unbreak binary compatibility by
adding alternative classes.
2019-08-21 10:20:53 -07:00
James Roper 50b2ea6f83 Use byte arrays instead of lists of bytes in FileInfo
Fixes #206
2019-08-12 15:16:48 +10:00
Eugene Yokota 98ec0075f4 apply formatting 2019-04-20 23:23:13 -04:00
Eugene Yokota 7431dbdf1a throw error on deserialization error 2019-04-04 00:53:44 -04:00
Ethan Atkins 5b198b20be Add file FileInfo factory applys without io
It may be the case that the file property is already known and we can
avoid performing additional io by just passing in the value directly.
2019-02-05 10:00:27 -08:00
Jason Zaugg 65e2980e9d Avoid temporary string in JSON reading 2018-10-09 18:31:13 -04:00
Eugene Yokota cf0467609d -Xfatal-warnings 2018-09-19 22:46:38 -04:00
xuwei-k e97451d812 fix adapted argument warning
https://travis-ci.org/sbt/util/jobs/373445819#L517

```
[warn] /home/travis/build/sbt/util/util-cache/src/main/scala/sbt/util/Input.scala:19:23: No automatic adaptation here: use explicit parentheses.
[warn]         signature: Using.apply[R](src: Source)(f: T => R): R
[warn]   given arguments: input, IO.utf8
[warn]  after adaptation: Using((input, IO.utf8): (java.io.InputStream, java.nio.charset.Charset))
[warn]     Using.streamReader(input, IO.utf8) { reader =>
[warn]                       ^
```
2018-06-11 13:11:51 +09:00
Dale Wijnand 44a2f1d92c
Kill utilTesting
No need for a 1-line, 1-class jar
2018-02-23 18:16:30 +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
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 cd4346c5d7 Allow FileInfo for non-existent files with the new timestamps
FileInfo is used to wrap information like last modified time on
files that may or may not exist. Arguably, that does not make
much sense: the non-existent files should not lead to modification
file information, hashes, and a persistent serialized version of
the resulting meaningless information. However, considering that
the FileInfo information is serialized and saved, it is necessary
to preserve compatibility at this stage. Therefore the modification
time is explicitly set to zero for those files that do not exist
when each FileInfo is built.
2017-12-08 23:50:40 +01: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
Dale Wijnand d31b9c5093
Add, configure & enable Scalafmt 2017-08-10 11:44:24 +01:00
eugene yokota 64f1331408 Merge pull request #93 from eed3si9n/wip/cache
switch to using sjson-new-murmurhash for cache key
2017-07-15 13:16:50 -04:00
Eugene Yokota 8b5210f84d Bump to latest Contraband 2017-07-15 10:36:03 -04:00
Eugene Yokota b0b9dc5e0f switch to using sjson-new-murmurhash
The input validation for caching currently relies on having a stack of `scala.math.Equiv`, which is questionable since it can fallback to universal equality.

This is likely related to the intermittent caching behavior we are seeing in https://github.com/sbt/sbt/issues/3226
2017-07-14 12:27:06 -04: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
Eugene Yokota b912a58125 Fix tests 2017-07-01 08:00:19 -04:00
Eugene Yokota 4e01a35917 Contraband update 2017-07-01 07:47:19 -04:00
Eugene Yokota 32d6bf38cf send TraceEvent on crash
Fixes sbt/sbt#3234
2017-06-28 02:18:03 -04:00
Eugene Yokota f48848e5d4 Adds overrides for File-based caching
sbt/util#45 implemented caching using sjson-new. Now many of the functions take `CacheStore` that abstracts the caching ability.

sbt/sbt#3109 demonstrates that setting up CacheStore requires boilerplate involving concepts introduced in sbt 1.

This change adds back overrides using File by making assumption that majority of the time we would want standard JSON converter.
2017-04-17 10:24:54 -04:00