snappy-java/build.sbt

127 lines
5.9 KiB
Plaintext
Raw Permalink Normal View History

2014-06-26 06:28:45 +02:00
name := "snappy-java"
2017-11-14 20:55:03 +01:00
organization := "org.xerial.snappy"
2014-06-26 06:28:45 +02:00
organizationName := "xerial.org"
2017-11-14 20:55:03 +01:00
description := "snappy-java: A fast compression/decompression library"
2017-01-20 03:16:05 +01:00
2020-06-26 09:23:44 +02:00
sonatypeProfileName := "org.xerial"
publishTo in ThisBuild := sonatypePublishToBundle.value
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html"))
homepage := Some(url("https://github.com/xerial/snappy-java"))
scmInfo := Some(
ScmInfo(
browseUrl = url("https://github.com/xerial/snappy-java"),
connection = "scm:git@github.com:xerial/snappy-java.git"
)
)
developers := List(
Developer(id = "leo", name = "Taro L. Saito", email = "leo@xerial.org", url = url("http://xerial.org/leo"))
)
2014-06-26 06:28:45 +02:00
2020-06-26 04:36:40 +02:00
scalaVersion in ThisBuild := "2.12.11"
2014-07-18 09:22:59 +02:00
2020-08-26 06:16:01 +02:00
// For building jars for JDK8
2020-08-26 06:06:38 +02:00
javacOptions in ThisBuild ++= Seq("-source", "1.8", "-target", "1.8")
2020-06-26 04:40:18 +02:00
javacOptions in (Compile, compile) ++= Seq("-encoding", "UTF-8", "-Xlint:unchecked", "-Xlint:deprecation")
2014-06-26 06:28:45 +02:00
2015-04-14 09:03:27 +02:00
javacOptions in doc := {
2020-06-26 09:01:36 +02:00
val opts = Seq("-source", "1.8")
2017-11-14 20:55:03 +01:00
if (scala.util.Properties.isJavaAtLeast("1.8"))
opts ++ Seq("-Xdoclint:none")
else
opts
2015-04-14 09:03:27 +02:00
}
// Configuration for SnappyHadoopCompatibleOutputStream testing
fork in Test := true
val libTemp = {
val path = s"${System.getProperty("java.io.tmpdir")}/snappy_test_${System.currentTimeMillis()}"
// certain older Linux systems (debian/trusty in Travis CI) requires the libsnappy.so, loaded by
// libhadoop.so, be copied to the temp path before the child JVM is forked.
// because of that, cannot define as an additional task in Test scope
IO.copyFile(file("src/test/resources/lib/Linux/libsnappy.so"), file(s"$path/libsnappy.so"))
IO.copyFile(file("src/test/resources/lib/Linux/libsnappy.so"), file(s"$path/libsnappy.so.1"))
path
}
val macOSXLibPath = s"$libTemp:${System.getenv("DYLD_LIBRARY_PATH")}"
val linuxLibPath = s"$libTemp:${System.getenv("LD_LIBRARY_PATH")}"
// have to add to system dynamic library path since hadoop native library indirectly load libsnappy.1
// can't use javaOptions in Test because it causes the expression to eval twice yielding different temp path values
envVars in Test := Map("XERIAL_SNAPPY_LIB" -> libTemp, "DYLD_LIBRARY_PATH" -> macOSXLibPath, "LD_LIBRARY_PATH" -> linuxLibPath)
testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v")
2014-07-18 09:22:59 +02:00
concurrentRestrictions in Global := Seq(Tags.limit(Tags.Test, 1))
2014-06-26 06:28:45 +02:00
autoScalaLibrary := false
crossPaths := false
logBuffered in Test := false
libraryDependencies ++= Seq(
2017-11-14 20:55:03 +01:00
"junit" % "junit" % "4.8.2" % "test",
"org.codehaus.plexus" % "plexus-classworlds" % "2.4" % "test",
"org.xerial.java" % "xerial-core" % "2.1" % "test",
2020-06-26 04:36:40 +02:00
"org.wvlet.airframe" %% "airframe-log" % "20.6.1" % "test",
2017-11-14 21:48:03 +01:00
"org.scalatest" %% "scalatest" % "3.0.4" % "test",
2017-11-14 20:55:03 +01:00
"org.osgi" % "org.osgi.core" % "4.3.0" % "provided",
"com.novocode" % "junit-interface" % "0.11" % "test",
"org.apache.hadoop" % "hadoop-common" % "2.7.3" % "test" exclude ("org.xerial.snappy", "snappy-java")
2014-06-26 06:28:45 +02:00
)
2017-11-14 20:54:11 +01:00
enablePlugins(SbtOsgi)
2014-06-26 06:28:45 +02:00
osgiSettings
OsgiKeys.exportPackage := Seq("org.xerial.snappy", "org.xerial.snappy.buffer", "org.xerial.snappy.pool", "org.xerial.snappy.pure")
2014-06-26 06:28:45 +02:00
OsgiKeys.bundleSymbolicName := "org.xerial.snappy.snappy-java"
OsgiKeys.bundleActivator := Option("org.xerial.snappy.SnappyBundleActivator")
OsgiKeys.importPackage := Seq("""org.osgi.framework;version="[1.5,2)"""")
OsgiKeys.requireCapability := """osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.7))""""
2014-06-26 06:28:45 +02:00
OsgiKeys.additionalHeaders := Map(
"Bundle-NativeCode" -> Seq(
2017-11-14 20:55:03 +01:00
"org/xerial/snappy/native/Windows/x86_64/snappyjava.dll;osname=win32;processor=x86-64",
"org/xerial/snappy/native/Windows/x86_64/snappyjava.dll;osname=win32;processor=x64",
"org/xerial/snappy/native/Windows/x86_64/snappyjava.dll;osname=win32;processor=amd64",
"org/xerial/snappy/native/Windows/x86/snappyjava.dll;osname=win32;processor=x86",
"org/xerial/snappy/native/Mac/x86/libsnappyjava.dylib;osname=macosx;processor=x86",
"org/xerial/snappy/native/Mac/x86_64/libsnappyjava.dylib;osname=macosx;processor=x86-64",
2017-11-14 20:55:03 +01:00
"org/xerial/snappy/native/Linux/x86_64/libsnappyjava.so;osname=linux;processor=x86-64",
"org/xerial/snappy/native/Linux/x86_64/libsnappyjava.so;osname=linux;processor=x64",
"org/xerial/snappy/native/Linux/x86_64/libsnappyjava.so;osname=linux;processor=amd64",
"org/xerial/snappy/native/Linux/x86/libsnappyjava.so;osname=linux;processor=x86",
"org/xerial/snappy/native/Linux/aarch64/libsnappyjava.so;osname=linux;processor=aarch64",
"org/xerial/snappy/native/Linux/arm/libsnappyjava.so;osname=linux;processor=arm",
"org/xerial/snappy/native/Linux/armv7/libsnappyjava.so;osname=linux;processor=arm_le",
2017-11-14 20:55:03 +01:00
"org/xerial/snappy/native/Linux/ppc64/libsnappyjava.so;osname=linux;processor=ppc64le",
"org/xerial/snappy/native/Linux/s390x/libsnappyjava.so;osname=linux;processor=s390x",
"org/xerial/snappy/native/AIX/ppc/libsnappyjava.a;osname=aix;processor=ppc",
"org/xerial/snappy/native/AIX/ppc64/libsnappyjava.a;osname=aix;processor=ppc64",
"org/xerial/snappy/native/SunOS/x86/libsnappyjava.so;osname=sunos;processor=x86",
"org/xerial/snappy/native/SunOS/x86_64/libsnappyjava.so;osname=sunos;processor=x86-64",
"org/xerial/snappy/native/SunOS/sparc/libsnappyjava.so;osname=sunos;processor=sparc"
).mkString(","),
"Bundle-DocURL" -> "http://www.xerial.org/",
"Bundle-License" -> "http://www.apache.org/licenses/LICENSE-2.0.txt",
"Bundle-ActivationPolicy" -> "lazy",
"Bundle-Name" -> "snappy-java: A fast compression/decompression library"
2014-06-26 06:28:45 +02:00
)
2015-05-11 18:41:57 +02:00
import ReleaseTransformations._
2015-05-13 04:05:49 +02:00
releaseTagName := { (version in ThisBuild).value }
2015-05-11 18:41:57 +02:00
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
2020-06-26 09:01:36 +02:00
releaseStepCommand("publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
2015-05-11 18:41:57 +02:00
setNextVersion,
commitNextVersion,
pushChanges
)