Skip to content

Commit b57cc6d

Browse files
committed
Release FoBo v1.7 for Lift v3.1 (Scala 2.11, 2.12)
1 parent 00fcfd6 commit b57cc6d

File tree

4 files changed

+116
-61
lines changed

4 files changed

+116
-61
lines changed

build.sbt

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -201,40 +201,60 @@ resolvers in ThisBuild ++= Seq(
201201
//##############
202202
libraryDependencies in ThisBuild <++= (liftVersion, liftEdition, version) {
203203
(v, e, mv) =>
204-
"net.liftweb" %% "lift-webkit" % v % "provided" ::
204+
"net.liftweb" %% "lift-webkit" % v % "provided" ::
205205
"net.liftweb" %% "lift-testkit" % v % "provided" ::
206-
Nil
206+
Nil
207207
}
208208

209-
libraryDependencies in ThisBuild <++= (scalaVersion, liftVersion) { (sv, lv) =>
210-
((sv, lv) match {
211-
case ("2.9.2", _) | ("2.9.1", _) | ("2.9.1-1", _) =>
209+
libraryDependencies in ThisBuild ++= {
210+
((scalaVersion.value, liftVersion.value) match {
211+
case ("2.10.4", _) | ("2.9.2", _) | ("2.9.1", _) | ("2.9.1-1", _) =>
212212
"org.specs2" %% "specs2" % "1.12.3" % "test"
213-
case ("2.10.4", _) => "org.specs2" %% "specs2" % "1.13" % "test"
214-
case (_, "2.6.2") => "org.specs2" %% "specs2" % "2.3.11" % "test"
215-
case (_, _) => "org.specs2" %% "specs2" % "3.7" % "test"
213+
case ("2.11.7", "2.6.2") | ("2.11.7", "2.6.3") =>
214+
"org.specs2" %% "specs2" % "2.3.11" % "test"
215+
case (_, "3.0.0") => "org.specs2" %% "specs2" % "3.7" % "test"
216+
case (_, "3.0.1") => "org.specs2" %% "specs2-core" % "3.8.6" % "test"
217+
case (_, _) =>
218+
"org.specs2" %% "specs2-core" % "3.8.6" % "test" //lift 3.1.x
216219
}) ::
217-
((sv, lv) match {
218-
case ("2.10.4", _) | ("2.9.2", _) | ("2.9.1", _) | ("2.9.1-1", _) =>
219-
"org.scalacheck" %% "scalacheck" % "1.10.0" % "test"
220-
case (_, "2.6.2") => "org.scalacheck" %% "scalacheck" % "1.11.4" % "test"
221-
case (_, _) => "org.specs2" %% "specs2-scalacheck" % "3.7" % "test"
222-
}) ::
223-
Nil
220+
((scalaVersion.value, liftVersion.value) match {
221+
case ("2.10.4", _) | ("2.9.2", _) | ("2.9.1", _) | ("2.9.1-1", _) =>
222+
"org.specs2" %% "specs2" % "1.12.3" % "test"
223+
case ("2.11.7", "2.6.2") | ("2.11.7", "2.6.3") =>
224+
"org.specs2" %% "specs2" % "2.3.11" % "test"
225+
case (_, "3.0.0") =>
226+
"org.specs2" %% "specs2" % "3.7" % "test" //no mather extras for 3.7
227+
case (_, "3.0.1") =>
228+
"org.specs2" %% "specs2-matcher-extra" % "3.8.6" % "test"
229+
case (_, _) =>
230+
"org.specs2" %% "specs2-matcher-extra" % "3.8.6" % "test" //lift 3.1.x
231+
}) ::
232+
((scalaVersion.value, liftVersion.value) match {
233+
case (_, "2.6.2") | (_, "2.6.3") =>
234+
"org.scalacheck" %% "scalacheck" % "1.10.1" % "test"
235+
case (_, "3.0.0") =>
236+
"org.specs2" %% "specs2-scalacheck" % "3.7" % "test"
237+
case (_, "3.0.1") =>
238+
"org.specs2" %% "specs2-scalacheck" % "3.8.6" % "test"
239+
case (_, _) =>
240+
"org.specs2" %% "specs2-scalacheck" % "3.8.6" % "test" //lift 3.1.x
241+
}) ::
242+
Nil
224243
}
225244

226-
libraryDependencies in ThisBuild <++= liftVersion { lv =>
227-
(lv match {
228-
case "2.6.2" => "javax.servlet" % "servlet-api" % "2.5" % "provided,test"
229-
case _ => "javax.servlet" % "javax.servlet-api" % "3.1.0" % "provided,test"
245+
libraryDependencies in ThisBuild ++= {
246+
(liftVersion.value match {
247+
case "2.6.2" | "2.6.3" =>
248+
"javax.servlet" % "servlet-api" % "2.5" % "provided,test"
249+
case _ => "javax.servlet" % "javax.servlet-api" % "3.1.0" % "provided,test"
230250
}) ::
231251
Nil
232252
}
233253

234254
libraryDependencies in ThisBuild ++= {
235-
"ch.qos.logback" % "logback-classic" % "1.0.0" % "provided" ::
236-
"log4j" % "log4j" % "1.2.16" % "provided" ::
237-
Nil
255+
"ch.qos.logback" % "logback-classic" % "1.2.3" % "provided" ::
256+
"log4j" % "log4j" % "1.2.17" % "provided" ::
257+
Nil
238258
}
239259

240260
//##

project/autobuildscript/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ To publish use the publish.sh script, to change to a local publish replace 'publ
1010

1111
As of FoBo v1.4 builds against Lift 2.5 is no longer supported.
1212

13-
./project/autobuildscript/publish.sh -t [2.5,2.6,3.0]
13+
./project/autobuildscript/publish.sh -t [2.5,2.6,3.0,3.1]
1414

1515
The build script will make sure the correct JDK is set and execute one of the following
1616
sbt command files depending on chosen input (target) parameter.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
alias pub=publish-signed
2+
3+
set version in ThisBuild:="1.7"
4+
5+
set liftVersion in ThisBuild:="3.1.0-RC1"
6+
set scalaVersion in ThisBuild:="2.12.2"
7+
8+
project fobo
9+
clean
10+
clean-files
11+
set parallelExecution in Test := false
12+
; compile ; test ; pub
13+
14+
set scalaVersion in ThisBuild:="2.11.11"
15+
16+
project fobo
17+
clean
18+
clean-files
19+
set parallelExecution in Test := false
20+
; compile ; test ; pub

project/autobuildscript/publish.sh

Lines changed: 53 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ LIFT_TARGET="empty"
1717
#sbt command files targeting different Lift versions, see respective files for more information.
1818
PUBLISH_25_SBT_COMMAND_FILE=${PWD}/project/autobuildscript/build-publish-Lift25.txt
1919
PUBLISH_26_SBT_COMMAND_FILE=${PWD}/project/autobuildscript/build-publish-Lift26.txt
20-
PUBLISH_30_SBT_COMMAND_FILE=${PWD}/project/autobuildscript/build-publish-Lift3.txt
20+
PUBLISH_30_SBT_COMMAND_FILE=${PWD}/project/autobuildscript/build-publish-Lift30.txt
21+
PUBLISH_31_SBT_COMMAND_FILE=${PWD}/project/autobuildscript/build-publish-Lift31.txt
2122
#default location's for java on a ubuntu system
2223
JAVA_6_PATH=/usr/lib/jvm/java-6-oracle/jre/bin/java
2324
JAVA_7_PATH=/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
2425
JAVA_8_PATH=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
2526
LOG_FILE=build.log
26-
27+
2728
while getopts t: opts; do
2829
case ${opts} in
2930
t) LIFT_TARGET=${OPTARG} ;;
@@ -38,93 +39,107 @@ function die {
3839

3940
#If $DO_DEBUG=0 then echo provided information
4041
function debug {
41-
if [[ $DO_DEBUG == 0 ]]; then
42+
if [[ $DO_DEBUG == 0 ]]; then
4243
echo -e $@
4344
else
4445
echo -n ""
4546
fi
4647
}
4748

4849
#Validation: Check if provided path is the current set java path.
49-
#This function only works on a ubuntu system.
50+
#This function only works on a ubuntu system.
5051
function currentJavaPathIsSetTo() {
5152
local lsalPart=$1
52-
curr_java_path=$(ls -al /etc/alternatives/java)
53-
if [[ $curr_java_path == *${lsalPart}* ]]; then
54-
return 0
55-
else
56-
return 1
57-
fi
53+
curr_java_path=$(ls -al /etc/alternatives/java)
54+
if [[ $curr_java_path == *${lsalPart}* ]]; then
55+
return 0
56+
else
57+
return 1
58+
fi
5859
}
5960

60-
#This function has the effect of, if needed, trying to set the required java path
61+
#This function has the effect of, if needed, trying to set the required java path
6162
#The function will return 0 if the required java version is or has been successfully set.
6263
function requiredJavaIsSuccessfullySet() {
6364
local javaPath=$1
64-
if ! currentJavaPathIsSetTo $javaPath ; then
65-
setJDKEnvironment $javaPath
65+
if ! currentJavaPathIsSetTo $javaPath ; then
66+
setJDKEnvironment $javaPath
6667
fi
67-
if currentJavaPathIsSetTo $javaPath ; then
68+
if currentJavaPathIsSetTo $javaPath ; then
6869
return 0
6970
else
7071
return 1
71-
fi
72+
fi
7273
}
7374

7475
#This function sets the JDK environment in a ubuntu system.
7576
function setJDKEnvironment() {
7677
local javaPath=$1
7778
debug "Need to switching JDK version "
78-
sudo update-alternatives --set java $javaPath
79-
}
79+
sudo update-alternatives --set java $javaPath
80+
}
81+
8082

81-
8283
#Execute the necessary steps for publishing a Lift 2.5 module build
8384
function do25Publish {
8485
debug "\nTarget is set to Lift v2.5, require java-6";
85-
if ! requiredJavaIsSuccessfullySet $JAVA_6_PATH ; then
86+
if ! requiredJavaIsSuccessfullySet $JAVA_6_PATH ; then
8687
die "java-6 dosen't seem to be present, cancelling release build!"
8788
fi
88-
debug "Current java environment is java-6"
89-
debug "\n***Start processing the sbt command file.***\n"
89+
debug "Current java environment is java-6"
90+
debug "\n***Start processing the sbt command file.***\n"
9091
sbt < $PUBLISH_25_SBT_COMMAND_FILE 2>&1|tee ${LOG_FILE}
91-
debug "\n***...done processing the sbt command file***\n"
92+
debug "\n***...done processing the sbt command file***\n"
9293
}
9394

9495
#Execute the necessary steps for publishing a Lift 2.6 module build
9596
function do26Publish {
9697
debug "\nTarget is set to Lift v2.6, require java-6";
97-
if ! requiredJavaIsSuccessfullySet $JAVA_6_PATH ; then
98+
if ! requiredJavaIsSuccessfullySet $JAVA_6_PATH ; then
9899
die "java-6 dosen't seem to be present, cancelling release build!"
99-
fi
100-
debug "Current java environment is java-6"
101-
debug "\n***Start processing the sbt command file.***\n"
100+
fi
101+
debug "Current java environment is java-6"
102+
debug "\n***Start processing the sbt command file.***\n"
102103
sbt < $PUBLISH_26_SBT_COMMAND_FILE 2>&1|tee ${LOG_FILE}
103-
debug "\n***...done processing the sbt command file***\n"
104+
debug "\n***...done processing the sbt command file***\n"
104105
}
105106

106107
#Execute the necessary steps for publishing a Lift 3.0 module build
107108
function do30Publish {
108109
debug "\nTarget is set to Lift v3.0, require java-8";
109-
if ! requiredJavaIsSuccessfullySet $JAVA_8_PATH ; then
110+
if ! requiredJavaIsSuccessfullySet $JAVA_8_PATH ; then
110111
die "java-8 dosen't seem to be present, cancelling release build!"
111-
fi
112-
debug "Current java environment is java-8\n"
113-
debug "\n***Start processing the sbt command file.***\n"
114-
sbt < $PUBLISH_30_SBT_COMMAND_FILE 2>&1|tee ${LOG_FILE}
115-
debug "\n***...done processing the sbt command file***\n"
112+
fi
113+
debug "Current java environment is java-8\n"
114+
debug "\n***Start processing the sbt command file.***\n"
115+
sbt < $PUBLISH_30_SBT_COMMAND_FILE 2>&1|tee ${LOG_FILE}
116+
debug "\n***...done processing the sbt command file***\n"
117+
}
118+
119+
#Execute the necessary steps for publishing a Lift 3.1 module build
120+
function do31Publish {
121+
debug "\nTarget is set to Lift v3.1, require java-8";
122+
if ! requiredJavaIsSuccessfullySet $JAVA_8_PATH ; then
123+
die "java-8 dosen't seem to be present, cancelling release build!"
124+
fi
125+
debug "Current java environment is java-8\n"
126+
debug "\n***Start processing the sbt command file.***\n"
127+
sbt < $PUBLISH_31_SBT_COMMAND_FILE 2>&1|tee ${LOG_FILE}
128+
debug "\n***...done processing the sbt command file***\n"
116129
}
117130

118131
function runMain {
119132
if [ $LIFT_TARGET == "2.5" ]; then {
120133
do25Publish
121-
} elif [ $LIFT_TARGET == "2.6" ]; then {
122-
do26Publish
123-
} elif [ $LIFT_TARGET == "3.0" ]; then {
134+
} elif [ $LIFT_TARGET == "2.6" ]; then {
135+
do26Publish
136+
} elif [ $LIFT_TARGET == "3.0" ]; then {
124137
do30Publish
125-
} else
138+
} elif [ $LIFT_TARGET == "3.1" ]; then {
139+
do31Publish
140+
} else
126141
echo -e "\nNo target set! You need to specify a Lift version as target.\nUsage ./project/autobuildscript/publish.sh -t [2.5,2.6,3.0]\n";
127142
fi
128143
}
129144

130-
runMain
145+
runMain

0 commit comments

Comments
 (0)