Skip to content

Commit

Permalink
Wip/build with sbt 1.0 (#1013)
Browse files Browse the repository at this point in the history
Upgrade sbt to 1.0.1
  • Loading branch information
muuki88 authored Sep 6, 2017
1 parent 8e8ead4 commit 8d4ad99
Show file tree
Hide file tree
Showing 18 changed files with 62 additions and 45 deletions.
14 changes: 13 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,46 @@
language: scala
language: java
scala: 2.12.3
os: linux

before_install:
- if [[ "$TRAVIS_OS_NAME" = "osx" ]]; then
brew update;
brew install xz;
brew install sbt;
fi
script: sbt "$SBT_TEST_CMD";

# We explicitly set the matrix to include oraclejdk8 because MacOS X has issues. See comment below
matrix:
include:
- jdk: oraclejdk8
language: scala
env: SBT_TEST_CMD="^validate"
- jdk: oraclejdk8
language: scala
env: SBT_TEST_CMD="^validateUniversal"
- jdk: oraclejdk8
language: scala
env: SBT_TEST_CMD="^validateJar"
- jdk: oraclejdk8
language: scala
env: SBT_TEST_CMD="^validateBash"
- jdk: oraclejdk8
language: scala
env: SBT_TEST_CMD="^validateAsh"
- jdk: oraclejdk8
language: scala
env: SBT_TEST_CMD="^validateRpm"
- jdk: oraclejdk8
language: scala
env: SBT_TEST_CMD="^validateDebian"
# for now we can't test the docker image generation on travis
- jdk: oraclejdk8
language: scala
env: SBT_TEST_CMD="^validateDockerUnit"
# jdk packaging is only available on jdk8+
- jdk: oraclejdk8
language: scala
env: SBT_TEST_CMD="^validateJdkPackagerTravis"
# oraclejdk8 is not yet available.
# see https://github.com/travis-ci/travis-ci/issues/2316
Expand All @@ -41,6 +52,7 @@ addons:
apt:
packages:
- rpm
- fakeroot

sudo: false
cache:
Expand Down
12 changes: 5 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sbtPlugin := true
name := "sbt-native-packager"
organization := "com.typesafe.sbt"

scalaVersion in Global := "2.10.6"
scalaVersion in Global := "2.12.3"

// crossBuildingSettings
crossSbtVersions := Vector("0.13.16", "1.0.0")
Expand Down Expand Up @@ -35,7 +35,7 @@ libraryDependencies ++= {
Seq(
// these dependencies have to be explicitly added by the user
"com.spotify" % "docker-client" % "3.5.13" % Provided,
"org.vafer" % "jdeb" % "1.3" % Provided artifacts Artifact("jdeb", "jar", "jar")
"org.vafer" % "jdeb" % "1.3" % Provided artifacts Artifact("jdeb", "jar", "jar")
)
}
}
Expand All @@ -54,13 +54,11 @@ libraryDependencies ++= {
}

// configure github page
enablePlugins(SphinxPlugin, SiteScaladocPlugin)
enablePlugins(SphinxPlugin, SiteScaladocPlugin, GhpagesPlugin)

ghpages.settings
git.remoteRepo := "[email protected]:sbt/sbt-native-packager.git"

// scripted test settings
scriptedSettings
scriptedLaunchOpts += "-Dproject.version=" + version.value

// Release configuration
Expand All @@ -80,7 +78,7 @@ releaseProcess := Seq[ReleaseStep](
setNextVersion,
commitNextVersion,
pushChanges,
releaseStepTask(GhPagesKeys.pushSite)
releaseStepTask(ghpagesPushSite)
)

// bintray config
Expand Down Expand Up @@ -112,4 +110,4 @@ addCommandAlias(
)

// TODO check the cygwin scripted tests and run them on appveyor
addCommandAlias("validateWindows", "; test-only * -- -n windows;scripted universal/dist universal/stage windows/*")
addCommandAlias("validateWindows", "; testOnly * -- -n windows ; scripted universal/dist universal/stage windows/*")
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.16
sbt.version=1.0.0
10 changes: 5 additions & 5 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.4")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.0")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.6")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0-M1")

libraryDependencies += "org.scala-sbt" % "scripted-plugin" % sbtVersion.value
libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value

// Scripted plugin needs to declare this as a dependency
libraryDependencies += "jline" % "jline" % "2.11"

// For our bintray publishing
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.1")

// For code formatting
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.10")
4 changes: 2 additions & 2 deletions src/sbt-test/windows/test-custom-main/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ TaskKey[Unit]("checkAppMain") := {
val process =
sys.process.Process("target/universal/stage/bin/test-custom-main.bat")
val out = (process !!)
if (out.trim != "App Main Method") error("unexpected output: " + out)
if (out.trim != "App Main Method") sys.error("unexpected output: " + out)
()
}

Expand All @@ -22,6 +22,6 @@ TaskKey[Unit]("checkCustomMain") := {
val process =
sys.process.Process("target/universal/stage/bin/test-custom-main.bat", Seq("-main", "CustomMain"))
val out = (process !!)
if (out.trim != "Custom Main Method") error("unexpected output: " + out)
if (out.trim != "Custom Main Method") sys.error("unexpected output: " + out)
()
}
2 changes: 1 addition & 1 deletion test-project-docker/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.16
sbt.version=1.0.1
5 changes: 2 additions & 3 deletions test-project-docker/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
lazy val root = Project("plugins", file(".")).dependsOn(plugin)

lazy val plugin = file("../").getCanonicalFile.toURI
lazy val packager = ProjectRef(file("../.."), "sbt-native-packager")
dependsOn(packager)

// needs to be added for the docker spotify client
libraryDependencies += "com.spotify" % "docker-client" % "3.5.13"
5 changes: 5 additions & 0 deletions test-project-docker/project/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Workaround to fix 'undefined setting error' :
// [error] Runtime reference to undefined setting:
// [error] test-project-simple-build/sbt:scalafmtOnCompile from */*:onLoad ((com.lucidchart.sbt.scalafmt.ScalafmtSbtPlugin.globalSettings) ScalafmtSbtPlugin.scala:16)

addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.10")
2 changes: 1 addition & 1 deletion test-project-jdkpackager/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.6
sbt.version=1.0.1
5 changes: 2 additions & 3 deletions test-project-jdkpackager/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
lazy val root = Project("plugins", file(".")) dependsOn (packager)

lazy val packager = file("..").getAbsoluteFile.toURI
lazy val packager = ProjectRef(file("../.."), "sbt-native-packager")
dependsOn(packager)
5 changes: 5 additions & 0 deletions test-project-jdkpackager/project/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Workaround to fix 'undefined setting error' :
// [error] Runtime reference to undefined setting:
// [error] test-project-simple-build/sbt:scalafmtOnCompile from */*:onLoad ((com.lucidchart.sbt.scalafmt.ScalafmtSbtPlugin.globalSettings) ScalafmtSbtPlugin.scala:16)

addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.10")
2 changes: 1 addition & 1 deletion test-project-simple/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.13
sbt.version=1.0.1
5 changes: 2 additions & 3 deletions test-project-simple/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
lazy val root = Project("plugins", file(".")) dependsOn (packager)

lazy val packager = file("..").getAbsoluteFile.toURI
lazy val packager = ProjectRef(file("../.."), "sbt-native-packager")
dependsOn(packager)

libraryDependencies += "org.vafer" % "jdeb" % "1.3" artifacts (Artifact("jdeb", "jar", "jar"))
5 changes: 5 additions & 0 deletions test-project-simple/project/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Workaround to fix 'undefined setting error' :
// [error] Runtime reference to undefined setting:
// [error] test-project-simple-build/sbt:scalafmtOnCompile from */*:onLoad ((com.lucidchart.sbt.scalafmt.ScalafmtSbtPlugin.globalSettings) ScalafmtSbtPlugin.scala:16)

addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.10")
15 changes: 4 additions & 11 deletions test-project-windows/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,19 @@ libraryDependencies ++= Seq("com.typesafe" % "config" % "1.2.1")

mainClass in Compile := Some("ExampleApp")

enablePlugins(JavaServerAppPackaging, WindowsPlugin, SystemdPlugin, UniversalPlugin)
enablePlugins(JavaAppPackaging)

// import com.typesafe.sbt.packager.Keys._
// import com.typesafe.sbt.packager.windows.WindowsPlugin

maintainer := "some-company <[email protected]>"

packageSummary := "some application"
packageDescription := """ Some useful description here """
version := "0.0.0.0"

wixProductId := "ce07be71-510d-414a-92d4-dff47631848b"

wixProductUpgradeId := "4552fb0e-e257-4dbd-9ecb-dba9dbacf425"

lightOptions := Seq("-ext", "WixUiExtension")

wixMajorVersion := 3
lightOptions := Seq("-ext", "WixUiExtension")

version := "0.0.0.0"

packageDescription := """ Some useful description here """

// these settings are conflicting
javaOptions in Universal ++= Seq("-J-Xmx64m", "-J-Xms64m", "-jvm-debug 12345")
Expand Down
2 changes: 1 addition & 1 deletion test-project-windows/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.7
sbt.version=1.0.1
7 changes: 2 additions & 5 deletions test-project-windows/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
lazy val root = Project("plugins", file(".")) dependsOn (packager)

lazy val packager = file("..").getAbsoluteFile.toURI

libraryDependencies += "org.vafer" % "jdeb" % "1.3" artifacts (Artifact("jdeb", "jar", "jar"))
lazy val packager = ProjectRef(file("../.."), "sbt-native-packager")
dependsOn(packager)
5 changes: 5 additions & 0 deletions test-project-windows/project/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Workaround to fix 'undefined setting error' :
// [error] Runtime reference to undefined setting:
// [error] test-project-simple-build/sbt:scalafmtOnCompile from */*:onLoad ((com.lucidchart.sbt.scalafmt.ScalafmtSbtPlugin.globalSettings) ScalafmtSbtPlugin.scala:16)

addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.10")

0 comments on commit 8d4ad99

Please sign in to comment.