Browse files

Get the build ready for publishing releases

Not sure this is quite right, but closer than before.
  • Loading branch information...
1 parent 0ff5f1f commit 2365db970e3903f82edb5289d50efddbceaad2ae @havocp havocp committed Nov 30, 2011
View
30 build.sbt
@@ -1,11 +1,27 @@
-version in GlobalScope := "0.1"
+// to release, bump major/minor/micro as appropriate,
+// drop SNAPSHOT, tag and publish.
+// add snapshot back so git master is previous release
+// with -SNAPSHOT.
+// when releasing a SNAPSHOT to the repo, bump the micro
+// version at least.
+// Also, change the version number in the README.md
+// Versions and git tags should follow: http://semver.org/
+// except using -SNAPSHOT instead of without hyphen.
-// no binary for the root project
-publishArtifact in (Compile, packageBin) := false
+version in GlobalScope := "0.1.0-SNAPSHOT"
-// no javadoc for the root project
-publishArtifact in (Compile, packageDoc) := false
+organization in GlobalScope := "com.typesafe.config"
-// no source for the root project
-publishArtifact in (Compile, packageSrc) := false
+scalacOptions in GlobalScope in Compile := Seq("-unchecked", "-deprecation")
+
+scalacOptions in GlobalScope in Test := Seq("-unchecked", "-deprecation")
+
+publishTo in GlobalScope <<= (isSnapshot) { snapshot =>
+ import Classpaths._
+ Some(if (snapshot) typesafeSnapshots else typesafeResolver)
+}
+
+publishMavenStyle in GlobalScope := true
+
+credentials in GlobalScope += Credentials(Path.userHome / ".ivy2" / ".typesafe-credentials")
View
4 config/build.sbt
@@ -10,6 +10,8 @@ fork in run := true
fork in run in Test := true
+autoScalaLibrary := false
+
libraryDependencies += "net.liftweb" %% "lift-json" % "2.4-SNAPSHOT" % "test"
libraryDependencies += "com.novocode" % "junit-interface" % "0.7" % "test"
@@ -28,4 +30,4 @@ seq(javadocSettings: _*)
JavadocKeys.javadocOptions += "-exclude com.typesafe.config.impl"
-doc := error("use the 'javadoc' task instead of 'doc'")
+doc in Compile <<= JavadocKeys.javadoc
View
0 examples/complex-app/build.sbt
No changes.
View
0 examples/simple-app/build.sbt
No changes.
View
0 examples/simple-lib/build.sbt
No changes.
View
31 project/Build.scala
@@ -2,21 +2,42 @@ import sbt._
import Keys._
object ConfigBuild extends Build {
+ val unpublished = Seq(
+ // no artifacts in this project
+ publishArtifact := false,
+ // make-pom has a more specific publishArtifact setting already
+ // so needs specific override
+ publishArtifact in makePom := false,
+ // can't seem to get rid of ivy files except by no-op'ing the entire publish task
+ publish := {},
+ publishLocal := {}
+ )
+
+ // this is in newer sbt versions, for now cut-and-pasted
+ val isSnapshot = SettingKey[Boolean]("is-snapshot", "True if the the version of the project is a snapshot version.")
+
+ override val settings = super.settings ++ Seq(isSnapshot <<= isSnapshot or version(_ endsWith "-SNAPSHOT"))
+
lazy val root = Project(id = "root",
- base = file(".")) aggregate(testLib, configLib, simpleLib, simpleApp)
+ base = file("."),
+ settings = Project.defaultSettings ++ unpublished) aggregate(testLib, configLib, simpleLib, simpleApp)
lazy val configLib = Project(id = "config",
base = file("config")) dependsOn(testLib % "test->test")
lazy val testLib = Project(id = "test-lib",
- base = file("test-lib"))
+ base = file("test-lib"),
+ settings = Project.defaultSettings ++ unpublished)
lazy val simpleLib = Project(id = "simple-lib",
- base = file("examples/simple-lib")) dependsOn(configLib)
+ base = file("examples/simple-lib"),
+ settings = Project.defaultSettings ++ unpublished) dependsOn(configLib)
lazy val simpleApp = Project(id = "simple-app",
- base = file("examples/simple-app")) dependsOn(simpleLib)
+ base = file("examples/simple-app"),
+ settings = Project.defaultSettings ++ unpublished) dependsOn(simpleLib)
lazy val complexApp = Project(id = "complex-app",
- base = file("examples/complex-app")) dependsOn(simpleLib)
+ base = file("examples/complex-app"),
+ settings = Project.defaultSettings ++ unpublished) dependsOn(simpleLib)
}
View
9 test-lib/build.sbt
@@ -1,9 +0,0 @@
-
-// no binary
-publishArtifact in (Compile, packageBin) := false
-
-// no javadoc
-publishArtifact in (Compile, packageDoc) := false
-
-// no source
-publishArtifact in (Compile, packageSrc) := false

0 comments on commit 2365db9

Please sign in to comment.