sbt-native-launcher を使用して zip ファイルを bintray に公開したいと考えています。
私は実行できます:
sbt publish
また、主要な成果物 (.jar、javadocs など) を公開します。
私も実行できます:
sbt universal:packageBin
.zip ファイルが生成されます。
ただし、実行すると:
sbt universal:publish
次のエラーが発生します。
[info] Wrote C:\src\ShExcala\target\scala-2.10\shexcala_2.10-0.0.1.pom
tar: Cannot execute remote shell: No such file or directory
tar: C\:\\Users\\Labra\\AppData\\Local\\Temp\\sbt_407249ba\\shexcala-0.0.1.tar: Cannot open: I/O error
tar: Error is not recoverable: exiting now
[trace] Stack trace suppressed: run last universal:packageZipTarball for the full output.
[error] (universal:packageZipTarball) Error tarballing
C:\src\ShExcala\target\universal\shexcala-0.0.1.tgz. Exit code: 2
同じエラーが発生する「universal:packageZipTarball」タスクに問題があるようです。
Windows を使用しており、「tar」、「xz」、および「gzip」がインストールされていることを確認しました。
今のところ .zip だけを公開してもかまわないので、もう 1 つの回避策は、packageZipTarball タスクを回避するために sbt-native-packager を構成する方法を知ることです。
build.sbt の定義は次のとおりです。
import sbt._
import sbt.Keys._
import AssemblyKeys._
import bintray.Plugin.bintraySettings
import bintray.Keys._
import scala.scalajs.sbtplugin.ScalaJSPlugin.ScalaJSKeys._
lazy val root = project.in(file("."))//.settings(crossScalaVersions := Seq("2.10.4", "2.11.0"))
Build.sharedSettings
version := Build.currentVersion
libraryDependencies ++= Seq(
"org.specs2" %% "specs2" % "2.3.7" % "test"
, "org.scalatest" % "scalatest_2.10" % "2.0.1-SNAP" % "test"
, "commons-configuration" % "commons-configuration" % "1.7"
, "org.rogach" %% "scallop" % "0.9.5"
, "com.typesafe" % "config" % "1.0.1"
, "org.scala-lang" % "scala-compiler" % "2.10.2"
, "com.assembla.scala-incubator" % "graph-core_2.10" % "1.6.2"
, "org.apache.jena" % "jena-arq" % "2.10.1"
, "org.scalaz" % "scalaz-core_2.10" % "7.0.6"
, "es.weso" % "stateparser_2.10" % "0.0.1"
, "es.weso" % "wesin_2.10" % "0.0.1"
)
autoCompilerPlugins := true
seq(bintraySettings:_*)
Build.publishSettings
deploymentSettings
publishMavenStyle := true
// publish <<= publish.dependsOn(publish in config("universal"))
packageArchetype.java_application
resourceGenerators in Test += Def.task {
val location = url("https://github.com/shexSpec/test-suite/raw/gh-pages/tests.zip")
IO.unzipURL(location, resourceManaged.value / "downloadedTests").toSeq
}.taskValue
resolvers ++= Seq("snapshots", "releases").map(Resolver.sonatypeRepo)
そして、次のproject/build.scala
とおりです。
import sbt._
import sbt.Keys._
import bintray.Plugin.bintraySettings
import bintray.Keys._
import Def.ScopedKey
import scala.scalajs.sbtplugin.ScalaJSPlugin._
object Build extends sbt.Build {
val isRelease = true
def repo = "weso-releases"
val shExcalaVersion = "0.0.1"
publishMavenStyle := false
val currentVersion = shExcalaVersion
protected val bintrayPublishIvyStyle = settingKey[Boolean]("=== !publishMavenStyle")
lazy val publishSettings = Seq(
repository in bintray := this.repo,
bintrayOrganization in bintray := Some("weso"),
licenses += ("MPL-2.0", url("http://opensource.org/licenses/MPL-2.0")),
bintrayPublishIvyStyle := true
)
val sharedSettings = Seq(
organization := "es.weso",
name := "shExcala",
scalaVersion := "2.10.4"
)
}
の出力last universal:packageZipTarball
は次のとおりです。
> last universal:packageZipTarball
java.lang.RuntimeException: Error tarballing C:\src\ShExcala\target\universal\shexcala-0.0.1.tgz. Exit code: 2
at scala.sys.package$.error(package.scala:27)
at com.typesafe.sbt.packager.universal.Archives$$anonfun$makeTarball$1.apply(Archives.scala:134)
at com.typesafe.sbt.packager.universal.Archives$$anonfun$makeTarball$1.apply(Archives.scala:118)
at sbt.IO$.withTemporaryDirectory(IO.scala:285)
at com.typesafe.sbt.packager.universal.Archives$.makeTarball(Archives.scala:118)
at com.typesafe.sbt.packager.universal.Archives$$anonfun$10.apply(Archives.scala:111)
at com.typesafe.sbt.packager.universal.Archives$$anonfun$10.apply(Archives.scala:111)
at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:35)
at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:34)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
at sbt.std.Transform$$anon$4.work(System.scala:64)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:244)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
[error] (universal:packageZipTarball) Error tarballing C:\src\ShExcala\target\universal\shexcala-0.0.1.tgz. Exit code: 2
>