Skip to content
Snippets Groups Projects
Commit 51f80e61 authored by Frantisek Simon's avatar Frantisek Simon
Browse files

#78 Moved http protocol settings to gradle.properties

parent 7a5061bd
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,7 @@ task writeTablexiaBuildConfig {
"\n" +
" public final static String VERSION_NAME = \"${tablexiaVersionName}\";\n" +
" public final static String ASSETS_CHECKSUM = \"${getMapConvertedToString(rootProject.ext.assetsChecksum)}\";\n" +
" public final static String TABLEXIA_SERVER_PROTOCOL = ${project.hasProperty('TABLEXIA_SERVER_PROTOCOL') ? "\"$TABLEXIA_SERVER_PROTOCOL\"" : "null"};\n" +
" public final static String TABLEXIA_SERVER_HOST = ${project.hasProperty('TABLEXIA_SERVER_HOST') ? "\"$TABLEXIA_SERVER_HOST\"" : "null"};\n" +
" public final static Integer TABLEXIA_SERVER_PORT = ${project.hasProperty('TABLEXIA_SERVER_PORT') ? "$TABLEXIA_SERVER_PORT" : "null"};\n" +
" public final static String TABLEXIA_SERVER_SECRET = ${project.hasProperty('TABLEXIA_SERVER_SECRET') ? "\"$TABLEXIA_SERVER_SECRET\"" : "null"};\n" +
......
......@@ -28,14 +28,17 @@ public class RestSynchronizationService {
INCREMENT,
}
private static final String PROTOCOL = "http://";
private static final String PROTOCOL_DIVIDER = "://";
private static final String PORT_DIVIDER = ":";
private static final String FALLBACK_REST_HOST = "localhost";
private static final int FALLBACK_REST_PORT = 8080;
public static final String SECRET_KEY = TablexiaBuildConfig.TABLEXIA_SERVER_SECRET;
private static final String FALLBACK_REST_PROTOCOL = "http";
private static final String FALLBACK_REST_HOST = "localhost";
private static final int FALLBACK_REST_PORT = 8080;
private static final String SECRET_KEY = TablexiaBuildConfig.TABLEXIA_SERVER_SECRET;
public static final String REST_ADDRESS = PROTOCOL +
private static final String REST_ADDRESS =
(TablexiaBuildConfig.TABLEXIA_SERVER_PROTOCOL != null ? TablexiaBuildConfig.TABLEXIA_SERVER_PROTOCOL : FALLBACK_REST_PROTOCOL) +
PROTOCOL_DIVIDER +
(TablexiaBuildConfig.TABLEXIA_SERVER_HOST != null ? TablexiaBuildConfig.TABLEXIA_SERVER_HOST : FALLBACK_REST_HOST) +
PORT_DIVIDER +
(TablexiaBuildConfig.TABLEXIA_SERVER_PORT != null ? TablexiaBuildConfig.TABLEXIA_SERVER_PORT : FALLBACK_REST_PORT);
......@@ -105,5 +108,5 @@ public class RestSynchronizationService {
public static String getSecurityGetUrl() {
return REST_ADDRESS + SecurityRestPath.SECURITY_PATH + SecurityRestPath.SECURITY_GET;
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment