-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MonoHashBuilder for staging the params via flow setters
Make MonoHash class abstract with static forwarding functions to MonoHashBuilder Add NoopLogger as default logger in MonoHashBuilder Inject current MonoHash version into monohash.properties Provide defaults through param.Config class Move CmdLineParser and relevant parameters into the param package Make Concurrency a first-class citizen with two modes: fixed and CPU-relative Move Logger.Level into a standalone enum in param.LogLevel Exclude tests in .monohash plan Bump SBT to 1.4.5
- Loading branch information
Showing
48 changed files
with
2,075 additions
and
856 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
!.git/ | ||
!.gitignore | ||
|
||
# Exclude tests | ||
!src/test/ | ||
|
||
# Exclude docs | ||
!LICENSE | ||
!README.md | ||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=1.4.4 | ||
sbt.version=1.4.5 |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import java.io._ | ||
import java.nio.charset.StandardCharsets | ||
import java.nio.file.Files | ||
import java.util.{Arrays => JArrays} | ||
|
||
import nu.studer.java.util.OrderedProperties | ||
|
||
object PropertiesVersion { | ||
/** Update the .properties file in the resources with latest version | ||
* and also do a roundtrip through java.util.Properties compatible | ||
* implementation to avoid encoding / escaping gotchas - for there are plenty */ | ||
def update(logger: sbt.Logger, propertiesFile: File, version: String): Unit = { | ||
val currentPropsBytes = Files.readAllBytes(propertiesFile.toPath) | ||
val props = { | ||
val tmp = new OrderedProperties.OrderedPropertiesBuilder() | ||
.withSuppressDateInComment(true) | ||
.build() | ||
tmp.load(new ByteArrayInputStream(currentPropsBytes)) | ||
tmp | ||
} | ||
|
||
props.setProperty("Version", version) | ||
val updatedPropsBytes = { | ||
val baos = new ByteArrayOutputStream | ||
props.store(baos, null) | ||
val body = new String(baos.toByteArray, StandardCharsets.ISO_8859_1) | ||
body.replace("\r", "").getBytes(StandardCharsets.ISO_8859_1) | ||
} | ||
|
||
val needsUpdate = !JArrays.equals(currentPropsBytes, updatedPropsBytes) | ||
if (needsUpdate) { | ||
logger.info("Updated: " + propertiesFile) | ||
Files.write(propertiesFile.toPath, updatedPropsBytes) | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=1.4.4 | ||
sbt.version=1.4.5 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
scalaVersion := "2.12.12" | ||
scalacOptions := Seq( | ||
"-deprecation", | ||
"-encoding", "UTF-8", | ||
"-language:_", | ||
"-unchecked", | ||
) | ||
|
||
libraryDependencies += "nu.studer" % "java-ordered-properties" % "1.0.4" |
Oops, something went wrong.