Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 127 additions & 0 deletions functional_java/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Created by https://www.gitignore.io/api/gradle,intellij

### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml

# Sensitive or high-churn files:
.idea/dataSources/
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml

# Gradle:
.idea/gradle.xml
.idea/libraries

# Mongo Explorer plugin:
.idea/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

### Gradle ###
.gradle
/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties

# End of https://www.gitignore.io/api/gradle,intellij
# Created by https://www.gitignore.io/api/eclipse

### Eclipse ###

.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders

# Eclipse Core
.project

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# PyDev specific (Python IDE for Eclipse)
*.pydevproject

# CDT-specific (C/C++ Development Tooling)
.cproject

# JDT-specific (Eclipse Java Development Tools)
.classpath

# Java annotation processor (APT)
.factorypath

# PDT-specific (PHP Development Tools)
.buildpath

# sbteclipse plugin
.target

# Tern plugin
.tern-project

# TeXlipse plugin
.texlipse

# STS (Spring Tool Suite)
.springBeans

# Code Recommenders
.recommenders/

# End of https://www.gitignore.io/api/eclipse
22 changes: 22 additions & 0 deletions functional_java/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Client requirement:
java 1.8

To build and run all tests:
> ./gradlew build --offline

To run the unit tests only:
> ./gradlew test --offline

To run the application, create a fatJar first, then execute it
> ./gradlew clean build fatJar --offline
> java -jar build/libs/ddd-workshop-0.0.1-SNAPSHOT-all.jar

To run with a specific stream, for example: data/1.json, run:
> java -jar build/libs/ddd-workshop-0.0.1-SNAPSHOT-all.jar ../data/1.json

By default the eventstream is retrieved from the server. In case of network problems Wire the FileEventStreamProvider
in the Main class instead of the RestEventStreamProvider.

There are different streams of events. If no stream is specified the system will default to zero.
The stream id is taken as the first argument pass to the application.
Add the stream id (0,1,2) to the program arguments.
72 changes: 72 additions & 0 deletions functional_java/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
apply plugin: 'java'

jar {
baseName = 'ddd-workshop'
version = '0.0.1-SNAPSHOT'
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
mavenCentral()
}

task wrapper(type: Wrapper) {
gradleVersion = '2.4'
}

ext.libs = "$projectDir/libs"
ext.compileLib = "${libs}/compile"
ext.runtimeLib = "${libs}/runtime"
ext.testCompileLib = "${libs}/testCompile"
ext.testRuntimeLib = "${libs}/testRuntime"
ext.providedCompileLib = "${libs}/providedCompile"

dependencies {
if (gradle.startParameter.isOffline()) {
println "--------------------"
println "Using local libs"
println "--------------------"
compile fileTree(dir: compileLib)
runtime fileTree(dir: runtimeLib)
testCompile fileTree(dir: testCompileLib)
testRuntime fileTree(dir: testRuntimeLib)
} else {
println "-------------------------------"
println "Using Maven central for libs"
println "-------------------------------"
compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.5")
testCompile('junit:junit:4.12')
}
}

task deleteLibs(type: Delete) {
delete 'libs/compile'
delete 'libs/runtime'
delete 'libs/testCompile'
delete 'libs/testRuntime'
}

task copyToLibs(dependsOn: 'deleteLibs') << {
['compile', 'runtime', 'testCompile', 'testRuntime'].each {scope ->
copy {
from configurations.getByName(scope).files
into "${libs}/${scope}"
}
}
}

task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Playing with projections',
'Implementation-Version': jar.version,
'Main-Class': 'be.playing.with.projections.Main'
}
baseName = jar.baseName + '-' + jar.version + '-all'
from {configurations.compile.collect {it.isDirectory() ? it : zipTree(it)}}
with jar
}

tasks.jar.dependsOn fatJar

Binary file added functional_java/gradle/wrapper/gradle-2.4-bin.zip
Binary file not shown.
Binary file added functional_java/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions functional_java/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#Sat Sep 17 17:24:50 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
#distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-all.zip
distributionUrl=gradle-2.4-bin.zip
164 changes: 164 additions & 0 deletions functional_java/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading