diff options
author | Martin <marcin.j.chrzanowski@gmail.com> | 2019-11-27 23:18:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-27 23:18:27 +0100 |
commit | 0cff4e616cdf5f3ea4506e828c891baa4556b38c (patch) | |
tree | 6e203992404cca6fda7beb3d29070092ffdeff3c | |
parent | 3ce9014da9d789b1ba9c03c6dcc8c663576353e3 (diff) |
Set default hostname (#45)
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | build.gradle | 10 |
2 files changed, 10 insertions, 3 deletions
@@ -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) { |