Java rewrite - step 1 - build with Maven (#431)

* Add root and parent pom.xml files

* parent: add scala-maven-plugin to pluginManagement

* fix packaging

* domain: add module

* parent,domain: add dependencies

* maven: add filesystem module

* parent: disable coverage and pitest

* domain: move classes from test to main as they are used in filesystem

* config: add module

* console: add module

* Add reactor-graph

* fix typo

* uishell: add module

* Restore explicit dependencies

Don’t depend upon transitive dependencies if we want to be able to restructure module dependencies.

* storage: add module

* lib: add module

Included adding a Resource case class in filesystem to replace one generated by a scala plugin

* storage-aws: add module

* cli: add module

* app: add module

* app: make jar runnable

* Updated build instructions in README

* Convert readme to markdown

* Add reactor graph to readme

* Switch Guthub Actions to using Maven to build
This commit is contained in:
Paul Campbell 2020-06-11 21:33:28 +01:00 committed by GitHub
parent ab72522379
commit baea18f3f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 1134 additions and 53 deletions

41
.github/GitHub-Actions.org vendored Normal file
View file

@ -0,0 +1,41 @@
* Deploying using Github Actions
** Actions definition: workflow/sonatype-deploy.yml
When a GitHub Release is created, usually from a tag, this action will trigger.
Using JDK8 the software will be packaged, including running any tests.
Then the Deploy script will sign the created artifacts then deploy them according to the distributionManagement configuration in the `pom.xml`.
** Deploy Script
Uses a signing key provided from the GitHub Actions Secrets as an environment variable to sign the artifact(s) before they are then deployed.
*** Inputs
**** DEPLOY_PROJECTS (optional)
An optional list of modules in a multi-module project to be deployed. If this value is not specified, then all projects will be deployed.
** Maven Configuration
Picks up the credentials from Environment variables for authenticating both with GPG and with the target deployment server (e.g. sonatype-nexus).
*** Inputs
**** NEXUS_USERNAME
The username for your account on the deployment server.
**** NEXUS_PASSWORD
The password for your account on the deployement server.
**** GPG_KEYNAME
The key to use when signing.
**** GPG_PASSPHRASE
The passphrase to unlock the key to use when signing.

53
.github/NOTES vendored Normal file
View file

@ -0,0 +1,53 @@
Add subkeys:
????
Publish:
gpg --send-keys --keyserver keyserver.ubuntu.com $KEYID
gpg --send-keys --keyserver pgp.mit.edu $KEYID
gpg --send-keys --keyserver pool.sks-keyservers.net $KEYID
Backup:
gpg --export --armor pcampbell@kemitix.net > gpg-key-backup.asc
gpg --export-secret-keys --armor pcampbell@kemitix.net >> gpg-key-backup.asc
Export sub-keys:
gpg --export-secret-subkeys pcampbell@kemitix.net > subkeys
Remove master keys:
gpg --delete-secret-key pcampbell@kemitix.net
Import sub-keys and clean up:
gpg --import subkeys
shred --remove subkeys
Delete any encryption subkeys:
gpg --edit-key pcampbell@kemitix.net
2
delkey
save
Change passphrase:
gpg --edit-key pcampbell@kemitix.net
passwd
save
Export keys:
gpg --export --armor pcampbell@kemitix.net > codesigning.asc
gpg --export-secret-keys --armor pcampbell@kemitix.net >> codesigning.asc
Encrypt keys:
gpg --symmetric --cipher-algo AES256 codesigning.asc
shred codesigning.asc

BIN
.github/codesigning.asc.gpg vendored Normal file

Binary file not shown.

28
.github/settings.xml vendored Normal file
View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" ?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0">
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>${env.NEXUS_USERNAME}</username>
<password>${env.NEXUS_PASSWORD}</password>
</server>
<server>
<id>sonatype-nexus-staging</id>
<username>${env.NEXUS_USERNAME}</username>
<password>${env.NEXUS_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>gpg-sign</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>gpg</gpg.executable>
<gpg.keyname>${env.GPG_KEYNAME}</gpg.keyname>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>

26
.github/workflows/maven-build.yml vendored Normal file
View file

@ -0,0 +1,26 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: maven
on:
push:
branches: '*'
pull_request:
branches: '*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 8 ]
steps:
- uses: kamiazya/setup-graphviz@v1
- uses: actions/checkout@v2
- name: setup-jdk-${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: build-jar
run: mvn -B install

View file

@ -1,21 +0,0 @@
name: Scala CI
on:
push:
branches: '*'
pull_request:
branches: '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Scala Build Tool
run: sbt test

38
.github/workflows/sonatype-deploy.yml vendored Normal file
View file

@ -0,0 +1,38 @@
name: Deploy to Sonatype Nexus
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn -B install
- name: Nexus Repo Publish
run: |
gpg --quiet \
--batch \
--yes \
--decrypt \
--passphrase="${{ secrets.GPG_PASSPHRASE }}" \
--output codesigning.asc \
.github/codesigning.asc.gpg
gpg --batch \
--fast-import codesigning.asc
mvn --settings .github/settings.xml \
-Dskip-Tests=true \
-P release \
-B \
deploy
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

View file

@ -1,20 +1,18 @@
* thorp # thorp
Synchronisation of files with S3 using the hash of the file contents. Synchronisation of files with S3 using the hash of the file contents.
[[https://www.codacy.com/app/kemitix/thorp][file:https://img.shields.io/codacy/grade/c1719d44f1f045a8b71e1665a6d3ce6c.svg?style=for-the-badge]] [![Maven Central](https://img.shields.io/maven-central/v/net.kemitix.thorp/thorp_2.12.svg?style=for-the-badge)](https://search.maven.org/search?q=net.kemitix.thorp)
[[https://search.maven.org/search?q=net.kemitix.thorp][file:https://img.shields.io/maven-central/v/net.kemitix.thorp/thorp_2.12.svg?style=for-the-badge]]
Originally based on Alex Kudlick's [[https://github.com/akud/aws-s3-sync-by-hash][aws-s3-sync-by-hash]]. Originally based on Alex Kudlick's [aws-s3-sync-by-hash](https://github.com/akud/aws-s3-sync-by-hash).
The normal ~aws s3 sync ...~ command only uses the time stamp of files The normal `aws s3 sync ...` command only uses the time stamp of files
to decide what files need to be copied. This utility looks at the md5 to decide what files need to be copied. This utility looks at the md5
hash of the file contents. hash of the file contents.
* Usage # Usage
#+begin_example $ thorp
thorp
Usage: thorp [options] Usage: thorp [options]
-V, --version Display the version and quit -V, --version Display the version and quit
@ -28,65 +26,66 @@ hash of the file contents.
-d, --debug Enable debug logging -d, --debug Enable debug logging
--no-global Ignore global configuration --no-global Ignore global configuration
--no-user Ignore user configuration --no-user Ignore user configuration
#+end_example
If you don't provide a ~source~ the current diretory will be used. If you don't provide a `source` the current directory will be used.
The ~--include~ and ~--exclude~ parameters can be used more than once. The `--include` and `--exclude` parameters can be used more than once.
The ~--source~ parameter can be used more than once, in which case, The `--source` parameter can be used more than once, in which case,
all files in all sources will be consolidated into the same all files in all sources will be consolidated into the same
bucket/prefix. bucket/prefix.
** Batch mode ## Batch mode
Batch mode disable the ANSI console display and logs simple messages Batch mode disable the ANSI console display and logs simple messages
that can be written to a file. that can be written to a file.
* Configuration # Configuration
Configuration will be read from these files: Configuration will be read from these files:
- Global: ~/etc/thorp.conf~ - Global: `/etc/thorp.conf`
- User: ~ ~/.config/thorp.conf~ - User: `~/.config/thorp.conf`
- Source: ~${source}/.thorp.conf~ - Source: `${source}/.thorp.conf`
Command line arguments override those in Source, which override Command line arguments override those in Source, which override
those in User, which override those Global, which override any those in User, which override those Global, which override any
built-in config. built-in config.
When there is more than one source, only the first ".thorp.conf" When there is more than one source, only the first `.thorp.conf`
file found will be used. file found will be used.
Built-in config consists of using the current working directory as Built-in config consists of using the current working directory as
the ~source~. the `source`.
Note, that ~include~ and ~exclude~ are cumulative across all Note, that ~include~ and ~exclude~ are cumulative across all
configuration files. configuration files.
* Caching # Caching
The last modified time for files is used to decide whether to calculate the hash values for the file. If a file has not been updated, then the hash values stored in the `.thorp.cache` file located in the root of the source is used. Otherwise the file will be read to caculate the the new hashes. The last modified time for files is used to decide whether to calculate the hash values for the file. If a file has not been updated, then the hash values stored in the `.thorp.cache` file located in the root of the source is used. Otherwise the file will be read to caculate the the new hashes.
* Behaviour # Behaviour
When considering a local file, the following table governs what should happen: When considering a local file, the following table governs what should happen:
|---+------------+------------+------------------+--------------------+---------------------|
| # | local file | remote key | hash of same key | hash of other keys | action | | # | local file | remote key | hash of same key | hash of other keys | action |
|---+------------+------------+------------------+--------------------+---------------------| |---|------------|------------|------------------|--------------------|---------------------|
| 1 | exists | exists | matches | - | do nothing | | 1 | exists | exists | matches | - | do nothing |
| 2 | exists | is missing | - | matches | copy from other key | | 2 | exists | is missing | - | matches | copy from other key |
| 3 | exists | is missing | - | no matches | upload | | 3 | exists | is missing | - | no matches | upload |
| 4 | exists | exists | no match | matches | copy from other key | | 4 | exists | exists | no match | matches | copy from other key |
| 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 # Executable JAR
To build as an executable jar, perform `sbt assembly` To build as an executable jar, perform `mvn package`
This will create the file `cli/target/scala-2.13/thorp` This will create the file `app/target/thorp-${version}-jar-with-dependencies.jar`
Copy this file to your `PATH`. Copy and rename this file into your `PATH`.
# Structure/Dependencies
![Dependency Graph](docs/images/reactor-graph.png)

100
app/pom.xml Normal file
View file

@ -0,0 +1,100 @@
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-parent</artifactId>
<version>DEV-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>thorp</artifactId>
<name>thorp</name>
<dependencies>
<!-- thorp -->
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-cli</artifactId>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-config</artifactId>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-domain</artifactId>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-filesystem</artifactId>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-lib</artifactId>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-storage</artifactId>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-storage-aws</artifactId>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-uishell</artifactId>
</dependency>
<!-- command line parsing -->
<dependency>
<groupId>com.github.scopt</groupId>
<artifactId>scopt_2.13</artifactId>
</dependency>
<!-- scala -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</dependency>
<!-- eip-zio -->
<dependency>
<groupId>net.kemitix</groupId>
<artifactId>eip-zio_2.13</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>net.kemitix.thorp.Main</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View file

@ -22,7 +22,8 @@ import scala.io.AnsiColor.{WHITE, RESET}
trait Program { trait Program {
lazy val version = s"${WHITE}Thorp v${thorp.BuildInfo.version}$RESET" val version = "0.11.0"
lazy val versionLabel = s"${WHITE}Thorp v${version}$RESET"
def run(args: List[String]): ZIO[ def run(args: List[String]): ZIO[
Storage with Console with Config with Clock with FileSystem with Hasher with FileScanner, Storage with Console with Config with Clock with FileSystem with Hasher with FileScanner,
@ -32,7 +33,7 @@ trait Program {
cli <- CliArgs.parse(args) cli <- CliArgs.parse(args)
config <- ConfigurationBuilder.buildConfig(cli) config <- ConfigurationBuilder.buildConfig(cli)
_ <- Config.set(config) _ <- Config.set(config)
_ <- Console.putStrLn(version) _ <- Console.putStrLn(versionLabel)
_ <- ZIO.when(!showVersion(cli))(executeWithUI.catchAll(handleErrors)) _ <- ZIO.when(!showVersion(cli))(executeWithUI.catchAll(handleErrors))
} yield () } yield ()
} }

53
cli/pom.xml Normal file
View file

@ -0,0 +1,53 @@
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-parent</artifactId>
<version>DEV-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>thorp-cli</artifactId>
<name>cli</name>
<dependencies>
<!-- thorp -->
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-config</artifactId>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-filesystem</artifactId>
</dependency>
<!-- scala -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</dependency>
<!-- scala - testing -->
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.13</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalamock</groupId>
<artifactId>scalamock_2.13</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

69
config/pom.xml Normal file
View file

@ -0,0 +1,69 @@
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-parent</artifactId>
<version>DEV-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>thorp-config</artifactId>
<name>config</name>
<dependencies>
<!-- thorp -->
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-domain</artifactId>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-filesystem</artifactId>
</dependency>
<!-- command line parsing -->
<dependency>
<groupId>com.github.scopt</groupId>
<artifactId>scopt_2.13</artifactId>
</dependency>
<!-- scala -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</dependency>
<!-- zio -->
<dependency>
<groupId>dev.zio</groupId>
<artifactId>zio_2.13</artifactId>
</dependency>
<dependency>
<groupId>dev.zio</groupId>
<artifactId>zio-streams_2.13</artifactId>
</dependency>
<!-- scala - testing -->
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.13</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalamock</groupId>
<artifactId>scalamock_2.13</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

47
console/pom.xml Normal file
View file

@ -0,0 +1,47 @@
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-parent</artifactId>
<version>DEV-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>thorp-console</artifactId>
<name>console</name>
<dependencies>
<!-- thorp -->
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-domain</artifactId>
</dependency>
<!-- scala -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</dependency>
<!-- zio -->
<dependency>
<groupId>dev.zio</groupId>
<artifactId>zio_2.13</artifactId>
</dependency>
<dependency>
<groupId>dev.zio</groupId>
<artifactId>zio-streams_2.13</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 KiB

59
domain/pom.xml Normal file
View file

@ -0,0 +1,59 @@
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-parent</artifactId>
<version>DEV-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>thorp-domain</artifactId>
<name>domain</name>
<dependencies>
<!-- scala -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</dependency>
<!-- eip-zio -->
<dependency>
<groupId>net.kemitix</groupId>
<artifactId>eip-zio_2.13</artifactId>
</dependency>
<!-- zio -->
<dependency>
<groupId>dev.zio</groupId>
<artifactId>zio_2.13</artifactId>
</dependency>
<dependency>
<groupId>dev.zio</groupId>
<artifactId>zio-streams_2.13</artifactId>
</dependency>
<!-- scala - testing -->
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.13</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalamock</groupId>
<artifactId>scalamock_2.13</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

59
filesystem/pom.xml Normal file
View file

@ -0,0 +1,59 @@
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-parent</artifactId>
<version>DEV-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>thorp-filesystem</artifactId>
<name>filesystem</name>
<dependencies>
<!-- thorp -->
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-domain</artifactId>
</dependency>
<!-- scala -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</dependency>
<!-- zio -->
<dependency>
<groupId>dev.zio</groupId>
<artifactId>zio_2.13</artifactId>
</dependency>
<dependency>
<groupId>dev.zio</groupId>
<artifactId>zio-streams_2.13</artifactId>
</dependency>
<!-- scala - testing -->
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.13</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalamock</groupId>
<artifactId>scalamock_2.13</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,15 @@
package net.kemitix.thorp.filesystem
import java.io.File
import java.nio.file.{Path, Paths}
final case class Resource(
cls: Object,
file: String
) {
def toPath: Path = Paths.get(cls.getClass.getResource(file).getPath)
def toFile: File = toPath.toFile
def getCanonicalPath: String = toPath.toFile.getCanonicalPath
def length: Long = toFile.length()
}

71
lib/pom.xml Normal file
View file

@ -0,0 +1,71 @@
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-parent</artifactId>
<version>DEV-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>thorp-lib</artifactId>
<name>lib</name>
<dependencies>
<!-- thorp -->
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-domain</artifactId>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-filesystem</artifactId>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-config</artifactId>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-console</artifactId>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-storage</artifactId>
</dependency>
<!-- command line parsing -->
<dependency>
<groupId>com.github.scopt</groupId>
<artifactId>scopt_2.13</artifactId>
</dependency>
<!-- scala -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</dependency>
<!-- scala - testing -->
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.13</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalamock</groupId>
<artifactId>scalamock_2.13</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

183
parent/pom.xml Normal file
View file

@ -0,0 +1,183 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.kemitix</groupId>
<artifactId>kemitix-parent</artifactId>
<version>5.3.0</version>
<relativePath/>
</parent>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-parent</artifactId>
<version>DEV-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<scala-maven-plugin.version>4.4.0</scala-maven-plugin.version>
<tiles-maven-plugin.version>2.16</tiles-maven-plugin.version>
<kemitix-maven-tiles.version>2.7.0</kemitix-maven-tiles.version>
<scala-library.version>2.13.0</scala-library.version>
</properties>
<dependencyManagement>
<dependencies>
<!-- thorp -->
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-domain</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-filesystem</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-config</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-console</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-uishell</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-storage</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-lib</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-storage-aws</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-cli</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-app</artifactId>
<version>${project.version}</version>
</dependency>
<!-- scala - scala -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala-library.version}</version>
</dependency>
<!-- scala - zio -->
<dependency>
<groupId>dev.zio</groupId>
<artifactId>zio_2.13</artifactId>
<version>1.0.0-RC16</version>
</dependency>
<dependency>
<groupId>dev.zio</groupId>
<artifactId>zio-streams_2.13</artifactId>
<version>1.0.0-RC16</version>
</dependency>
<!-- scala - eip-zio -->
<dependency>
<groupId>net.kemitix</groupId>
<artifactId>eip-zio_2.13</artifactId>
<version>0.3.2</version>
</dependency>
<!-- scala - command line parsing -->
<dependency>
<groupId>com.github.scopt</groupId>
<artifactId>scopt_2.13</artifactId>
<version>4.0.0-RC2</version>
</dependency>
<!-- scala - test -->
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.13</artifactId>
<version>3.0.8</version>
</dependency>
<dependency>
<groupId>org.scalamock</groupId>
<artifactId>scalamock_2.13</artifactId>
<version>4.4.0</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>${scala-maven-plugin.version}</version>
<configuration>
<args>
<arg>-Ywarn-unused:imports</arg>
<arg>-Xfatal-warnings</arg>
<arg>-feature</arg>
<arg>-deprecation</arg>
<arg>-unchecked</arg>
<arg>-language:postfixOps</arg>
<arg>-language:higherKinds</arg>
</args>
</configuration>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>${tiles-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>net.kemitix.tiles:maven-plugins:${kemitix-maven-tiles.version}</tile>
<tile>net.kemitix.tiles:enforcer:${kemitix-maven-tiles.version}</tile>
<tile>net.kemitix.tiles:compiler-jdk-8:${kemitix-maven-tiles.version}</tile>
<tile>net.kemitix.tiles:huntbugs:${kemitix-maven-tiles.version}</tile>
<tile>net.kemitix.tiles:pmd:${kemitix-maven-tiles.version}</tile>
<tile>net.kemitix.tiles:digraph:${kemitix-maven-tiles.version}</tile>
<tile>net.kemitix.tiles:testing:${kemitix-maven-tiles.version}</tile>
<!-- <tile>net.kemitix.tiles:coverage:${kemitix-maven-tiles.version}</tile>-->
<!-- <tile>net.kemitix.tiles:pitest:${kemitix-maven-tiles.version}</tile>-->
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>

53
pom.xml Normal file
View file

@ -0,0 +1,53 @@
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-root</artifactId>
<version>DEV-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>parent</module>
<module>domain</module>
<module>filesystem</module>
<module>config</module>
<module>console</module>
<module>uishell</module>
<module>storage</module>
<module>lib</module>
<module>storage-aws</module>
<module>cli</module>
<module>app</module>
</modules>
<properties>
<maven-graph-plugin.version>1.45</maven-graph-plugin.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.fusesource.mvnplugins</groupId>
<artifactId>maven-graph-plugin</artifactId>
<version>${maven-graph-plugin.version}</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>reactor</goal>
</goals>
</execution>
</executions>
<configuration>
<direction>TB</direction>
<hideTransitive>true</hideTransitive>
<hideVersion>true</hideVersion>
<hideOptional>true</hideOptional>
<hideScopes>test,provided</hideScopes>
<target>${project.basedir}/docs/images/reactor-graph.png</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

83
storage-aws/pom.xml Normal file
View file

@ -0,0 +1,83 @@
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-parent</artifactId>
<version>DEV-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>thorp-storage-aws</artifactId>
<name>storage-aws</name>
<dependencies>
<!-- thorp -->
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-storage</artifactId>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-filesystem</artifactId>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-console</artifactId>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-lib</artifactId>
</dependency>
<!-- scala -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</dependency>
<!-- aws-sdk -->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version>1.11.792</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.4</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-cbor</artifactId>
<version>2.10.4</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<!-- scala - testing -->
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.13</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalamock</groupId>
<artifactId>scalamock_2.13</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View file

@ -25,8 +25,8 @@ class UploaderTest extends FreeSpec with MockFactory {
val uiChannel: UChannel[Any, UIEvent] = zioMessage => () val uiChannel: UChannel[Any, UIEvent] = zioMessage => ()
"upload" - { "upload" - {
val aSource: File = Resource(this, "") val aSource: File = Resource(this, "").toFile
val aFile: File = Resource(this, "small-file") val aFile: File = Resource(this, "small-file").toFile
val aHash = MD5Hash("aHash") val aHash = MD5Hash("aHash")
val hashes = Map[HashType, MD5Hash](MD5 -> aHash) val hashes = Map[HashType, MD5Hash](MD5 -> aHash)
val remoteKey = RemoteKey("aRemoteKey") val remoteKey = RemoteKey("aRemoteKey")

51
storage/pom.xml Normal file
View file

@ -0,0 +1,51 @@
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-parent</artifactId>
<version>DEV-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>thorp-storage</artifactId>
<name>storage</name>
<dependencies>
<!-- thorp -->
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-uishell</artifactId>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-domain</artifactId>
</dependency>
<!-- scala -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</dependency>
<!-- zio -->
<dependency>
<groupId>dev.zio</groupId>
<artifactId>zio_2.13</artifactId>
</dependency>
<dependency>
<groupId>dev.zio</groupId>
<artifactId>zio-streams_2.13</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

73
uishell/pom.xml Normal file
View file

@ -0,0 +1,73 @@
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-parent</artifactId>
<version>DEV-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>thorp-uishell</artifactId>
<name>uishell</name>
<dependencies>
<!-- thorp -->
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-config</artifactId>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-console</artifactId>
</dependency>
<dependency>
<groupId>net.kemitix.thorp</groupId>
<artifactId>thorp-filesystem</artifactId>
</dependency>
<!-- scala -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</dependency>
<!-- eip-zio -->
<dependency>
<groupId>net.kemitix</groupId>
<artifactId>eip-zio_2.13</artifactId>
</dependency>
<!-- zio -->
<dependency>
<groupId>dev.zio</groupId>
<artifactId>zio_2.13</artifactId>
</dependency>
<dependency>
<groupId>dev.zio</groupId>
<artifactId>zio-streams_2.13</artifactId>
</dependency>
<!-- scala - testing -->
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.13</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalamock</groupId>
<artifactId>scalamock_2.13</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>