Last active
July 31, 2025 10:19
-
-
Save xuwei-k/d5cb85c4e1024cf25ef424b497768090 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sjsonnew.BasicJsonProtocol._ | |
import sbinary.DefaultProtocol._ | |
val classFileCount = TaskKey[Int]("classFileCount") | |
Seq(Compile, Test).map { scope => | |
scope / classFileCount := { | |
val s = streams.value.log | |
val dir = (scope / classDirectory).value | |
val current = (dir ** "*.class").get().size | |
val id = thisProject.value.id | |
val currentCount = s"[$id] current $current" | |
(scope / classFileCount).previous match { | |
case Some(previous) => | |
s.info(s"$currentCount, previous $previous, diff ${current - previous}") | |
case None => | |
s.info(currentCount) | |
} | |
current | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment