Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
change verison 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zavakid committed Nov 23, 2014
1 parent 64f55bf commit 8dc5fb0
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 27 deletions.
26 changes: 2 additions & 24 deletions src/sbt-test/sbt-one-log/multi/build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import java.io.File

val expected = Set[String](
"org.slf4j:log4j-over-slf4j:1.7.7"
,"org.slf4j:jcl-over-slf4j:1.7.7"
Expand Down Expand Up @@ -33,29 +31,9 @@ TaskKey[Unit]("check") <<= (allDeps) map { deps =>
()
}

TaskKey[Unit]("deleteLogback") := {
val resourceDir = (resourceDirectory in Compile).value
val resourceDirInTest = (resourceDirectory in Test).value
val logbackXML = resourceDir / "logback.xml"
val logbackTestXML = resourceDirInTest / "logback-test.xml"
logbackXML.delete()
logbackTestXML.delete()
}

TaskKey[Unit]("checkLogback") := {
val resourceDir = (resourceDirectory in Compile).value
val resourceDirInTest = (resourceDirectory in Test).value
val logbackXML = resourceDir / "logback.xml"
val logbackTestXML = resourceDirInTest / "logback-test.xml"
if(!logbackXML.exists()) error(s"$logbackXML is not generated")
if(!logbackTestXML.exists()) error(s"$logbackTestXML is not generated")
}

val allDeps = taskKey[Seq[ModuleID]]("get all dependency with transivate modueID")

allDeps <<= (externalDependencyClasspath in Compile) map {
cp =>
cp.flatMap(_.get(Keys.moduleID.key))
cp =>
cp.flatMap(_.get(Keys.moduleID.key))
}

net.virtualvoid.sbt.graph.Plugin.graphSettings
39 changes: 39 additions & 0 deletions src/sbt-test/sbt-one-log/multi/module1/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
val expected = Set[String](
"org.slf4j:log4j-over-slf4j:1.7.7"
,"org.slf4j:jcl-over-slf4j:1.7.7"
,"org.slf4j:jul-to-slf4j:1.7.7"
,"org.slf4j:slf4j-api:1.7.7"
,"ch.qos.logback:logback-classic:1.1.2"
,"ch.qos.logback:logback-core:1.1.2"
,"commons-logging:commons-logging:99-empty"
,"commons-logging:commons-logging-api:99-empty"
,"log4j:log4j:99-empty"
,"com.typesafe.scala-logging:scala-logging-api_2.10:2.1.2"
,"com.typesafe.scala-logging:scala-logging-slf4j_2.10:2.1.2"
)

val excluded = Set[(String,String)](
"org.slf4j" -> "slf4j-log4j12",
"org.slf4j" -> "slf4j-jcl",
"org.slf4j" -> "slf4j-jdk14"
)

TaskKey[Unit]("check") <<= (allDeps) map { deps =>
val all = deps.map(_.toString).toSet
expected.foreach{ ept =>
if(!all.contains(ept)) error(s"libraryDependencies [$ept] error!")
}
//if(!expected.subsetOf(deps.map(_.toString).toSet))
// error("libraryDependencies error!")
deps.map(d => (d.organization,d.name)).foreach{ d =>
if(excluded.contains(d)) error(s"excludeDependencies [$d] error!")
}
()
}

val allDeps = taskKey[Seq[ModuleID]]("get all dependency with transivate modueID")

allDeps <<= (externalDependencyClasspath in Compile) map {
cp =>
cp.flatMap(_.get(Keys.moduleID.key))
}
37 changes: 37 additions & 0 deletions src/sbt-test/sbt-one-log/multi/module2/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
val expected = Set[String](
"org.slf4j:jcl-over-slf4j:1.7.7"
,"org.slf4j:jul-to-slf4j:1.7.7"
,"org.slf4j:slf4j-api:1.7.7"
,"ch.qos.logback:logback-classic:1.1.2"
,"ch.qos.logback:logback-core:1.1.2"
,"commons-logging:commons-logging:99-empty"
,"commons-logging:commons-logging-api:99-empty"
,"com.typesafe.scala-logging:scala-logging-api_2.10:2.1.2"
,"com.typesafe.scala-logging:scala-logging-slf4j_2.10:2.1.2"
)

val excluded = Set[(String,String)](
"org.slf4j" -> "slf4j-log4j12",
"org.slf4j" -> "slf4j-jcl",
"org.slf4j" -> "slf4j-jdk14"
)

TaskKey[Unit]("check") <<= (allDeps) map { deps =>
val all = deps.map(_.toString).toSet
expected.foreach{ ept =>
if(!all.contains(ept)) error(s"libraryDependencies [$ept] error!")
}
//if(!expected.subsetOf(deps.map(_.toString).toSet))
// error("libraryDependencies error!")
deps.map(d => (d.organization,d.name)).foreach{ d =>
if(excluded.contains(d)) error(s"excludeDependencies [$d] error!")
}
()
}

val allDeps = taskKey[Seq[ModuleID]]("get all dependency with transivate modueID")

allDeps <<= (externalDependencyClasspath in Compile) map {
cp =>
cp.flatMap(_.get(Keys.moduleID.key))
}
36 changes: 36 additions & 0 deletions src/sbt-test/sbt-one-log/multi/module3/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
val expected = Set[String](
"org.slf4j:log4j-over-slf4j:1.7.7"
,"org.slf4j:jul-to-slf4j:1.7.7"
,"org.slf4j:slf4j-api:1.7.7"
,"ch.qos.logback:logback-classic:1.1.2"
,"ch.qos.logback:logback-core:1.1.2"
,"log4j:log4j:99-empty"
,"com.typesafe.scala-logging:scala-logging-api_2.10:2.1.2"
,"com.typesafe.scala-logging:scala-logging-slf4j_2.10:2.1.2"
)

val excluded = Set[(String,String)](
"org.slf4j" -> "slf4j-log4j12",
"org.slf4j" -> "slf4j-jcl",
"org.slf4j" -> "slf4j-jdk14"
)

TaskKey[Unit]("check") <<= (allDeps) map { deps =>
val all = deps.map(_.toString).toSet
expected.foreach{ ept =>
if(!all.contains(ept)) error(s"libraryDependencies [$ept] error!")
}
//if(!expected.subsetOf(deps.map(_.toString).toSet))
// error("libraryDependencies error!")
deps.map(d => (d.organization,d.name)).foreach{ d =>
if(excluded.contains(d)) error(s"excludeDependencies [$d] error!")
}
()
}

val allDeps = taskKey[Seq[ModuleID]]("get all dependency with transivate modueID")

allDeps <<= (externalDependencyClasspath in Compile) map {
cp =>
cp.flatMap(_.get(Keys.moduleID.key))
}
6 changes: 6 additions & 0 deletions src/sbt-test/sbt-one-log/multi/test
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
> check
> project module1
> check
> project module2
> check
> project module3
> check
4 changes: 2 additions & 2 deletions src/sbt-test/sbt-one-log/simple/test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
> check
> deleteLogback
> generateLogbackXML
> test:generateLogbackXML
> generateLogbackXml
> test:generateLogbackXml
> checkLogback

2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "1.0-SNAPSHOT"
version in ThisBuild := "1.0.0"

0 comments on commit 8dc5fb0

Please sign in to comment.