Skip to content

Commit

Permalink
view changes to get around collisions
Browse files Browse the repository at this point in the history
  • Loading branch information
RensDofferhoff committed Dec 21, 2023
1 parent 6c97c5b commit 9aead96
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion QMLComponents/utilities/appdirs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ QString AppDirs::bundledModulesDir()
#ifdef _WIN32
auto env = DynamicRuntimeInfo::getInstance()->getRuntimeEnvironment();
bool useAppdata = env != DynamicRuntimeInfo::MSIX && env != DynamicRuntimeInfo::ZIP;
folder = useAppdata ? programDir().absoluteFilePath("Modules") + '/' : appData(false) + "/BundledJASPModules-" + AppInfo::gitCommit + "-" + AppInfo::builddate + "/";
folder = useAppdata ? programDir().absoluteFilePath("Modules") + '/' : appData(false) + "/BundledJASPModules_" + QString(AppInfo::version.asString(4).c_str()) + "_" + QString(AppInfo::gitCommit.substr(0, 7).c_str()) + "_" + QString(AppInfo::builddate.c_str()).replace(":", "-").replace(" ", "") + "/";
#elif __APPLE__
folder = programDir().absoluteFilePath("../Modules/");
#elif FLATPAK_USED
Expand Down
10 changes: 9 additions & 1 deletion QMLComponents/utilities/dynamicruntimeinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ bool DynamicRuntimeInfo::bundledModulesInitialized()
res = _bundledModulesInitializedSet
&& _initializedByCommit == AppInfo::gitCommit
&& _initializedByBuildDate == AppInfo::builddate
&& _initializedForRVersion == AppInfo::getRVersion();
&& _initializedForRVersion == AppInfo::getRVersion()
&& _initializedForJaspVersion == AppInfo::version.asString(4);

return res;
}
Expand Down Expand Up @@ -100,6 +101,7 @@ bool DynamicRuntimeInfo::parseDynamicRuntimeInfoFile(const std::string &path)
_initializedByCommit = root.get("commit", "").asString();
_initializedByBuildDate = root.get("buildDate", "").asString();
_initializedForRVersion = root.get("RVersion", "").asString();
_initializedForJaspVersion = root.get("jaspVersion", "").asString();
_initializedOn = root.get("initTimestamp", 0).asUInt64();

return true;
Expand All @@ -117,6 +119,7 @@ bool DynamicRuntimeInfo::writeDynamicRuntimeInfoFile()
}

Json::Value root;
root["jaspVersion"] = AppInfo::version.asString(4);
root["initialized"] = true;
root["commit"] = AppInfo::gitCommit;
root["buildDate"] = AppInfo::builddate;
Expand Down Expand Up @@ -158,3 +161,8 @@ std::string DynamicRuntimeInfo::bundledModulesInitializedRVersion()
{
return _initializedForRVersion;
}

std::string DynamicRuntimeInfo::bundledModulesInitializedJaspVersion()
{
return _initializedForJaspVersion;
}
2 changes: 2 additions & 0 deletions QMLComponents/utilities/dynamicruntimeinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class DynamicRuntimeInfo
std::string bundledModulesInitializedByCommit();
std::string bundledModulesInitializedByBuildDate();
std::string bundledModulesInitializedRVersion();
std::string bundledModulesInitializedJaspVersion();

static bool writeDynamicRuntimeInfoFile();

Expand All @@ -55,6 +56,7 @@ class DynamicRuntimeInfo
std::string _initializedByCommit = "build";
std::string _initializedForRVersion = "build";
std::string _initializedByBuildDate = "build";
std::string _initializedForJaspVersion = "build";
uint64_t _initializedOn = 0;

static DynamicRuntimeInfo* _instance;
Expand Down
4 changes: 4 additions & 0 deletions Tools/CMake/JASP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ set(JASP_VERSION_TWEAK ${PROJECT_VERSION_TWEAK})
set(JASP_VERSION ${CMAKE_PROJECT_VERSION})
set(JASP_SHORT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR})

set(JASP_VERSION_MSIX_PATCH_POSTFIX
"000"
CACHE STRING "Microsoft does not allow packages of same version to be uploaded to store and forces TWEAK 0, so we add a large version postfix to PATCH in the appmanifest in case we publish a broken version and wish to switch it out. Nobody sees it anyway")

message(STATUS "Version: ${CMAKE_PROJECT_VERSION}")

# TODO:
Expand Down
2 changes: 1 addition & 1 deletion Tools/windows/msix/AppxManifest.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities">

<Identity Name="45842JASP.JASP"
Version="@JASP_VERSION@"
Version="@JASP_VERSION_MAJOR@.@JASP_VERSION_MINOR@.@JASP_VERSION_PATCH@@JASP_VERSION_MSIX_PATCH_POSTFIX@.@JASP_VERSION_TWEAK@"
Publisher="CN=044465FF-CD1D-4EC4-B82B-C244199F66F9"
ProcessorArchitecture="x64"/>

Expand Down

0 comments on commit 9aead96

Please sign in to comment.