mirror of https://github.com/sbt/sbt.git
Pending test case for #805.
This commit is contained in:
parent
6755f2595b
commit
f93624d8a4
|
|
@ -0,0 +1,6 @@
|
|||
import sbt._
|
||||
import Keys._
|
||||
|
||||
object DefPlugin extends Plugin {
|
||||
val aValue = "demo"
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
lazy val stable = settingKey[Boolean]("Build stable release (true) or not (false).")
|
||||
|
||||
stable := (baseDirectory.value / "make-stable").exists
|
||||
|
||||
name := "def"
|
||||
|
||||
sbtPlugin := true
|
||||
|
||||
organization := "org.example"
|
||||
|
||||
version := ( if(stable.value) "1.0" else "1.1-SNAPSHOT" )
|
||||
|
||||
publishTo := {
|
||||
val base = baseDirectory.value / ( if(stable.value) "stable" else "snapshot" )
|
||||
Some( Resolver.file("local-" + base, base)(Resolver.ivyStylePatterns) )
|
||||
}
|
||||
|
||||
publishMavenStyle := false
|
||||
|
|
@ -0,0 +1 @@
|
|||
name := aValue
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
addSbtPlugin("org.example" % "def" % "latest.integration")
|
||||
|
||||
resolvers ++= {
|
||||
def r(tpe: String) = Resolver.file(s"local-$tpe", baseDirectory.value / ".." / tpe)(Resolver.ivyStylePatterns)
|
||||
r("stable") :: r("snapshot") :: Nil
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
$ mkdir stable snapshot
|
||||
|
||||
# publish 1.0, stable release to local-stable/ repository
|
||||
|
||||
$ copy-file changes/def.sbt def.sbt
|
||||
$ touch make-stable
|
||||
> reload
|
||||
> publish
|
||||
|
||||
# resolve that release for use as a plugin
|
||||
# this should fail because build.sbt won't find aValue,
|
||||
# which isn't in this release
|
||||
|
||||
$ delete make-stable
|
||||
$ delete def.sbt
|
||||
$ copy-file changes/use-plugins.sbt project/plugins.sbt
|
||||
$ copy-file changes/use-build.sbt build.sbt
|
||||
-> reload
|
||||
|
||||
# publish 1.1-SNAPSHOT to local-snapshot/ repository
|
||||
# this time, include aValue
|
||||
|
||||
$ delete project
|
||||
$ delete target
|
||||
$ delete build.sbt
|
||||
$ copy-file changes/def.sbt def.sbt
|
||||
$ copy-file changes/DefPlugin.scala DefPlugin.scala
|
||||
|
||||
> reload
|
||||
> publish
|
||||
|
||||
# resolve the latest.integration release, which should
|
||||
# get 1.1-SNAPSHOT and succeed because aValue is now available
|
||||
|
||||
$ delete def.sbt
|
||||
$ delete DefPlugin.scala
|
||||
$ copy-file changes/use-plugins.sbt project/plugins.sbt
|
||||
$ copy-file changes/use-build.sbt build.sbt
|
||||
> reload
|
||||
|
||||
Loading…
Reference in New Issue