diff options
author | Shireesh Anjal <shireesh@gluster.com> | 2011-12-12 15:52:51 +0530 |
---|---|---|
committer | Shireesh Anjal <shireesh@gluster.com> | 2011-12-12 15:52:51 +0530 |
commit | 12a8f8bacffa9e7e6d600ac4d7e95c7d46b836e3 (patch) | |
tree | 4f8c1ebeb64e900ceb5e20f9756f2de01996db2e /src | |
parent | 5fee99642f7726955dd1721e1b90a8865e9fe050 (diff) |
Modified to include API version number in root JNLP file, and rename the feature jnlp file appropriately during build.
Modified ClientUtil to pick up the API version number from the system property gluster.api.version
Diffstat (limited to 'src')
5 files changed, 32 insertions, 3 deletions
diff --git a/src/org.gluster.storage.management.client/src/org/gluster/storage/management/client/constants/ClientConstants.java b/src/org.gluster.storage.management.client/src/org/gluster/storage/management/client/constants/ClientConstants.java index f683a507..6a8f0e5d 100644 --- a/src/org.gluster.storage.management.client/src/org/gluster/storage/management/client/constants/ClientConstants.java +++ b/src/org.gluster.storage.management.client/src/org/gluster/storage/management/client/constants/ClientConstants.java @@ -25,7 +25,8 @@ public class ClientConstants { public static final String SYS_PROP_SERVER_URL = "gluster.server.url"; public static final String DEFAULT_SERVER_URL = "https://localhost:8443/glustermg/linux.gtk.x86_64"; public static final String CONTEXT_ROOT = "glustermg"; - public static final String REST_API_VERSION = "1.0.0"; + public static final String SYS_PROP_API_VERSION = "gluster.api.version"; + public static final String DEFAULT_API_VERSION = "1.0.0"; // SSL related public static final String TRUSTED_KEYSTORE = "gmc-trusted.keystore"; diff --git a/src/org.gluster.storage.management.client/src/org/gluster/storage/management/client/utils/ClientUtil.java b/src/org.gluster.storage.management.client/src/org/gluster/storage/management/client/utils/ClientUtil.java index ed05ad12..a4d665f9 100644 --- a/src/org.gluster.storage.management.client/src/org/gluster/storage/management/client/utils/ClientUtil.java +++ b/src/org.gluster.storage.management.client/src/org/gluster/storage/management/client/utils/ClientUtil.java @@ -28,7 +28,11 @@ import org.gluster.storage.management.client.constants.ClientConstants; public class ClientUtil { public static URI getServerBaseURI() { - return UriBuilder.fromUri(getBaseURL()).path(ClientConstants.REST_API_VERSION).build(); + return UriBuilder.fromUri(getBaseURL()).path(getAPIVersion()).build(); + } + + private static String getAPIVersion() { + return System.getProperty(ClientConstants.SYS_PROP_API_VERSION, ClientConstants.DEFAULT_API_VERSION); } private static String getBaseURL() { diff --git a/src/org.gluster.storage.management.console.feature.webstart/buckminster.cspex b/src/org.gluster.storage.management.console.feature.webstart/buckminster.cspex index 252a5e15..7a7a9b95 100644 --- a/src/org.gluster.storage.management.console.feature.webstart/buckminster.cspex +++ b/src/org.gluster.storage.management.console.feature.webstart/buckminster.cspex @@ -37,5 +37,11 @@ <property key="targets" value="copy.root.files" /> </actorProperties> </public> + <public name="update.version" actor="ant"> + <actorProperties> + <property key="buildFile" value="build/glustermc.ant" /> + <property key="targets" value="update.version" /> + </actorProperties> + </public> </actions> </cspecExtension> diff --git a/src/org.gluster.storage.management.console.feature.webstart/build/glustermc.ant b/src/org.gluster.storage.management.console.feature.webstart/build/glustermc.ant index 93bf3ccb..a1dc0c66 100644 --- a/src/org.gluster.storage.management.console.feature.webstart/build/glustermc.ant +++ b/src/org.gluster.storage.management.console.feature.webstart/build/glustermc.ant @@ -1,5 +1,7 @@ <project> <property name="export.dir" value="${buckminster.output}/glustermc/" /> + <property name="jnlp.file" value="${export.dir}/gluster-management-console.jnlp" /> + <target name='unsign'> <buckminster.signatureCleaner> <fileset dir='${export.dir}/plugins'> @@ -27,4 +29,17 @@ <fileset dir="${basedir}/rootfiles" /> </copy> </target> + + <target name='update.version'> + <replace file="${jnlp.file}" token="@VERSION@" value="${product.version}" /> + <move todir="${export.dir}"> + <fileset dir="${export.dir}" /> + <mapper> + <mapper type="regexp" + from="org.gluster.storage.management.console.feature_.*.jnlp" + to="org.gluster.storage.management.console.feature_${product.version}.jnlp" /> + </mapper> + </move> + </target> + </project> diff --git a/src/org.gluster.storage.management.console.feature.webstart/rootfiles/gluster-management-console.jnlp b/src/org.gluster.storage.management.console.feature.webstart/rootfiles/gluster-management-console.jnlp index ee333971..b5417bb8 100644 --- a/src/org.gluster.storage.management.console.feature.webstart/rootfiles/gluster-management-console.jnlp +++ b/src/org.gluster.storage.management.console.feature.webstart/rootfiles/gluster-management-console.jnlp @@ -20,7 +20,7 @@ <jar href="plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar" main="true"/> <extension name="Gluster Management Console" - href="org.gluster.storage.management.console.feature_1.0.0.jnlp"/> + href="org.gluster.storage.management.console.feature_@VERSION@.jnlp"/> <property name="osgi.instance.area" value="@user.home/Application Data/glustermc"/> @@ -33,6 +33,9 @@ <property name="gluster.server.url" value="$$codebase"/> + <property + name="gluster.api.version" + value="@VERSION@"/> <property name="javaws.cfg.jauthenticator" value="true"/> |