m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/build.gradle
diff options
context:
space:
mode:
authorMartin <marcin.j.chrzanowski@gmail.com>2019-11-27 23:18:27 +0100
committerGitHub <noreply@github.com>2019-11-27 23:18:27 +0100
commit0cff4e616cdf5f3ea4506e828c891baa4556b38c (patch)
tree6e203992404cca6fda7beb3d29070092ffdeff3c /build.gradle
parent3ce9014da9d789b1ba9c03c6dcc8c663576353e3 (diff)
Set default hostname (#45)
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle10
1 files changed, 7 insertions, 3 deletions
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) {