m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md3
-rw-r--r--build.gradle10
2 files changed, 10 insertions, 3 deletions
diff --git a/README.md b/README.md
index 1f46676..47cdd3e 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,9 @@
## Running
+The agent, fetcher, and interpreter take an optional `-Dhostname=<agent's external hostname`
+argument, which defaults to `localhost`.
+
### API Agent
# start rmiregistry
diff --git a/build.gradle b/build.gradle
index 2195aee..82a430e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -14,6 +14,10 @@ plugins {
id 'application'
}
+ext.hostname = {
+ return System.getProperty("hostname") ?: "localhost"
+}
+
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
@@ -49,19 +53,19 @@ application {
task runAgent(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'pl.edu.mimuw.cloudatlas.agent.Agent'
- systemProperty 'java.rmi.server.hostname', System.getProperty('hostname')
+ systemProperty 'java.rmi.server.hostname', hostname()
}
task runClient(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'pl.edu.mimuw.cloudatlas.client.Client'
- systemProperty 'agent_hostname', System.getProperty('hostname')
+ systemProperty 'agent_hostname', hostname()
}
task runFetcher(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'pl.edu.mimuw.cloudatlas.fetcher.Fetcher'
- args(System.getProperty('hostname'), 1099)
+ args(hostname() , 1099)
}
task runInterpreter(type: JavaExec) {