Enable running outside of sbt (#55)

Enable running outside of sbt
This commit is contained in:
Paul Campbell 2019-06-11 23:36:08 +01:00 committed by GitHub
parent 1a223a110b
commit 5996632c1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 2 deletions

View file

@ -40,3 +40,14 @@ When considering a local file, the following table governs what should happen:
| 5 | exists | exists | no match | no matches | upload |
| 6 | is missing | exists | - | - | delete |
|---+------------+------------+------------------+--------------------+---------------------|
* Executable JAR
To build as an executable jar, perform `sbt assembly`
This will create the file
`cli/target/scala-2.12/s3thorp-assembly-$VERSION.jar` (where $VERSION
is substituted)
Copy and rename this file as `s3thorp.jar` into the same directory as
the `bin/s3throp` shell script.

4
bin/s3thorp Executable file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env sh
THORP_HOME=`dirname $0`
eval `resize`
java -jar $THORP_HOME/s3thorp.jar $*

View file

@ -1,7 +1,12 @@
val commonSettings = Seq(
version := "DEV-SNAPSHOT",
organization := "net.kemitix",
scalaVersion := "2.12.8",
test in assembly := {}
)
val applicationSettings = Seq(
name := "s3thorp",
version := "0.1",
scalaVersion := "2.12.8"
)
val testDependencies = Seq(
libraryDependencies ++= Seq(
@ -39,23 +44,33 @@ val catsEffectsSettings = Seq(
// cli -> aws-lib -> core -> aws-api -> domain
lazy val cli = (project in file("cli"))
.settings(commonSettings)
.settings(mainClass in assembly := Some("net.kemitix.s3thorp.cli.Main"))
.settings(applicationSettings)
.aggregate(`aws-lib`, core, `aws-api`, domain)
.settings(commandLineParsing)
.dependsOn(`aws-lib`)
lazy val `aws-lib` = (project in file("aws-lib"))
.settings(commonSettings)
.settings(assemblyJarName in assembly := "aws-lib.jar")
.settings(awsSdkDependencies)
.settings(testDependencies)
.dependsOn(core)
lazy val core = (project in file("core"))
.settings(commonSettings)
.settings(assemblyJarName in assembly := "core.jar")
.settings(testDependencies)
.dependsOn(`aws-api`)
lazy val `aws-api` = (project in file("aws-api"))
.settings(commonSettings)
.settings(assemblyJarName in assembly := "aws-api.jar")
.settings(catsEffectsSettings)
.dependsOn(domain)
lazy val domain = (project in file("domain"))
.settings(commonSettings)
.settings(assemblyJarName in assembly := "domain.jar")
.settings(testDependencies)

1
project/assembly.sbt Normal file
View file

@ -0,0 +1 @@
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.9")