Browse Source

coreapi version, increment plugin version

David Rose 15 years ago
parent
commit
d3e9e4c4f5

+ 12 - 1
dtool/PandaVersion.pp

@@ -34,4 +34,15 @@
 // PANDA_PACKAGE_VERSION, because it is anticipated that this plugin
 // code, once settled, will need to be updated much less frequently
 // than Panda itself.
-#define P3D_PLUGIN_VERSION 1 0 1
+#define P3D_PLUGIN_VERSION 1 0 2
+
+// Finally, there's a separate version number for the Core API.  At
+// first, we didn't believe we needed a Core API version number, but
+// in this belief we were naive.  This version number is a little less
+// strict in its format requirements than P3D_PLUGIN_VERSION, above,
+// and it doesn't necessarily consist of a specific number of
+// integers, but by convention it will consist of four integers, and
+// with the first three matching the plugin version, and the fourth
+// integer being incremented with each new Core API revision.
+#define P3D_COREAPI_VERSION $[P3D_PLUGIN_VERSION] 1
+

+ 25 - 0
dtool/src/dtoolutil/pandaSystem.cxx

@@ -118,6 +118,31 @@ get_package_host_url() {
 #endif
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: PandaSystem::get_p3d_coreapi_version_string
+//       Access: Published, Static
+//  Description: Returns the current version of Panda's Core API,
+//               expressed as a string of dot-delimited integers.
+//               There are usually four integers in this version, but
+//               this is not guaranteed.
+//
+//               The Core API is used during the runtime (plugin)
+//               environment only.  This may be the empty string if
+//               the current version of Panda is not built to provide
+//               a particular Core API, which will be the normal case
+//               in a development SDK.  However, you should not use
+//               this method to determine whether you are running in a
+//               runtime environment or not.
+////////////////////////////////////////////////////////////////////
+string PandaSystem::
+get_p3d_coreapi_version_string() {
+#ifndef P3D_COREAPI_VERSION_STR
+  return "";
+#else
+  return P3D_COREAPI_VERSION_STR;
+#endif
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: PandaSystem::get_major_version
 //       Access: Published, Static

+ 1 - 0
dtool/src/dtoolutil/pandaSystem.h

@@ -35,6 +35,7 @@ PUBLISHED:
   static string get_version_string();
   static string get_package_version_string();
   static string get_package_host_url();
+  static string get_p3d_coreapi_version_string();
 
   static int get_major_version();
   static int get_minor_version();

+ 1 - 0
dtool/src/dtoolutil/pandaVersion.h.pp

@@ -81,6 +81,7 @@ $[cdefine PANDA_NUMERIC_VERSION]
 $[cdefine P3D_PLUGIN_MAJOR_VERSION]
 $[cdefine P3D_PLUGIN_MINOR_VERSION]
 $[cdefine P3D_PLUGIN_SEQUENCE_VERSION]
+# define P3D_COREAPI_VERSION_STR "$[join .,$[P3D_COREAPI_VERSION]]"
 #endif
 
 #end pandaVersion.h