build: Provide AppImage package for Linux (issue #279) (#945)

* Create AppImage package using linuxdeployqt in Travis CI
* Renamed appPath() to sharedDataPath()
* Fixed include error in tutorial
This commit is contained in:
Eberhard Gräther
2020-03-29 17:10:30 +02:00
committed by GitHub
parent 76562bb8ee
commit bf6a017720
20 changed files with 184 additions and 45 deletions
+31 -5
View File
@@ -1,17 +1,43 @@
#include "AppPath.h"
FilePath AppPath::m_appPath(L"");
FilePath AppPath::m_sharedDataPath(L"");
FilePath AppPath::m_cxxIndexerPath(L"");
FilePath AppPath::getAppPath()
FilePath AppPath::getSharedDataPath()
{
return m_appPath;
return m_sharedDataPath;
}
bool AppPath::setAppPath(const FilePath& path)
bool AppPath::setSharedDataPath(const FilePath& path)
{
if (!path.empty())
{
m_appPath = path;
m_sharedDataPath = path;
return true;
}
return false;
}
FilePath AppPath::getCxxIndexerPath()
{
#if _WIN32
const std::wstring cxxIndexerName(L"sourcetrail_indexer.exe");
#else
const std::wstring cxxIndexerName(L"sourcetrail_indexer");
#endif
if (!m_cxxIndexerPath.empty())
{
return m_cxxIndexerPath.getConcatenated(cxxIndexerName);
}
return m_sharedDataPath.getConcatenated(cxxIndexerName);
}
bool AppPath::setCxxIndexerPath(const FilePath& path)
{
if (!path.empty())
{
m_cxxIndexerPath = path;
return true;
}
return false;
+7 -3
View File
@@ -6,11 +6,15 @@
class AppPath
{
public:
static FilePath getAppPath();
static bool setAppPath(const FilePath& path);
static FilePath getSharedDataPath();
static bool setSharedDataPath(const FilePath& path);
static FilePath getCxxIndexerPath();
static bool setCxxIndexerPath(const FilePath& path);
private:
static FilePath m_appPath;
static FilePath m_sharedDataPath;
static FilePath m_cxxIndexerPath;
};
#endif // APP_PATH_H
+9 -9
View File
@@ -4,45 +4,45 @@
FilePath ResourcePaths::getColorSchemesPath()
{
return AppPath::getAppPath().concatenate(L"data/color_schemes/");
return AppPath::getSharedDataPath().concatenate(L"data/color_schemes/");
}
FilePath ResourcePaths::getSyntaxHighlightingRulesPath()
{
return AppPath::getAppPath().concatenate(L"data/syntax_highlighting_rules/");
return AppPath::getSharedDataPath().concatenate(L"data/syntax_highlighting_rules/");
}
FilePath ResourcePaths::getFallbackPath()
{
return AppPath::getAppPath().concatenate(L"data/fallback/");
return AppPath::getSharedDataPath().concatenate(L"data/fallback/");
}
FilePath ResourcePaths::getFontsPath()
{
return AppPath::getAppPath().concatenate(L"data/fonts/");
return AppPath::getSharedDataPath().concatenate(L"data/fonts/");
}
FilePath ResourcePaths::getGuiPath()
{
return AppPath::getAppPath().concatenate(L"data/gui/");
return AppPath::getSharedDataPath().concatenate(L"data/gui/");
}
FilePath ResourcePaths::getLicensePath()
{
return AppPath::getAppPath().concatenate(L"data/license/");
return AppPath::getSharedDataPath().concatenate(L"data/license/");
}
FilePath ResourcePaths::getJavaPath()
{
return AppPath::getAppPath().concatenate(L"data/java/");
return AppPath::getSharedDataPath().concatenate(L"data/java/");
}
FilePath ResourcePaths::getPythonPath()
{
return AppPath::getAppPath().concatenate(L"data/python/");
return AppPath::getSharedDataPath().concatenate(L"data/python/");
}
FilePath ResourcePaths::getCxxCompilerHeaderPath()
{
return AppPath::getAppPath().concatenate(L"data/cxx/include/").getCanonical();
return AppPath::getSharedDataPath().concatenate(L"data/cxx/include/").getCanonical();
}