autogenerate xbmc version dependent files
authorwsnipex <wsnipex@a1.net>
Sat, 31 May 2014 09:07:02 +0000 (11:07 +0200)
committerwsnipex <wsnipex@a1.net>
Mon, 30 Jun 2014 07:17:12 +0000 (09:17 +0200)
23 files changed:
addons/xbmc.addon/addon.xml [deleted file]
addons/xbmc.addon/addon.xml.in [new file with mode: 0644]
tools/Linux/packaging/mk-debian-package.sh
tools/android/packaging/xbmc/AndroidManifest.xml [deleted file]
tools/android/packaging/xbmc/AndroidManifest.xml.in [new file with mode: 0644]
tools/buildsteps/osx32/package
tools/buildsteps/osx64/package
tools/darwin/Support/makepythoninterface.command
tools/darwin/packaging/xbmc-atv2/mkdeb-xbmc-atv2.sh.in
tools/darwin/packaging/xbmc-ios/mkdeb-xbmc-ios.sh.in
tools/darwin/packaging/xbmc-osx/mkdmg-xbmc-osx.sh [deleted file]
tools/darwin/packaging/xbmc-osx/mkdmg-xbmc-osx.sh.in [new file with mode: 0755]
xbmc/CompileInfo.cpp.in [new file with mode: 0644]
xbmc/CompileInfo.h [new file with mode: 0644]
xbmc/GUIInfoManager.cpp
xbmc/GUIInfoManager.h
xbmc/GitRevision.cpp [deleted file]
xbmc/GitRevision.h [deleted file]
xbmc/Makefile.in
xbmc/gen-compileinfo.mk [new file with mode: 0644]
xbmc/interfaces/json-rpc/ApplicationOperations.cpp
xbmc/osx/Info.plist [deleted file]
xbmc/osx/Info.plist.in [new file with mode: 0644]

diff --git a/addons/xbmc.addon/addon.xml b/addons/xbmc.addon/addon.xml
deleted file mode 100644 (file)
index 9e42db7..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<addon id="xbmc.addon" version="13.9.701" provider-name="Team XBMC">
-  <backwards-compatibility abi="12.0"/>
-  <requires>
-    <import addon="xbmc.core" version="0.1.0"/>
-  </requires>
-  <extension-point id="metadata" schema="metadata.xsd"/>
-  <extension-point id="repository" schema="repository.xsd"/>
-</addon>
diff --git a/addons/xbmc.addon/addon.xml.in b/addons/xbmc.addon/addon.xml.in
new file mode 100644 (file)
index 0000000..9409cbf
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<addon id="xbmc.addon" version="@APP_ADDON_API@" provider-name="Team XBMC">
+  <backwards-compatibility abi="12.0"/>
+  <requires>
+    <import addon="xbmc.core" version="0.1.0"/>
+  </requires>
+  <extension-point id="metadata" schema="metadata.xsd"/>
+  <extension-point id="repository" schema="repository.xsd"/>
+</addon>
index 5fd2efc..9a39dfc 100755 (executable)
@@ -73,8 +73,8 @@ function getVersion {
     getGitRev
     if [[ $RELEASEV == "auto" ]]
     then 
-        local MAJORVER=$(grep VERSION_MAJOR $REPO_DIR/xbmc/GUIInfoManager.h | awk '{ print $3 }')
-        local MINORVER=$(grep VERSION_MINOR $REPO_DIR/xbmc/GUIInfoManager.h | awk '{ print $3 }')
+        local MAJORVER=$(grep VERSION_MAJOR $REPO_DIR/version.txt | awk '{ print $2 }')
+        local MINORVER=$(grep VERSION_MINOR $REPO_DIR/version.txt | awk '{ print $2 }')
         RELEASEV=${MAJORVER}.${MINORVER}
     else
         PACKAGEVERSION="${RELEASEV}~git$(date '+%Y%m%d.%H%M')-${TAG}"
diff --git a/tools/android/packaging/xbmc/AndroidManifest.xml b/tools/android/packaging/xbmc/AndroidManifest.xml
deleted file mode 100644 (file)
index d69a5b3..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- BEGIN_INCLUDE(manifest) -->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="org.xbmc.xbmc"
-    android:versionCode="139701"
-    android:versionName="14.0-ALPHA1" >
-
-    <!-- This is the platform API where NativeActivity was introduced. -->
-    <uses-sdk android:minSdkVersion="14" />
-
-    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.WAKE_LOCK" />
-    <uses-permission android:name="android.permission.GET_TASKS" />
-       
-    <application android:icon="@drawable/ic_launcher" android:debuggable="true" android:label="@string/app_name" android:hasCode="true">
-        <activity
-            android:name=".Splash"
-            android:configChanges="orientation|keyboard|keyboardHidden|navigation|touchscreen"
-            android:finishOnTaskLaunch="true"
-            android:launchMode="singleInstance"
-            android:screenOrientation="sensorLandscape"
-            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-            <intent-filter>
-                <action android:name="android.intent.action.VIEW" />
-
-                <category android:name="android.intent.category.DEFAULT" />
-                <category android:name="android.intent.category.BROWSABLE" />
-
-                <data android:mimeType="video/*" />
-                <data android:mimeType="audio/*" />
-                <data android:mimeType="image/*" />
-
-                <data android:scheme="file" />
-                <data android:scheme="content" />
-                <data android:scheme="http" />
-                <data android:scheme="https" />
-                <data android:scheme="ftp" />
-                <data android:scheme="ftps" />
-                <data android:scheme="rtp" />
-                <data android:scheme="rtsp" />
-                <data android:scheme="mms" />
-                <data android:scheme="dav" />
-                <data android:scheme="davs" />
-                <data android:scheme="ssh" />
-                <data android:scheme="sftp" />
-                <data android:scheme="smb" />
-             </intent-filter>
-        </activity>
-
-        <!--
-             Our activity is the built-in NativeActivity framework class.
-             This will take care of integrating with our NDK code.
-        -->
-        <activity
-            android:name=".Main"
-            android:configChanges="orientation|keyboard|keyboardHidden|navigation"
-            android:finishOnTaskLaunch="true"
-            android:label="XBMC"
-            android:launchMode="singleInstance"
-            android:screenOrientation="sensorLandscape"
-            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
-
-            <!-- Tell NativeActivity the name of or .so -->
-            <meta-data
-                android:name="android.app.lib_name"
-                android:value="xbmc" />
-        </activity>
-    </application>
-
-</manifest><!-- END_INCLUDE(manifest) -->
-
diff --git a/tools/android/packaging/xbmc/AndroidManifest.xml.in b/tools/android/packaging/xbmc/AndroidManifest.xml.in
new file mode 100644 (file)
index 0000000..3edc514
--- /dev/null
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- BEGIN_INCLUDE(manifest) -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="org.xbmc.xbmc"
+    android:versionCode="@APP_VERSION_CODE@"
+    android:versionName="@APP_VERSION_MAJOR@.@APP_VERSION_MINOR@-@APP_VERSION_TAG@" >
+
+    <!-- This is the platform API where NativeActivity was introduced. -->
+    <uses-sdk android:minSdkVersion="14" />
+
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.WAKE_LOCK" />
+    <uses-permission android:name="android.permission.GET_TASKS" />
+       
+    <application android:icon="@drawable/ic_launcher" android:debuggable="true" android:label="@string/app_name" android:hasCode="true">
+        <activity
+            android:name=".Splash"
+            android:configChanges="orientation|keyboard|keyboardHidden|navigation|touchscreen"
+            android:finishOnTaskLaunch="true"
+            android:launchMode="singleInstance"
+            android:screenOrientation="sensorLandscape"
+            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+            <intent-filter>
+                <action android:name="android.intent.action.VIEW" />
+
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="android.intent.category.BROWSABLE" />
+
+                <data android:mimeType="video/*" />
+                <data android:mimeType="audio/*" />
+                <data android:mimeType="image/*" />
+
+                <data android:scheme="file" />
+                <data android:scheme="content" />
+                <data android:scheme="http" />
+                <data android:scheme="https" />
+                <data android:scheme="ftp" />
+                <data android:scheme="ftps" />
+                <data android:scheme="rtp" />
+                <data android:scheme="rtsp" />
+                <data android:scheme="mms" />
+                <data android:scheme="dav" />
+                <data android:scheme="davs" />
+                <data android:scheme="ssh" />
+                <data android:scheme="sftp" />
+                <data android:scheme="smb" />
+             </intent-filter>
+        </activity>
+
+        <!--
+             Our activity is the built-in NativeActivity framework class.
+             This will take care of integrating with our NDK code.
+        -->
+        <activity
+            android:name=".Main"
+            android:configChanges="orientation|keyboard|keyboardHidden|navigation"
+            android:finishOnTaskLaunch="true"
+            android:label="XBMC"
+            android:launchMode="singleInstance"
+            android:screenOrientation="sensorLandscape"
+            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
+
+            <!-- Tell NativeActivity the name of or .so -->
+            <meta-data
+                android:name="android.app.lib_name"
+                android:value="xbmc" />
+        </activity>
+    </application>
+
+</manifest><!-- END_INCLUDE(manifest) -->
+
index 5bce619..ca9c655 100755 (executable)
@@ -2,7 +2,7 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )}
 XBMC_PLATFORM_DIR=osx32
 . $WORKSPACE/tools/buildsteps/defaultenv
 
-cd $WORKSPACE/tools/darwin/packaging/xbmc-osx/;./mkdmg-xbmc-osx.sh $Configuration
+cd $WORKSPACE/tools/darwin/packaging/xbmc-osx/; sh ./mkdmg-xbmc-osx.sh $Configuration
 
 #rename for upload
 #e.x. xbmc-20130314-8c2fb31-Frodo-i386.dmg 
index ac50195..6ce8da4 100755 (executable)
@@ -2,7 +2,7 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )}
 XBMC_PLATFORM_DIR=osx64
 . $WORKSPACE/tools/buildsteps/defaultenv
 
-cd $WORKSPACE/tools/darwin/packaging/xbmc-osx/;./mkdmg-xbmc-osx.sh $Configuration
+cd $WORKSPACE/tools/darwin/packaging/xbmc-osx/; sh ./mkdmg-xbmc-osx.sh $Configuration
 
 #rename for upload
 #e.x. xbmc-20130314-8c2fb31-Frodo-x86_64.dmg 
index 50d3a22..ec2d2b4 100755 (executable)
@@ -8,4 +8,5 @@ fi
 
 if [ "$ACTION" = build ] ; then
   make -f ${SRCROOT}/codegenerator.mk
+  make -f ${SRCROOT}/xbmc/gen-compileinfo.mk
 fi
index ec15372..a40af5a 100644 (file)
@@ -45,8 +45,8 @@ fi
 
 PACKAGE=org.xbmc.xbmc-atv2
 
-VERSION=14.0
-REVISION=0~alpha1
+VERSION=@APP_VERSION_MAJOR@.@APP_VERSION_MINOR@
+REVISION=0~@APP_VERSION_TAG_LC@
 ARCHIVE=${PACKAGE}_${VERSION}-${REVISION}_iphoneos-arm.deb
 
 echo Creating $PACKAGE package version $VERSION revision $REVISION
index be99c0c..1db595e 100644 (file)
@@ -46,8 +46,8 @@ fi
 
 PACKAGE=org.xbmc.xbmc-ios
 
-VERSION=14.0
-REVISION=0~alpha1
+VERSION=@APP_VERSION_MAJOR@.@APP_VERSION_MINOR@
+REVISION=0~@APP_VERSION_TAG_LC@
 ARCHIVE=${PACKAGE}_${VERSION}-${REVISION}_iphoneos-arm.deb
 
 echo Creating $PACKAGE package version $VERSION revision $REVISION
diff --git a/tools/darwin/packaging/xbmc-osx/mkdmg-xbmc-osx.sh b/tools/darwin/packaging/xbmc-osx/mkdmg-xbmc-osx.sh
deleted file mode 100755 (executable)
index efec7f8..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-
-# usage: ./mkdmg-xbmc-osx.sh release/debug (case insensitive)
-# Allows us to run mkdmg-xbmc-osx.sh from anywhere in the three, rather than the tools/darwin/packaging/xbmc-osx folder only
-SWITCH=`echo $1 | tr [A-Z] [a-z]`
-DIRNAME=`dirname $0`
-
-if [ ${SWITCH:-""} = "debug" ]; then
-  echo "Packaging Debug target for OSX"
-  XBMC="$DIRNAME/../../../../build/Debug/XBMC.app"
-elif [ ${SWITCH:-""} = "release" ]; then
-  echo "Packaging Release target for OSX"
-  XBMC="$DIRNAME/../../../../build/Release/XBMC.app"
-else
-  echo "You need to specify the build target"
-  exit 1 
-fi
-
-if [ ! -d $XBMC ]; then
-  echo "XBMC.app not found! are you sure you built $1 target?"
-  exit 1
-fi
-ARCHITECTURE=`file $XBMC/Contents/MacOS/XBMC | awk '{print $NF}'`
-
-PACKAGE=org.xbmc.xbmc-osx
-
-VERSION=14.0
-REVISION=0~alpha1
-ARCHIVE=${PACKAGE}_${VERSION}-${REVISION}_macosx-intel-${ARCHITECTURE}
-
-echo Creating $PACKAGE package version $VERSION revision $REVISION
-${SUDO} rm -rf $DIRNAME/$ARCHIVE
-
-if [ -e "/Volumes/$ARCHIVE" ]
-then 
-  umount /Volumes/$ARCHIVE
-fi
-
-$DIRNAME/dmgmaker.pl $XBMC $ARCHIVE
-
-echo "done"
diff --git a/tools/darwin/packaging/xbmc-osx/mkdmg-xbmc-osx.sh.in b/tools/darwin/packaging/xbmc-osx/mkdmg-xbmc-osx.sh.in
new file mode 100755 (executable)
index 0000000..60764d2
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# usage: ./mkdmg-xbmc-osx.sh release/debug (case insensitive)
+# Allows us to run mkdmg-xbmc-osx.sh from anywhere in the three, rather than the tools/darwin/packaging/xbmc-osx folder only
+SWITCH=`echo $1 | tr [A-Z] [a-z]`
+DIRNAME=`dirname $0`
+
+if [ ${SWITCH:-""} = "debug" ]; then
+  echo "Packaging Debug target for OSX"
+  XBMC="$DIRNAME/../../../../build/Debug/XBMC.app"
+elif [ ${SWITCH:-""} = "release" ]; then
+  echo "Packaging Release target for OSX"
+  XBMC="$DIRNAME/../../../../build/Release/XBMC.app"
+else
+  echo "You need to specify the build target"
+  exit 1 
+fi
+
+if [ ! -d $XBMC ]; then
+  echo "XBMC.app not found! are you sure you built $1 target?"
+  exit 1
+fi
+ARCHITECTURE=`file $XBMC/Contents/MacOS/XBMC | awk '{print $NF}'`
+
+PACKAGE=org.xbmc.xbmc-osx
+
+VERSION=@APP_VERSION_MAJOR@.@APP_VERSION_MINOR@
+REVISION=0~@APP_VERSION_TAG_LC@
+ARCHIVE=${PACKAGE}_${VERSION}-${REVISION}_macosx-intel-${ARCHITECTURE}
+
+echo Creating $PACKAGE package version $VERSION revision $REVISION
+${SUDO} rm -rf $DIRNAME/$ARCHIVE
+
+if [ -e "/Volumes/$ARCHIVE" ]
+then 
+  umount /Volumes/$ARCHIVE
+fi
+
+$DIRNAME/dmgmaker.pl $XBMC $ARCHIVE
+
+echo "done"
diff --git a/xbmc/CompileInfo.cpp.in b/xbmc/CompileInfo.cpp.in
new file mode 100644 (file)
index 0000000..7903e1b
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ *      Copyright (C) 2014 Team XBMC
+ *      http://xbmc.org
+ *
+ *  This Program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This Program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with XBMC; see the file COPYING.  If not, see
+ *  <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "CompileInfo.h"
+#include <cstddef>
+
+#if defined(TARGET_DARWIN) || (defined(TARGET_WINDOWS) && !defined(_DEBUG))
+#include "../git_revision.h" // generated file
+#endif
+
+
+int CCompileInfo::GetMajor()
+{
+  return @APP_VERSION_MAJOR@;
+}
+
+int CCompileInfo::GetMinor()
+{
+  return @APP_VERSION_MINOR@;
+}
+
+const char* CCompileInfo::GetSuffix()
+{
+  return "@APP_VERSION_TAG@";
+}
+
+const char* CCompileInfo::GetSCMID()
+{
+#ifdef GIT_REV
+  return GIT_REV;
+#else
+  return "Unknown";
+#endif
+}
diff --git a/xbmc/CompileInfo.h b/xbmc/CompileInfo.h
new file mode 100644 (file)
index 0000000..d6e8dd7
--- /dev/null
@@ -0,0 +1,30 @@
+#pragma once
+
+/*
+ *      Copyright (C) 2014 Team XBMC
+ *      http://xbmc.org
+ *
+ *  This Program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This Program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with XBMC; see the file COPYING.  If not, see
+ *  <http://www.gnu.org/licenses/>.
+ *
+ */
+
+class CCompileInfo
+{
+public:
+  static int GetMajor();
+  static int GetMinor();
+  static const char *GetSuffix();  // Git "Tag", e.g. alpha1
+  static const char* GetSCMID();   // Git Revision
+};
index 58c79f4..4c523ec 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "network/Network.h"
 #include "system.h"
-#include "GitRevision.h"
+#include "CompileInfo.h"
 #include "GUIInfoManager.h"
 #include "windows/GUIMediaWindow.h"
 #include "dialogs/GUIDialogProgress.h"
@@ -4211,15 +4211,15 @@ CTemperature CGUIInfoManager::GetGPUTemperature()
 // in the HTTP request user agent.
 std::string CGUIInfoManager::GetVersionShort(void)
 {
-  return StringUtils::Format("%d.%d%s", VERSION_MAJOR, VERSION_MINOR, VERSION_TAG);
+  if (strlen(CCompileInfo::GetSuffix()) == 0)
+    return StringUtils::Format("%d.%d", CCompileInfo::GetMajor(), CCompileInfo::GetMinor());
+  else
+    return StringUtils::Format("%d.%d-%s", CCompileInfo::GetMajor(), CCompileInfo::GetMinor(), CCompileInfo::GetSuffix());
 }
 
 CStdString CGUIInfoManager::GetVersion()
 {
-  if (GetXbmcGitRevision())
-    return GetVersionShort() + " Git:" + GetXbmcGitRevision();
-
-  return GetVersionShort();
+  return GetVersionShort() + " Git:" + CCompileInfo::GetSCMID();
 }
 
 CStdString CGUIInfoManager::GetBuild()
index e5366fa..45de649 100644 (file)
@@ -498,10 +498,6 @@ namespace INFO
 #define CONTROL_GROUP_HAS_FOCUS     29999
 #define CONTROL_HAS_FOCUS           30000
 
-#define VERSION_MAJOR               14
-#define VERSION_MINOR               0
-#define VERSION_TAG                 "-ALPHA1"
-
 #define LISTITEM_START              35000
 #define LISTITEM_THUMB              (LISTITEM_START)
 #define LISTITEM_LABEL              (LISTITEM_START + 1)
diff --git a/xbmc/GitRevision.cpp b/xbmc/GitRevision.cpp
deleted file mode 100644 (file)
index c6d209b..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *      Copyright (C) 2011-2013 Team XBMC
- *      http://xbmc.org
- *
- *  This Program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *
- *  This Program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with XBMC; see the file COPYING.  If not, see
- *  <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "GitRevision.h"
-
-#include <cstddef>
-
-#if defined(TARGET_DARWIN) || (defined(TARGET_WINDOWS) && !defined(_DEBUG))
-#include "../git_revision.h" // generated file
-#endif
-
-const char *GetXbmcGitRevision()
-{
-#ifdef GIT_REV
-  return GIT_REV;
-#else
-  return NULL;
-#endif
-}
diff --git a/xbmc/GitRevision.h b/xbmc/GitRevision.h
deleted file mode 100644 (file)
index f4425d1..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#pragma once
-
-/*
- *      Copyright (C) 2011-2013 Team XBMC
- *      http://xbmc.org
- *
- *  This Program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2, or (at your option)
- *  any later version.
- *
- *  This Program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with XBMC; see the file COPYING.  If not, see
- *  <http://www.gnu.org/licenses/>.
- *
- */
-
-// Returns the current Git revision, or NULL if unavailable.
-const char *GetXbmcGitRevision();
index 76ec9bf..dc80d54 100644 (file)
@@ -11,7 +11,6 @@ SRCS=Application.cpp \
      DynamicDll.cpp \
      FileItem.cpp \
      FileItemListModification.cpp \
-     GitRevision.cpp \
      GUIInfoManager.cpp \
      GUILargeTextureManager.cpp \
      GUIPassword.cpp \
@@ -35,10 +34,17 @@ SRCS=Application.cpp \
      XBDateTime.cpp \
      xbmc.cpp \
      XbmcContext.cpp \
+     CompileInfo.cpp \
 
 LIB=xbmc.a
 
-DISTCLEAN_FILES=DllPaths_generated.h
+DISTCLEAN_FILES=DllPaths_generated.h CompileInfo.cpp
+
+all: $(SRCS) $(LIB)
+
+include gen-compileinfo.mk
+CompileInfo.cpp: ../version.txt CompileInfo.cpp.in
+       make -f gen-compileinfo.mk
 
 include @abs_top_srcdir@/Makefile.include
 -include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS)))
diff --git a/xbmc/gen-compileinfo.mk b/xbmc/gen-compileinfo.mk
new file mode 100644 (file)
index 0000000..a40ed85
--- /dev/null
@@ -0,0 +1,10 @@
+# This file is sourced from xbmc/Makefile and tools/darwin/Support/makepythoninterface.command
+
+FILEPATH := $(abspath $(dir $(MAKEFILE_LIST)))
+VERSION.TXT := $(FILEPATH)/../version.txt
+
+$(FILEPATH)/CompileInfo.cpp: $(VERSION.TXT) $(FILEPATH)/CompileInfo.cpp.in
+       @MAJOR=$$(awk '/VERSION_MAJOR/ {print $$2}' $(VERSION.TXT)) ;\
+       MINOR=$$(awk '/VERSION_MINOR/ {print $$2}' $(VERSION.TXT)) ;\
+       TAG=$$(awk '/VERSION_TAG/ {print $$2}' $(VERSION.TXT)) ;\
+       sed -e "s/\@APP_VERSION_MAJOR\@/$$MAJOR/" -e "s/\@APP_VERSION_MINOR\@/$$MINOR/" -e "s/\@APP_VERSION_TAG\@/$$TAG/" $@.in > $@
index f8f30e4..0438e7a 100644 (file)
@@ -27,8 +27,9 @@
 #include "utils/log.h"
 #include "GUIInfoManager.h"
 #include "system.h"
-#include "GitRevision.h"
+#include "CompileInfo.h"
 #include "utils/StringUtils.h"
+#include <string.h>
 
 using namespace JSONRPC;
 
@@ -119,16 +120,15 @@ JSONRPC_STATUS CApplicationOperations::GetPropertyValue(const CStdString &proper
   else if (property.Equals("version"))
   {
     result = CVariant(CVariant::VariantTypeObject);
-    result["major"] = VERSION_MAJOR;
-    result["minor"] = VERSION_MINOR;
-    if (GetXbmcGitRevision())
-      result["revision"] = GetXbmcGitRevision();
-    CStdString tag(VERSION_TAG);
-    if (StringUtils::EqualsNoCase(tag, "-pre"))
+    result["major"] = CCompileInfo::GetMajor();
+    result["minor"] = CCompileInfo::GetMinor();
+    result["revision"] = CCompileInfo::GetSCMID();
+    std::string tag = CCompileInfo::GetSuffix();
+    if (StringUtils::EqualsNoCase(tag, "pre"))
       result["tag"] = "alpha";
-    else if (StringUtils::StartsWithNoCase(tag, "-beta"))
+    else if (StringUtils::StartsWithNoCase(tag, "beta"))
       result["tag"] = "beta";
-    else if (StringUtils::StartsWithNoCase(tag, "-rc"))
+    else if (StringUtils::StartsWithNoCase(tag, "rc"))
       result["tag"] = "releasecandidate";
     else if (tag.empty())
       result["tag"] = "stable";
diff --git a/xbmc/osx/Info.plist b/xbmc/osx/Info.plist
deleted file mode 100644 (file)
index 5659c11..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-       <key>CFBundleInfoDictionaryVersion</key>
-       <string>6.0</string>
-       <key>CFBundleDevelopmentRegion</key>
-       <string>English</string>
-       <key>CFBundleExecutable</key>
-       <string>XBMC</string>
-       <key>CFBundleGetInfoString</key>
-       <string>14.0.alpha1</string>
-       <key>CFBundleIconFile</key>
-       <string>xbmc.icns</string>
-       <key>CFBundleIdentifier</key>
-       <string>com.teamxbmc.xbmc</string>
-       <key>CFBundleName</key>
-       <string>XBMC</string>
-       <key>CFBundlePackageType</key>
-       <string>APPL</string>
-       <key>CFBundleShortVersionString</key>
-       <string>14.0.alpha1</string>
-       <key>CFBundleVersion</key>
-       <string>r####</string>
-       <key>CFBundleSignature</key>
-       <string>xbmc</string>
-</dict>
-</plist>
diff --git a/xbmc/osx/Info.plist.in b/xbmc/osx/Info.plist.in
new file mode 100644 (file)
index 0000000..f3ec189
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundleDevelopmentRegion</key>
+       <string>English</string>
+       <key>CFBundleExecutable</key>
+       <string>XBMC</string>
+       <key>CFBundleGetInfoString</key>
+       <string>@APP_VERSION_MAJOR@.@APP_VERSION_MINOR@.@APP_VERSION_TAG_LC@</string>
+       <key>CFBundleIconFile</key>
+       <string>xbmc.icns</string>
+       <key>CFBundleIdentifier</key>
+       <string>com.teamxbmc.xbmc</string>
+       <key>CFBundleName</key>
+       <string>XBMC</string>
+       <key>CFBundlePackageType</key>
+       <string>APPL</string>
+       <key>CFBundleShortVersionString</key>
+       <string>@APP_VERSION_MAJOR@.@APP_VERSION_MINOR@.@APP_VERSION_TAG_LC@</string>
+       <key>CFBundleVersion</key>
+       <string>r####</string>
+       <key>CFBundleSignature</key>
+       <string>xbmc</string>
+</dict>
+</plist>