mirror of https://github.com/sbt/sbt.git
commit
f514f4fb78
11
.travis.yml
11
.travis.yml
|
|
@ -6,7 +6,7 @@ language: scala
|
|||
|
||||
env:
|
||||
global:
|
||||
- TRAVIS_JDK=adopt@1.8.192-12
|
||||
- TRAVIS_JDK=adopt@1.11.0-1
|
||||
# WHITESOURCE_PASSWORD=
|
||||
- secure: d3bu2KNwsVHwfhbGgO+gmRfDKBJhfICdCJFGWKf2w3Gv86AJZX9nuTYRxz0KtdvEHO5Xw8WTBZLPb2thSJqhw9OCm4J8TBAVqCP0ruUj4+aqBUFy4bVexQ6WKE6nWHs4JPzPk8c6uC1LG3hMuzlC8RGETXtL/n81Ef1u7NjyXjs=
|
||||
matrix:
|
||||
|
|
@ -33,6 +33,15 @@ matrix:
|
|||
- SBT_CMD="scripted java/*"
|
||||
install:
|
||||
- /home/travis/.jabba/bin/jabba install openjdk@1.10
|
||||
- env:
|
||||
- TRAVIS_JDK=adopt@1.8.192-12
|
||||
- SBT_CMD="scripted actions/*"
|
||||
- env:
|
||||
- TRAVIS_JDK=adopt@1.8.192-12
|
||||
- SBT_CMD="scripted source-dependencies/*1of3"
|
||||
- env:
|
||||
- TRAVIS_JDK=adopt@1.8.192-12
|
||||
- SBT_CMD="scripted dependency-management/*1of4"
|
||||
|
||||
before_install:
|
||||
- curl -sL https://raw.githubusercontent.com/shyiko/jabba/0.11.0/install.sh | bash && . ~/.jabba/jabba.sh
|
||||
|
|
|
|||
|
|
@ -7,4 +7,4 @@ addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.4.1")
|
|||
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "3.0.2")
|
||||
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.8.0")
|
||||
addSbtPlugin("com.lightbend" % "sbt-whitesource" % "0.1.9")
|
||||
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.8")
|
||||
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.9")
|
||||
|
|
|
|||
|
|
@ -1,31 +1,29 @@
|
|||
inThisBuild(List(
|
||||
crossScalaVersions := Seq("2.12.1", "2.11.8")
|
||||
))
|
||||
lazy val scala212 = "2.12.8"
|
||||
lazy val scala213 = "2.13.0-M5"
|
||||
|
||||
ThisBuild / crossScalaVersions := Seq(scala212, scala213)
|
||||
ThisBuild / scalaVersion := scala212
|
||||
|
||||
lazy val rootProj = (project in file("."))
|
||||
.aggregate(libProj, fooPlugin)
|
||||
.settings(
|
||||
scalaVersion := "2.12.1"
|
||||
crossScalaVersions := Nil,
|
||||
addCommandAlias("build", "compile")
|
||||
)
|
||||
|
||||
lazy val libProj = (project in file("lib"))
|
||||
.settings(
|
||||
name := "foo-lib",
|
||||
scalaVersion := "2.12.1",
|
||||
crossScalaVersions := Seq("2.12.1", "2.11.8")
|
||||
name := "foo-lib"
|
||||
)
|
||||
|
||||
lazy val fooPlugin = (project in file("sbt-foo"))
|
||||
.enablePlugins(SbtPlugin)
|
||||
.settings(
|
||||
name := "sbt-foo",
|
||||
sbtPlugin := true,
|
||||
scalaVersion := "2.12.1",
|
||||
crossScalaVersions := Seq("2.12.1")
|
||||
crossScalaVersions := Seq(scala212)
|
||||
)
|
||||
|
||||
lazy val extrasProj = (project in file("extras"))
|
||||
.settings(
|
||||
name := "foo-extras",
|
||||
)
|
||||
|
||||
addCommandAlias("build", "compile")
|
||||
|
|
|
|||
|
|
@ -1,55 +1,43 @@
|
|||
> + compile
|
||||
|
||||
$ exists lib/target/scala-2.12
|
||||
$ exists lib/target/scala-2.11
|
||||
$ exists lib/target/scala-2.13.0-M5
|
||||
$ exists sbt-foo/target/scala-2.12
|
||||
-$ exists sbt-foo/target/scala-2.11
|
||||
-$ exists sbt-foo/target/scala-2.13.0-M5
|
||||
|
||||
> clean
|
||||
> + libProj/compile
|
||||
|
||||
$ exists lib/target/scala-2.12
|
||||
$ exists lib/target/scala-2.11
|
||||
$ exists lib/target/scala-2.13.0-M5
|
||||
-$ exists sbt-foo/target/scala-2.12
|
||||
-$ exists sbt-foo/target/scala-2.11
|
||||
-$ exists sbt-foo/target/scala-2.13.0-M5
|
||||
|
||||
# test safe switching
|
||||
> clean
|
||||
> ++ 2.12.1 compile
|
||||
|
||||
> ++ 2.12.8 -v compile
|
||||
$ exists lib/target/scala-2.12
|
||||
-$ exists lib/target/scala-2.11
|
||||
-$ exists lib/target/scala-2.13.0-M5
|
||||
$ exists sbt-foo/target/scala-2.12
|
||||
-$ exists sbt-foo/target/scala-2.11
|
||||
-$ exists sbt-foo/target/scala-2.13.0-M5
|
||||
|
||||
# Test legacy cross build with command support
|
||||
# > clean
|
||||
# > + build
|
||||
# $ exists lib/target/scala-2.12
|
||||
# $ exists lib/target/scala-2.13.0-M5
|
||||
# $ exists sbt-foo/target/scala-2.12
|
||||
# -$ exists sbt-foo/target/scala-2.13.0-M5
|
||||
|
||||
# Test ++ leaves crossScalaVersions unchanged
|
||||
> clean
|
||||
> ++ 2.11.8 -v compile
|
||||
> ++2.12.8
|
||||
> +extrasProj/compile
|
||||
$ exists extras/target/scala-2.13.0-M5
|
||||
$ exists extras/target/scala-2.12
|
||||
|
||||
$ exists lib/target/scala-2.11
|
||||
# test safe switching
|
||||
> clean
|
||||
> ++ 2.13.0-M5 -v compile
|
||||
$ exists lib/target/scala-2.13.0-M5
|
||||
-$ exists lib/target/scala-2.12
|
||||
# -$ exists sbt-foo/target/scala-2.12
|
||||
-$ exists sbt-foo/target/scala-2.11
|
||||
|
||||
# > clean
|
||||
# > ++ 2.11.8! compile
|
||||
|
||||
# $ exists lib/target/scala-2.11
|
||||
# -$ exists lib/target/scala-2.12
|
||||
# -$ exists sbt-foo/target/scala-2.12
|
||||
# $ exists sbt-foo/target/scala-2.11
|
||||
|
||||
> clean
|
||||
# Test legacy cross build with command support
|
||||
> + build
|
||||
|
||||
# Uses the root project scala version config, which is only configured to build for Scala 2.12
|
||||
$ exists lib/target/scala-2.12
|
||||
-$ exists lib/target/scala-2.11
|
||||
$ exists sbt-foo/target/scala-2.12
|
||||
-$ exists sbt-foo/target/scala-2.11
|
||||
|
||||
> clean
|
||||
# Test ++ leaves crossScalaVersions unchanged
|
||||
> ++2.12.1
|
||||
> +extrasProj/compile
|
||||
$ exists extras/target/scala-2.11
|
||||
$ exists extras/target/scala-2.12
|
||||
-$ exists sbt-foo/target/scala-2.13.0-M5
|
||||
|
|
|
|||
|
|
@ -1,13 +1,20 @@
|
|||
lazy val scala212 = "2.12.8"
|
||||
lazy val scala213 = "2.13.0-M5"
|
||||
|
||||
ThisBuild / scalaVersion := scala212
|
||||
|
||||
lazy val root = (project in file("."))
|
||||
.aggregate(core, module)
|
||||
.settings(
|
||||
crossScalaVersions := Nil
|
||||
)
|
||||
|
||||
lazy val core = (project in file("core"))
|
||||
.settings(
|
||||
scalaVersion := "2.12.4",
|
||||
crossScalaVersions := Seq("2.11.11", "2.12.4"))
|
||||
crossScalaVersions := Seq(scala212, scala213))
|
||||
|
||||
lazy val module = (project in file("module"))
|
||||
.dependsOn(core)
|
||||
.settings(
|
||||
scalaVersion := "2.12.4",
|
||||
crossScalaVersions := Seq("2.12.4"))
|
||||
crossScalaVersions := Seq(scala212)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
-> ++2.12.0-magic
|
||||
|
||||
> ++2.11.11 compile
|
||||
> ++2.13.0-M5 compile
|
||||
|
||||
$ exists core/target/scala-2.11
|
||||
-$ exists module/target/scala-2.11
|
||||
$ exists core/target/scala-2.13.0-M5
|
||||
-$ exists module/target/scala-2.13.0-M5
|
||||
-$ exists module/target/scala-2.12
|
||||
|
|
|
|||
|
|
@ -2,15 +2,16 @@ val newContents = "bbbbbbbbb"
|
|||
|
||||
val rootContentFile = "root.txt"
|
||||
|
||||
scalaVersion := "2.10.2"
|
||||
ThisBuild / scalaVersion := "2.12.8"
|
||||
|
||||
scalacOptions in (Compile, doc) := Seq("-doc-root-content", rootContentFile)
|
||||
|
||||
TaskKey[Unit]("changeRootContent") := {
|
||||
IO.write(file(rootContentFile), newContents)
|
||||
}
|
||||
|
||||
TaskKey[Unit]("check") := {
|
||||
val packageHtml = (target in Compile in doc).value / "package.html"
|
||||
assert(IO.read(packageHtml).contains(newContents), s"does not contains ${newContents} in ${packageHtml}" )
|
||||
}
|
||||
lazy val root = (project in file("."))
|
||||
.settings(
|
||||
Compile / doc / scalacOptions := Seq("-doc-root-content", rootContentFile),
|
||||
TaskKey[Unit]("changeRootContent") := {
|
||||
IO.write(file(rootContentFile), newContents)
|
||||
},
|
||||
TaskKey[Unit]("check") := {
|
||||
val packageHtml = (Compile / doc / target).value / "index.html"
|
||||
assert(IO.read(packageHtml).contains(newContents), s"does not contains ${newContents} in ${packageHtml}" )
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
lazy val root = (project in file("."))
|
||||
.settings(
|
||||
crossPaths := false,
|
||||
Compile / doc / scalacOptions += "-Xfatal-warnings"
|
||||
)
|
||||
|
|
@ -1,7 +1,3 @@
|
|||
> 'set crossPaths := false'
|
||||
|
||||
> 'set scalacOptions in (Compile, doc) += "-Xfatal-warnings"'
|
||||
|
||||
-> doc
|
||||
|
||||
> 'set sources in (Compile, doc) := { val src = (sources in Compile).value; src.filterNot(_.getName contains "B") }'
|
||||
|
|
@ -29,9 +25,9 @@ $ absent "target/api/java"
|
|||
> ; clean ; doc
|
||||
|
||||
# pure java project, only javadoc at top level
|
||||
$ exists "target/api/package-list"
|
||||
$ exists "target/api/index.html"
|
||||
$ absent "target/api/index.js"
|
||||
|
||||
# pending
|
||||
# pending
|
||||
# $ absent "target/api/scala"
|
||||
#$ absent "target/api/java"
|
||||
# $ absent "target/api/java"
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
scalaVersion := "2.11.8"
|
||||
|
||||
val buildInfo = taskKey[Seq[File]]("generates the build info")
|
||||
buildInfo := {
|
||||
val file = sourceManaged.value / "BuildInfo.scala"
|
||||
IO.write(file, "object BuildInfo")
|
||||
file :: Nil
|
||||
}
|
||||
|
||||
sourceGenerators in Compile += buildInfo
|
||||
sourceGenerators in Compile += Def.task { Nil }
|
||||
ThisBuild / scalaVersion := "2.12.8"
|
||||
|
||||
lazy val root = (project in file("."))
|
||||
.settings(
|
||||
buildInfo := {
|
||||
val file = sourceManaged.value / "BuildInfo.scala"
|
||||
IO.write(file, "object BuildInfo")
|
||||
file :: Nil
|
||||
},
|
||||
sourceGenerators in Compile += buildInfo,
|
||||
sourceGenerators in Compile += Def.task { Nil }
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
> compile
|
||||
$ exists target/scala-2.11/src_managed/BuildInfo.scala
|
||||
$ exists target/scala-2.12/src_managed/BuildInfo.scala
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
lazy val root = (project in file(".")).
|
||||
settings(
|
||||
scalaVersion := "2.10.6"
|
||||
)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
package testCase
|
||||
|
||||
case class FooUser(@Foo a: Int)
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
package testCase;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface JFoo {
|
||||
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
|
||||
import annotation.target.field
|
||||
|
||||
|
||||
package object testCase {
|
||||
type Foo = JFoo @field;
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
> compile
|
||||
|
|
@ -1,16 +1,15 @@
|
|||
// hardcode dottyVersion to make test deterministic
|
||||
lazy val dottyVersion = "0.8.0-bin-20180424-e77604d-NIGHTLY"
|
||||
lazy val dottyVersion = "0.11.0-RC1"
|
||||
|
||||
ThisBuild / scalaVersion := dottyVersion
|
||||
ThisBuild / organization := "com.example"
|
||||
|
||||
lazy val plugin = (project in file("plugin"))
|
||||
.settings(
|
||||
name := "dividezero",
|
||||
version := "0.0.1",
|
||||
organization := "ch.epfl.lamp",
|
||||
scalaVersion := dottyVersion,
|
||||
version := "0.0.1"
|
||||
)
|
||||
|
||||
lazy val app = (project in file("."))
|
||||
.settings(
|
||||
scalaVersion := dottyVersion,
|
||||
libraryDependencies += compilerPlugin("ch.epfl.lamp" %% "dividezero" % "0.0.1"),
|
||||
libraryDependencies += compilerPlugin("com.example" %% "dividezero" % "0.0.1"),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.2.0")
|
||||
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.2.6")
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
ThisBuild / scalaVersion := "2.12.8"
|
||||
|
||||
lazy val root = (project in file(".")).
|
||||
settings(
|
||||
incOptions := xsbti.compile.IncOptions.of(),
|
||||
scalaVersion := "2.11.7"
|
||||
incOptions := xsbti.compile.IncOptions.of()
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||
name := "foo"
|
||||
lazy val scala212 = "2.12.8"
|
||||
lazy val scala213 = "2.13.0-M5"
|
||||
ThisBuild / scalaVersion := scala212
|
||||
|
||||
scalaVersion := "2.10.6"
|
||||
|
||||
crossScalaVersions := List("2.10.6", "2.11.8")
|
||||
|
||||
incOptions := incOptions.value.withClassfileManagerType(
|
||||
Option(xsbti.compile.TransactionalManagerType.of(
|
||||
crossTarget.value / "classes.bak",
|
||||
(streams in (Compile, compile)).value.log
|
||||
): xsbti.compile.ClassFileManagerType).asJava
|
||||
)
|
||||
lazy val root = (project in file("."))
|
||||
.settings(
|
||||
name := "foo",
|
||||
crossScalaVersions := List(scala212, scala213),
|
||||
incOptions := incOptions.value.withClassfileManagerType(
|
||||
Option(xsbti.compile.TransactionalManagerType.of(
|
||||
crossTarget.value / "classes.bak",
|
||||
(streams in (Compile, compile)).value.log
|
||||
): xsbti.compile.ClassFileManagerType).asJava
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
> + compile
|
||||
$ exists target/scala-2.10
|
||||
$ exists target/scala-2.11
|
||||
$ exists target/scala-2.12
|
||||
$ exists target/scala-2.13.0-M5
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
ThisBuild / scalaVersion := "2.12.8"
|
||||
|
||||
def localCache =
|
||||
ivyPaths := IvyPaths(baseDirectory.value, Some((baseDirectory in ThisBuild).value / "ivy" / "cache"))
|
||||
|
||||
val b = project
|
||||
.settings(
|
||||
localCache,
|
||||
scalaVersion := "2.11.8",
|
||||
libraryDependencies += "org.example" %% "artifacta" % "1.0.0-SNAPSHOT" withSources() classifier("tests"),
|
||||
externalResolvers := Vector(
|
||||
MavenCache("demo", ((baseDirectory in ThisBuild).value / "demo-repo")),
|
||||
|
|
@ -15,7 +16,6 @@ val b = project
|
|||
val a = project
|
||||
.settings(
|
||||
localCache,
|
||||
scalaVersion := "2.11.8",
|
||||
organization := "org.example",
|
||||
name := "artifacta",
|
||||
version := "1.0.0-SNAPSHOT",
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
ThisBuild / organization := "com.example"
|
||||
ThisBuild / scalaVersion := "2.12.8"
|
||||
|
||||
def customIvyPaths: Seq[Def.Setting[_]] = Seq(
|
||||
ivyPaths := IvyPaths((baseDirectory in ThisBuild).value, Some((baseDirectory in ThisBuild).value / "ivy-cache"))
|
||||
)
|
||||
|
|
@ -9,10 +12,9 @@ lazy val sharedResolver: Resolver = {
|
|||
//Resolver.file("example-shared-repo", repoDir)(Resolver.defaultPatterns)
|
||||
}
|
||||
|
||||
lazy val common = project.
|
||||
settings(customIvyPaths: _*).
|
||||
settings(
|
||||
scalaVersion := "2.11.8",
|
||||
lazy val common = project
|
||||
.settings(customIvyPaths)
|
||||
.settings(
|
||||
organization := "com.badexample",
|
||||
name := "badexample",
|
||||
version := "1.0-SNAPSHOT",
|
||||
|
|
@ -27,10 +29,9 @@ lazy val common = project.
|
|||
// updateOptions := updateOptions.value.withLatestSnapshots(true)
|
||||
)
|
||||
|
||||
lazy val dependent = project.
|
||||
settings(customIvyPaths: _*).
|
||||
settings(
|
||||
scalaVersion := "2.11.8",
|
||||
lazy val dependent = project
|
||||
.settings(customIvyPaths)
|
||||
.settings(
|
||||
// Uncomment the following to test the before/after
|
||||
// updateOptions := updateOptions.value.withLatestSnapshots(false),
|
||||
// Ignore the inter-project resolver, so we force to look remotely.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
name := "projA"
|
||||
|
||||
scalaVersion := "2.11.8"
|
||||
scalaVersion := "2.12.8"
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
> compile
|
||||
$ exists projA/target/scala-2.11/classes/A.class
|
||||
$ exists projA/target/scala-2.12/classes/A.class
|
||||
|
|
|
|||
|
|
@ -1,26 +1,23 @@
|
|||
lazy val root = (project in file(".")).
|
||||
settings(
|
||||
val unpackage = TaskKey[Unit]("unpackage")
|
||||
|
||||
ThisBuild / scalaVersion := "2.12.8"
|
||||
|
||||
lazy val root = (project in file("."))
|
||||
.settings(
|
||||
forConfig(Compile, "src"),
|
||||
forConfig(Test, "test-src"),
|
||||
baseSettings
|
||||
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.14.0" % Test,
|
||||
unmanagedSources / includeFilter := "*.java" | "*.scala"
|
||||
)
|
||||
|
||||
def baseSettings = Seq(
|
||||
scalaVersion := "2.11.8",
|
||||
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.11.4" % Test,
|
||||
includeFilter in unmanagedSources := "*.java" | "*.scala"
|
||||
)
|
||||
|
||||
def forConfig(conf: Configuration, name: String) = Project.inConfig(conf)( unpackageSettings(name) )
|
||||
|
||||
def unpackageSettings(name: String) = Seq(
|
||||
unmanagedSourceDirectories := (baseDirectory.value / name) :: Nil,
|
||||
excludeFilter in unmanagedResources := (includeFilter in unmanagedSources).value,
|
||||
unmanagedResources / excludeFilter := (unmanagedSources / includeFilter).value,
|
||||
unmanagedResourceDirectories := unmanagedSourceDirectories.value,
|
||||
unpackage := {
|
||||
IO.unzip(artifactPath in packageSrc value, baseDirectory.value / name)
|
||||
IO.unzip((packageSrc / artifactPath).value, baseDirectory.value / name)
|
||||
IO.delete(baseDirectory.value / name / "META-INF")
|
||||
}
|
||||
)
|
||||
|
||||
val unpackage = TaskKey[Unit]("unpackage")
|
||||
|
|
|
|||
|
|
@ -1,25 +1,21 @@
|
|||
lazy val root = (project in file(".")).
|
||||
aggregate(a, b, c, d).
|
||||
settings(
|
||||
inThisBuild(Seq(
|
||||
scalaVersion := "2.11.7",
|
||||
trackInternalDependencies := TrackLevel.NoTracking
|
||||
))
|
||||
)
|
||||
ThisBuild / scalaVersion := "2.12.8"
|
||||
ThisBuild / trackInternalDependencies := TrackLevel.NoTracking
|
||||
|
||||
lazy val root = (project in file("."))
|
||||
.aggregate(a, b, c, d)
|
||||
|
||||
lazy val a = (project in file("a"))
|
||||
|
||||
lazy val b = (project in file("b")).
|
||||
dependsOn(a)
|
||||
lazy val b = (project in file("b"))
|
||||
.dependsOn(a)
|
||||
|
||||
lazy val c = (project in file("c")).
|
||||
settings(
|
||||
lazy val c = (project in file("c"))
|
||||
.settings(
|
||||
exportToInternal := TrackLevel.NoTracking
|
||||
)
|
||||
|
||||
lazy val d = (project in file("d")).
|
||||
dependsOn(c).
|
||||
settings(
|
||||
lazy val d = (project in file("d"))
|
||||
.dependsOn(c)
|
||||
.settings(
|
||||
trackInternalDependencies := TrackLevel.TrackIfMissing
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue