Commit Graph

98 Commits

Author SHA1 Message Date
frosforever d1cf37b2ca Update Tests.Group to be bin compat by manually implementing case class methods 2020-05-04 09:29:31 -04:00
frosforever b2942f6321 Add user defined tags to Tests.Group 2020-05-04 09:29:31 -04:00
Ethan Atkins 7902ec3b7d Add Terminal abstraction
This commit aims to centralize all of the terminal interactions
throughout sbt. It also seeks to hide the jline implementation details
and only expose the apis that sbt needs for interacting with the
terminal.

In general, we should be able to assume that the terminal is in
canonical (line buffered) mode with echo enabled. To switch to raw mode
or to enable/disable echo, there are apis: Terminal.withRawSystemIn and
Terminal.withEcho that take a thunk as parameter to ensure that the
terminal is reset back to the canonical mode afterwards.
2020-05-01 12:35:43 -07:00
Eugene Yokota 3ce4d22b84 integrate with VirtualFile changes
Ref https://github.com/sbt/zinc/pull/712
2020-04-24 17:44:14 -04:00
Eugene Yokota b97de940a5 Make val loading order top-to-bottom
Fixes #2232

Within `build.sbt` this makes sure that definitions are ordered from top to bottom.
This matters when multiple subprojects refer to the same setting (probably not a good practice).
2020-02-22 04:45:34 -05: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
Arnout Engelen ceb28a0a41 Target 1.4.0 2019-12-24 10:11:09 +01:00
Arnout Engelen 52b72a7e14 Target 1.4.0 2019-12-24 10:11:09 +01:00
Arnout Engelen 21533863da Don't emit timestamps when packaging to jar
This makes the build more deterministic.
2019-12-24 10:11:09 +01:00
Eugene Yokota 54b3405f42 apply -Yno-lub
To demonstrate [-Yno-lub](http://eed3si9n.com/stricter-scala-with-ynolub), this shows the code changes that removes lubing (Not all subprojects are done).

After I made the changes, I switched the Scala back to normal 2.12.10.
2019-10-13 23:46:23 -04:00
Ethan Atkins 7c2a1c858b 1.3.0
-----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJdbz/aAAoJEDeJDimNmiv6Am8IAKv23f6BPIWZFeokzJLkUt8v
 DDLyzIwzE0hTFKInCNhGDCFtACFFgoD8/7t9D5gmLttQr4F9ke94DqWBEP3kbgan
 Qb4rR8uwglPUJmOhzBj2Qs3A8fAXdg3wm/6OlllQzBwCYNxFf3MhmJc3hF4vd+jO
 93JqwbY50entqha9z299+NpLPTKWtVC5R+1pAF+LwObjLOYqlxiGvAcl7jWx1qte
 VN+BabBYT4Hw43kJCutglHu8vttG68m+fqYGxjAmZXYBAbn0NPyE7GHmqkQ5baAz
 DUbc0vU2nY6tpUFNlNfu9PTPnRwHdSjSJTa9Ug7hw24z2oTg2tapNDXIpt6n6ZA=
 =onwH
 -----END PGP SIGNATURE-----

Merge tag 'v1.3.0' into 1.3.x-merge

1.3.0
2019-09-05 10:15:41 -07:00
Ethan Atkins b996675c93 Name test tasks with the test name
Ref https://github.com/sbt/sbt/issues/4911. This names each parallel
test task with the name of the task so that supershell can display it.
It only applies for parallel tests. When run sequentially, supershell
will still display executeTests.
2019-09-02 14:58:49 -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
Eugene Yokota 9512a60fa6 Fix java.util.zip.ZipException: duplicate entry
Fixes #4889

#4329 switched from using Map to Seq during packaging. That allowed multiple files to be included with different paths, but it also started admitting duplicate files causing ZipException.
2019-07-23 01:28:32 -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
Akhtyam Sakaev 3ea9f8a71b
fix typo 2019-06-06 08:05:16 +03:00
Ethan Atkins 2deac62b00 Bump io
The newest version of io repackages a number of classes into the
sbt.nio.* packages. It also changes some of the semantics of glob
related apis. This commit updates all of the usages of the updated apis
within sbt but should have no functional difference.
2019-05-02 14:33:01 -07:00
Eugene Yokota 1e157b991a apply formatting 2019-04-20 03:23:54 -04:00
Jason Zaugg 3cbbe93c6e Avoid NPE on Run.<init> 2019-02-22 10:26:10 +10:00
Ethan Atkins 6725b39a84 Bump io to 1.3.0-M3
I had to turn off -Xfatal-warnings in commandProj because after updating
io, commandProj depends on the deprecated EventMonitor class. In #4335,
I stop using EventMonitor, but deprecate the Watched class which is both
defined and used (as an unused attribute key) in commandProj. I think we
can probably get rid of Watched in 1.4.x and certainly in a hypothetical
2.x, so hopefully we can restore -Xfatal-warnings sooner than later.

I also had to replace uses of IO.classLocationFile with
IO.classLocationPath to avoid compilation failures due to
-Xfatal-warnings.
2018-10-08 13:59:34 -07:00
Eugene Yokota 1465604f8c Demote "Done updating." log to debug level 2018-10-02 08:25:28 -04:00
Eugene Yokota 3e1dac5161 -Xfatal-warnings in most subprojects 2018-09-18 11:47:55 -04:00
eugene yokota 8af7a5acae
Merge pull request #4358 from eed3si9n/wip/license
Apache License 2.0
2018-09-14 11:11:17 -04:00
Eugene Yokota 4ff4f6e45e Update header 2018-09-14 04:53:36 -04:00
Eugene Yokota f3424e265c Formatting 2018-09-14 00:59:01 -04:00
Nepomuk Seiler 5989d07249 FIX #1972 fix lost package mappings with identical source file 2018-08-22 18:05:49 +02:00
xuwei-k ae1fdff968 use SAM type 2018-07-09 13:06:34 +09:00
Eugene Yokota 86427c7ce7 Merge branch '1.1.x' into wip/merge-1.1.x 2018-06-12 23:33:47 -04:00
dadarakt 39cac14ea7 Adapted syntax to match example 2018-05-15 14:25:49 +02:00
dadarakt e83013d3c8 Using outputChanged to track the change of the jar file instead of unit 2018-05-15 14:09:27 +02:00
Eugene Yokota 28e90ea09b Merge branch '1.1.x' into wip/merge-1.1.x 2018-04-29 14:31:30 -04:00
Eugene Yokota a798c4adff Re-fix console and JLine bug
Fixes #3482 take 3

There are two bugs related REPL and JLine.
1. JLine getting disabled (up arrow not working) on the second run of `console` task.
2. Typed characters not showing up even on the `console` task.

The first issue was fixed by #4054 which added `t.init`. When I noticed the second problem, I fixed it in #4082 (adds `t.restore`) but undid the first fix. This attempts to fix both the issues.
2018-04-25 16:55:26 -04:00
Dale Wijnand ebe5540226
Reformat some corner cases 2018-04-24 16:12:18 +01:00
Dale Wijnand 8f4b8abb7b
Run scalafmt & test:scalafmt 2018-04-24 16:12:10 +01:00
Eugene Yokota 8ed796fb25 Re-fixing console and JLine
Fixes #3482 take 2

I thought I tested #4054 using a local build, but when I ran 1.1.3, `console` did not display anything that I typed.
Switching to `usingTerminal` which calls `terminal.restore` similar to what I had in 1.1.1 fixes `console`.
2018-04-09 00:11:17 -04:00
Eugene Yokota 8781c16cbb bump IO and Zinc 2018-04-06 16:30:33 -04:00
Eugene Yokota ad3692b2df Use NIO Files.getLastModifiedTime for hashing 2018-04-05 04:22:16 -04:00
Eugene Yokota 04d6a8b44c perf: optimize hash for build
This hot path was discovered by retronym using FlameGraph.
This removes intermediate creation of Array.

`filesModifiedBytes` in particular was bad as it was going through all `*.class` files, each generating an Array. This replaces that with `fileModifiedHash` that accepts `MessageDigest`.

According to the flamegraph, evalCommon footprint reduced from 4.5% to 3.6%.
Using `time sbt reload reload reload exit`, the median reduced from 41.450s to 39.467s.
2018-04-05 03:26:02 -04:00
Eugene Yokota 88f50ce35d Fix console, JLine issue
Fixes #3482
2018-03-30 23:09:01 -04:00
Dale Wijnand 92ed849eaa
Remove import-excluding Predef.conforms
As of Scala 2.11 Predef.conforms isn't implicit anymore (and it's
deprecated), so import-excluding doesn't avoid the implicit (the
implicit version is now Predef.$conforms). Also in Scala 2.13
Predef.conforms has been removed.
2018-01-23 17:14:15 +00:00
Dale Wijnand 113656aed1
Remove compile warnings 2018-01-16 11:17:01 +00:00
Dale Wijnand a0b27d29b7
Merge pull request #3854 from sbt/1.1.x
1.1.x
2018-01-08 11:16:26 +00:00
Antonio Cunei 94e36a14c8 Change modifiedTime definitions 2017-12-22 01:55:37 +01:00
Antonio Cunei ebff7919e9 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 01:55:37 +01:00
eugene yokota 34d311f9ce
Merge pull request #3807 from dwijnand/remove-warnings
Remove warnings
2017-12-19 13:18:59 -05:00
Eugene Yokota 40b86ae412 bump modules and plugins 2017-12-16 12:22:42 -05:00
Dale Wijnand ae99922101 Use IO.getModified over importing the method 2017-12-16 12:22:42 -05:00
Antonio Cunei 46d6b01f79 Use copyLastModified() in Sync.scala
It turns out the code in Sync.scala activiely tries to transfer
the invalid modifed time of non-existent files in the source
directory over the time of the target file, which may or may
not exist. In case it exists, the modification time is set
to January 1, 1970. This is arguably a bug in Sync, which
should be adjusted to better handle mappings with source
files that do not exist. For now, however, we preserve the
current behavior, using the deprecated copyLastModified().
2017-12-16 12:22:42 -05:00
Antonio Cunei 295bcff851 Hash calculation may throw exception w/ getModifiedTime(); fix
In Eval there is a calculation of hashes by scanning the elements
of classpath, and getting the last modification time of each
directory. When lastModified() was in use, non-existent elements
would return 0L, but getModifiedTime() will throw an exception
instead (like getLastModifiedTime(), incidentally).
So, we catch the FileNotFoundException and return 0L now as well.
2017-12-16 12:22:42 -05:00
Antonio Cunei 2129f8ceb5 Use IO.copyModifiedTime() in place of IO.copyLastModified() 2017-12-16 12:22:42 -05:00