Skip to content

Commit

Permalink
Merge pull request #137 from Netflix/mslcli-separation
Browse files Browse the repository at this point in the history
Separate out MSL CLI client and server into their own sub-projects.
  • Loading branch information
wmiaw authored Oct 4, 2016
2 parents eda907f + c989192 commit 61e4a1c
Show file tree
Hide file tree
Showing 67 changed files with 54 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'war'

dependencies {
compile 'javax.servlet:servlet-api:2.5'
Expand All @@ -12,4 +11,3 @@ dependencies {
mainClassName = "mslcli.client.ClientApp"

jar.baseName "mslcli-core"
war.baseName = "mslcli-server"
File renamed without changes.
File renamed without changes.
51 changes: 34 additions & 17 deletions examples/mslcli/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,49 @@ MSL Command Line Interface.

This implementation is very basic by intent.
MSL server is a simple ECHO server accepting arbitrary inputs.
Passing JSON-formatted payloads and implementing data abstraction
layer for payload marshalling/unmarshalling was not viewed as an
essential goal, because it does not help in understanding of MSL
core; MSL messages in general can carry arbitrary payload data.
Passing JSON-formatted payloads and implementing data abstraction layer
for payload marshalling/unmarshalling was not viewed as an essential goal,
because it does not help in understanding of MSL core; MSL messages in
general can carry arbitrary payload data.

MSL CLI should be built from the top level directory where the gradlew binary
is located:
% ./gradlew -p examples/mslcli compileJava

Build distribution, so all dependencies can be picked up easily:
% ./gradlew -p examples/mslcli distZip
Contents:
========

Then go to the mslcli build directory:
% cd examples/mslcli/build
* client:
Client code example, and MSLCLI common library.

Unzip the distribution ZIP into the build directory:
* server:
Server code example - depends upon client MSLCLI.


First build the client/lib and distribution:

% ./gradlew -p examples/mslcli/client compileJava
% ./gradlew -p examples/mslcli/client distZip

Next, build the Server

% ./gradlew -p examples/mslcli/server compileJava
% ./gradlew -p examples/mslcli/server distZip

Extract the client and server distributions into their respective build
directories:

% cd examples/mslcli/client/build
% unzip distributions/*.zip
% cd ../../../../examples/mslcli/server/build
% unzip distributions/*.zip

From the new directory, open two terminal sessions to run the MSL CLI client
and server.
From the new client directory, open a new terminal session to run the MSL CLI client

From one, start the client
% ./bin/mslclient.sh [options]
% ./bin/mslclient.sh help
% ./client/build/distributions/*/bin/mslclient.sh [options]
% ./client/build/distributions/*/bin/mslclient.sh help

From another start the server
% ./bin/mslserver.sh
From another terminal start the server
% ./server/build/distributions/*/bin/mslserver.sh

The server is terminated by pressing Ctrl-C.
The server is terminated by pressing Ctrl-C.
15 changes: 15 additions & 0 deletions examples/mslcli/server/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'war'

dependencies {
compile 'javax.servlet:servlet-api:2.5'
compile project(':msl-core')
compile project(':msl-cli')
compile 'org.bouncycastle:bcprov-jdk15on:1.46'
compile 'org.json:json:20140107'
}

mainClassName = "mslcli.server.SimpleHttpServer"
war.baseName = "mslcli-server"
jar.enabled = true
File renamed without changes.
File renamed without changes.
9 changes: 5 additions & 4 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ rootProject.name = 'msl-root'
include 'core', 'tests', 'integ-tests'
include 'examples/simple', 'examples/kancolle'
include 'examples/burp', 'examples/burp-extender'
include 'examples/mslcli', 'examples/oneshot'
include 'examples/proxy'
include 'examples/mslcli/client', 'examples/mslcli/server'
include 'examples/oneshot', 'examples/proxy'

project(':core').name = 'msl-core'
project(':tests').name = 'msl-tests'
Expand All @@ -13,6 +13,7 @@ project(':examples/simple').name = 'msl-example'
project(':examples/kancolle').name = 'msl-kancolle'
project(':examples/burp').name = 'msl-burp'
project(':examples/burp-extender').name = 'burp-extender'
project(':examples/mslcli').name = 'msl-cli'
project(':examples/mslcli/client').name = 'msl-cli'
project(':examples/mslcli/server').name = 'msl-cli-server'
project(':examples/oneshot').name = 'msl-oneshot'
project(':examples/proxy').name = 'msl-proxy'
project(':examples/proxy').name = 'msl-proxy'

0 comments on commit 61e4a1c

Please sign in to comment.