[m-rev.] For review: Implementation of library version in Java
James Goddard
goddardjames at yahoo.com
Tue Jan 20 14:16:53 AEDT 2004
Estimated hours taken: 2
Branches: main
Implement library version for Java.
library/library.m:
Implement library__version in Java.
java/runtime/Constants.java.in:
File from which Constants.java is to be generated, which is the source
for a class to hold mercury-related constants, such as the library
version.
configure.in:
Added java/runtime/Constants.java to the list of files to generate.
Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.383
diff -u -d -r1.383 configure.in
--- configure.in 23 Dec 2003 06:16:59 -0000 1.383
+++ configure.in 20 Jan 2004 03:04:17 -0000
@@ -3700,7 +3700,7 @@
scripts/canonical_grade
scripts/mkfifo_using_mknod bindist/bindist.INSTALL bindist/bindist.Makefile
scripts/mercury_config scripts/Mercury.config scripts/Mercury.config.bootstrap
-tools/lmc tools/dotime runtime/mercury_dotnet.cs
+tools/lmc tools/dotime runtime/mercury_dotnet.cs java/runtime/Constants.java
,
[
# Only do this when compiling the source, not when reconfiguring
Index: library/library.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/library.m,v
retrieving revision 1.72
diff -u -d -r1.72 library.m
--- library/library.m 13 Nov 2003 15:08:11 -0000 1.72
+++ library/library.m 20 Jan 2004 02:38:01 -0000
@@ -126,5 +126,13 @@
+ mercury.runtime.Constants.MR_FULLARCH;
").
+:- pragma foreign_proc("Java",
+ library__version(Version::out),
+ [will_not_call_mercury, promise_pure],
+"
+ Version = mercury.runtime.Constants.MR_VERSION + "" configured for ""
+ + mercury.runtime.Constants.MR_FULLARCH;
+").
+
%---------------------------------------------------------------------------%
%---------------------------------------------------------------------------%
Index: java/runtime/Constants.java.in
===================================================================
RCS file: java/runtime/Constants.java.in
diff -N java/runtime/Constants.java.in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ java/runtime/Constants.java.in 20 Jan 2004 02:42:02 -0000
@@ -0,0 +1,15 @@
+//
+// Copyright (C) 2001-2004 The University of Melbourne.
+// This file may only be copied under the terms of the GNU Library General
+// Public License - see the file COPYING.LIB in the Mercury distribution.
+//
+// This class is used to store miscellaneous Mercury-related constants.
+// At the moment it just stores the library version.
+//
+
+package mercury.runtime;
+
+public class Constants {
+ public static final java.lang.String MR_VERSION = "@VERSION@";
+ public static final java.lang.String MR_FULLARCH = "@FULLARCH@";
+}
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list