Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include Lift and Scala version numbers in package name #27

Merged
merged 1 commit into from
Jan 10, 2018
Merged
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
22 changes: 15 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
val liftVersion = settingKey[String]("Lift Web Framework full version number")
val liftEdition = settingKey[String]("Lift Edition (such as 2.6 or 3.0)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to have these be settingKey instead of just val?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Building for multiple Scala versions is easy - we can just add crossScalaVersions (which I didn't add here because I see it in #26) and it works out of the box. However, I haven't seen so far anything like that for building against different library versions. With settingKey we can do just:

> set liftVersion:="2.6"
[info] Defining *:liftVersion
[info] The new value will be used by *:libraryDependencies, *:liftEdition
[info] Reapplying settings...
[info] Set current project to lift-formality (in build file:/Users/piotr/git/lift-formality/)

> package
(...)
[info] Packaging /Users/piotr/git/lift-formality/target/scala-2.11/lift-formality_2.6_2.11-1.1.0-SNAPSHOT.jar ...
[info] Done packaging.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. Fair enough!


name := "lift-formality"

organization := "com.hacklanta"

version := "1.1.0-SNAPSHOT"

scalaVersion := "2.11.8"
scalaVersion := "2.11.12"

liftVersion <<= liftVersion ?? "3.1.0"

liftEdition <<= liftVersion apply { _.substring(0,3) }

moduleName <<= (name, liftEdition) { (n, e) => n + "_" + e }

resolvers += "Sonatype Snapshots Repository" at "http://oss.sonatype.org/content/repositories/snapshots"

{
val liftVersion = "3.1.0"
libraryDependencies ++= Seq(
libraryDependencies <++= liftVersion { liftVersion =>
Seq(
"net.liftweb" %% "lift-webkit" % liftVersion,
"net.liftweb" %% "lift-testkit" % liftVersion % "test",
"org.mortbay.jetty" % "jetty" % "6.1.22" % "test"
"net.liftweb" %% "lift-testkit" % liftVersion % "test"
)
}

libraryDependencies ++= Seq(
"org.specs2" %% "specs2-core" % "3.8.5" % "test",
"org.specs2" %% "specs2-matcher-extra" % "3.8.5" % "test"
"org.specs2" %% "specs2-matcher-extra" % "3.8.5" % "test",
"org.mortbay.jetty" % "jetty" % "6.1.22" % "test"
)

scalacOptions ++= Seq("-deprecation","-feature","-Xfatal-warnings")
Expand Down