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 | | 5 | exists | exists | no match | no matches | upload |
| 6 | is missing | exists | - | - | delete | | 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( val applicationSettings = Seq(
name := "s3thorp", name := "s3thorp",
version := "0.1",
scalaVersion := "2.12.8"
) )
val testDependencies = Seq( val testDependencies = Seq(
libraryDependencies ++= Seq( libraryDependencies ++= Seq(
@ -39,23 +44,33 @@ val catsEffectsSettings = Seq(
// cli -> aws-lib -> core -> aws-api -> domain // cli -> aws-lib -> core -> aws-api -> domain
lazy val cli = (project in file("cli")) lazy val cli = (project in file("cli"))
.settings(commonSettings)
.settings(mainClass in assembly := Some("net.kemitix.s3thorp.cli.Main"))
.settings(applicationSettings) .settings(applicationSettings)
.aggregate(`aws-lib`, core, `aws-api`, domain) .aggregate(`aws-lib`, core, `aws-api`, domain)
.settings(commandLineParsing) .settings(commandLineParsing)
.dependsOn(`aws-lib`) .dependsOn(`aws-lib`)
lazy val `aws-lib` = (project in file("aws-lib")) lazy val `aws-lib` = (project in file("aws-lib"))
.settings(commonSettings)
.settings(assemblyJarName in assembly := "aws-lib.jar")
.settings(awsSdkDependencies) .settings(awsSdkDependencies)
.settings(testDependencies) .settings(testDependencies)
.dependsOn(core) .dependsOn(core)
lazy val core = (project in file("core")) lazy val core = (project in file("core"))
.settings(commonSettings)
.settings(assemblyJarName in assembly := "core.jar")
.settings(testDependencies) .settings(testDependencies)
.dependsOn(`aws-api`) .dependsOn(`aws-api`)
lazy val `aws-api` = (project in file("aws-api")) lazy val `aws-api` = (project in file("aws-api"))
.settings(commonSettings)
.settings(assemblyJarName in assembly := "aws-api.jar")
.settings(catsEffectsSettings) .settings(catsEffectsSettings)
.dependsOn(domain) .dependsOn(domain)
lazy val domain = (project in file("domain")) lazy val domain = (project in file("domain"))
.settings(commonSettings)
.settings(assemblyJarName in assembly := "domain.jar")
.settings(testDependencies) .settings(testDependencies)

1
project/assembly.sbt Normal file
View file

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