Skip to content
This repository was archived by the owner on May 22, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/scala/com/github/tkawachi/sbtlock/SbtLock.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ object SbtLock {
lines
.find(_.startsWith(DEPS_HASH_PREFIX))
.map(_.drop(DEPS_HASH_PREFIX.length))
.map(_.trim)
} else {
None
}
Expand Down
18 changes: 18 additions & 0 deletions src/sbt-test/sbt-lock/lineEndings/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// https://github.com/playframework/playframework/blob/2.2.3/framework/project/Dependencies.scala#L101
libraryDependencies += "com.typesafe.play" %% "play" % "2.2.3"

resolvers += Resolver.typesafeRepo("releases")

scalaVersion := "2.10.4"

TaskKey[Unit]("assertSbtLockHashIsUpToDate") := {
assert(
sbtLockHashIsUpToDate.value,
s"sbtLockHashIsUpToDate.value was not true"
)
}

TaskKey[Unit]("convertToWindowsLineEndings") := {
val lockFile = new File(Keys.baseDirectory.value, "lock.sbt")
IO.write(lockFile, IO.read(lockFile).replace("\n", "\r\n"))
}
7 changes: 7 additions & 0 deletions src/sbt-test/sbt-lock/lineEndings/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
val pluginVersion = System.getProperty("plugin.version")
if(pluginVersion == null)
sys.error("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
else addSbtPlugin("com.github.tkawachi" % "sbt-lock" % pluginVersion)
}
7 changes: 7 additions & 0 deletions src/sbt-test/sbt-lock/lineEndings/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
> lock
> reload
> assertSbtLockHashIsUpToDate

> convertToWindowsLineEndings
> reload
> assertSbtLockHashIsUpToDate