* Move version.h back to musikcore and bump the SDK and API versions.

* Include `app_version` in server handshake
This commit is contained in:
casey langen 2020-10-13 22:49:32 -07:00
parent cd15bbd941
commit af35c1bfd1
12 changed files with 24 additions and 12 deletions

View File

@ -9,10 +9,10 @@ if [ -z "$MAJOR" ] || [ -z "$MINOR" ] || [ -z "$PATCH" ]; then
exit
fi
sed -Ei.bak "s/(\s*)(#define VERSION_MAJOR )(.*)/\1\2${MAJOR}/g" src/musikcube/app/version.h
sed -Ei.bak "s/(\s*)(#define VERSION_MINOR )(.*)/\1\2${MINOR}/g" src/musikcube/app/version.h
sed -Ei.bak "s/(\s*)(#define VERSION_PATCH )(.*)/\1\2${PATCH}/g" src/musikcube/app/version.h
sed -Ei.bak "s/(\s*)(#define VERSION )(.*)/\1\2\"${MAJOR}.${MINOR}.${PATCH}\"/g" src/musikcube/app/version.h
sed -Ei.bak "s/(\s*)(#define VERSION_MAJOR )(.*)/\1\2${MAJOR}/g" src/musikcore/version.h
sed -Ei.bak "s/(\s*)(#define VERSION_MINOR )(.*)/\1\2${MINOR}/g" src/musikcore/version.h
sed -Ei.bak "s/(\s*)(#define VERSION_PATCH )(.*)/\1\2${PATCH}/g" src/musikcore/version.h
sed -Ei.bak "s/(\s*)(#define VERSION )(.*)/\1\2\"${MAJOR}.${MINOR}.${PATCH}\"/g" src/musikcore/version.h
# visual studio resource files are utf16-le, so sed can't operate on them
# directly. convert to utf8, process, then back to utf16-le
@ -35,7 +35,7 @@ sed -Ei.bak "s/(\s*)(version: )(.*)/\1\2${MAJOR}.${MINOR}.${PATCH}/g" snap/snapc
# ugh. there's a way to tell sed not to backup, but it's different on gnu and
# bsd sed variants. this is easier than trying to switch the args dynamically.
rm src/musikcube/app/version.h.bak
rm src/musikcore/version.h.bak
rm CMakeLists.txt.bak
rm musikcube.spec.bak
rm snap/snapcraft.yaml.bak

View File

@ -684,6 +684,7 @@
<ClInclude Include="support\PreferenceKeys.h" />
<ClInclude Include="support\Preferences.h" />
<ClInclude Include="utfutil.h" />
<ClInclude Include="version.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\3rdparty\3rdparty.vcxproj">

View File

@ -633,5 +633,8 @@
<ClInclude Include="library\MasterLibrary.h">
<Filter>src\library</Filter>
</ClInclude>
<ClInclude Include="version.h">
<Filter>src</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -36,10 +36,10 @@
#include "Plugins.h"
#include "PluginFactory.h"
#include <musikcore/debug.h>
#include <musikcore/version.h>
#include <musikcore/support/Common.h>
#include <musikcore/support/Preferences.h>
#include <musikcore/debug.h>
#include <musikcore/io/DataStreamFactory.h>
#include <musikcore/audio/Buffer.h>
#include <musikcore/audio/Streams.h>
@ -342,6 +342,11 @@ static class Environment: public IEnvironment {
playback->ReloadOutput();
}
}
virtual const char* GetAppVersion() override {
return VERSION;
}
} environment;
namespace musik { namespace core { namespace plugin {

View File

@ -72,6 +72,7 @@ namespace musik { namespace core { namespace sdk {
virtual void SetTransportType(TransportType type) = 0;
virtual void ReindexMetadata() = 0;
virtual void RebuildMetadata() = 0;
virtual const char* GetAppVersion() = 0;
};
} } }

View File

@ -160,5 +160,5 @@ namespace musik {
static const char* ExternalId = "external_id";
}
static const int SdkVersion = 19;
static const int SdkVersion = 20;
} } }

View File

@ -35,12 +35,12 @@
#include <stdafx.h>
#include <app/layout/ConsoleLayout.h>
#include <musikcore/i18n/Locale.h>
#include <musikcore/version.h>
#include <cursespp/App.h>
#include <cursespp/Screen.h>
#include <cursespp/ToastOverlay.h>
#include <app/util/Hotkeys.h>
#include <app/util/Messages.h>
#include <app/version.h>
using namespace musik::cube;
using namespace musik::core;

View File

@ -41,6 +41,7 @@
#include <musikcore/runtime/Message.h>
#include <musikcore/support/Auddio.h>
#include <musikcore/library/RemoteLibrary.h>
#include <musikcore/version.h>
#include <app/util/Messages.h>
#include <app/util/PreferenceKeys.h>
@ -52,7 +53,6 @@
#include <app/layout/SettingsLayout.h>
#include <app/layout/HotkeysLayout.h>
#include <app/util/Hotkeys.h>
#include <app/version.h>
#include <map>

View File

@ -42,10 +42,10 @@
#include <musikcore/runtime/Message.h>
#include <musikcore/support/Common.h>
#include <musikcore/version.h>
#include <app/util/Messages.h>
#include <app/util/PreferenceKeys.h>
#include <app/version.h>
using namespace nlohmann;
using namespace musik::cube;

View File

@ -129,6 +129,7 @@ namespace key {
static const std::string predicates = "predicates";
static const std::string sdk_version = "sdk_version";
static const std::string api_version = "api_version";
static const std::string app_version = "app_version";
static const std::string driver_name = "driver_name";
static const std::string all = "all";
static const std::string selected = "selected";
@ -243,4 +244,4 @@ static auto TRANSPORT_TYPE_TO_STRING = makeBimap<musik::core::sdk::TransportType
{ musik::core::sdk::TransportType::Crossfade, "crossfade" },
});
static const int ApiVersion = 15;
static const int ApiVersion = 20;

View File

@ -129,6 +129,7 @@ static json getEnvironment(Context& context) {
{ prefs::http_server_enabled, context.prefs->GetBool(prefs::http_server_enabled.c_str()) },
{ prefs::http_server_port, context.prefs->GetInt(prefs::http_server_port.c_str()) },
{ key::sdk_version, musik::core::sdk::SdkVersion },
{ key::app_version, context.environment->GetAppVersion() },
{ key::api_version, ApiVersion }
};
}