summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-09-05 18:46:57 +0200
committerPetr Mrázek <peterix@gmail.com>2015-09-05 18:46:57 +0200
commit23d0bd8edde6aadfaa282215b5f143ad16210438 (patch)
treea14d3f47b51716fb784cb426eedd0a2e2d756b4f
parentcd108fd02975eac3a3fed2fde26c58de5cbdaf1c (diff)
downloadMultiMC-23d0bd8edde6aadfaa282215b5f143ad16210438.tar
MultiMC-23d0bd8edde6aadfaa282215b5f143ad16210438.tar.gz
MultiMC-23d0bd8edde6aadfaa282215b5f143ad16210438.tar.lz
MultiMC-23d0bd8edde6aadfaa282215b5f143ad16210438.tar.xz
MultiMC-23d0bd8edde6aadfaa282215b5f143ad16210438.zip
NOISSUE make shared logic library ... shared
-rw-r--r--CMakeLists.txt4
-rw-r--r--application/CMakeLists.txt2
-rw-r--r--application/MainWindow.cpp2
-rw-r--r--application/pages/OtherLogsPage.h2
-rw-r--r--logic/BaseInstaller.h4
-rw-r--r--logic/BaseInstance.h4
-rw-r--r--logic/BaseVersionList.h6
-rw-r--r--logic/CMakeLists.txt6
-rw-r--r--logic/Env.h4
-rw-r--r--logic/Exception.h13
-rw-r--r--logic/FileSystem.h13
-rw-r--r--logic/GZip.h4
-rw-r--r--logic/InstanceList.h4
-rw-r--r--logic/Json.h6
-rw-r--r--logic/MMCStrings.h4
-rw-r--r--logic/MMCZip.h16
-rw-r--r--logic/RecursiveFileSystemWatcher.h4
-rw-r--r--logic/auth/AuthSession.h4
-rw-r--r--logic/auth/MojangAccount.h5
-rw-r--r--logic/auth/MojangAccountList.h6
-rw-r--r--logic/forge/ForgeInstaller.h4
-rw-r--r--logic/forge/ForgeVersionList.h4
-rw-r--r--logic/ftb/FTBPlugin.h4
-rw-r--r--logic/icons/IconList.h4
-rw-r--r--logic/icons/MMCIcon.h7
-rw-r--r--logic/java/JavaChecker.h4
-rw-r--r--logic/java/JavaUtils.h4
-rw-r--r--logic/java/JavaVersionList.h4
-rw-r--r--logic/launch/LaunchTask.h4
-rw-r--r--logic/launch/steps/CheckJava.cpp1
-rw-r--r--logic/launch/steps/LaunchMinecraft.cpp2
-rw-r--r--logic/launch/steps/TextPrint.h8
-rw-r--r--logic/liteloader/LiteLoaderInstaller.h4
-rw-r--r--logic/liteloader/LiteLoaderVersionList.h4
-rw-r--r--logic/minecraft/LegacyInstance.h4
-rw-r--r--logic/minecraft/LwjglVersionList.h6
-rw-r--r--logic/minecraft/MinecraftInstance.h4
-rw-r--r--logic/minecraft/MinecraftProfile.h5
-rw-r--r--logic/minecraft/MinecraftVersion.h4
-rw-r--r--logic/minecraft/MinecraftVersionList.h4
-rw-r--r--logic/minecraft/ModList.h4
-rw-r--r--logic/minecraft/OneSixInstance.cpp2
-rw-r--r--logic/minecraft/OneSixInstance.h4
-rw-r--r--logic/minecraft/SkinUtils.h4
-rw-r--r--logic/minecraft/VersionFilterData.h4
-rw-r--r--logic/net/ByteArrayDownload.h4
-rw-r--r--logic/net/CacheDownload.h11
-rw-r--r--logic/net/HttpMetaCache.h6
-rw-r--r--logic/net/NetJob.h4
-rw-r--r--logic/net/PasteUpload.h4
-rw-r--r--logic/net/URLConstants.h4
-rw-r--r--logic/news/NewsChecker.h4
-rw-r--r--logic/notifications/NotificationChecker.h4
-rw-r--r--logic/resources/IconResourceHandler.h4
-rw-r--r--logic/resources/Resource.h4
-rw-r--r--logic/resources/ResourceHandler.h4
-rw-r--r--logic/resources/ResourceObserver.h7
-rw-r--r--logic/screenshots/ImgurAlbumCreation.h4
-rw-r--r--logic/screenshots/ImgurUpload.h4
-rw-r--r--logic/settings/INIFile.h4
-rw-r--r--logic/settings/INISettingsObject.h4
-rw-r--r--logic/settings/Setting.h8
-rw-r--r--logic/settings/SettingsObject.h4
-rw-r--r--logic/status/StatusChecker.h4
-rw-r--r--logic/tasks/SequentialTask.h4
-rw-r--r--logic/tasks/Task.h4
-rw-r--r--logic/tools/BaseExternalTool.h10
-rw-r--r--logic/tools/BaseProfiler.h6
-rw-r--r--logic/tools/JProfiler.h4
-rw-r--r--logic/tools/JVisualVM.h4
-rw-r--r--logic/tools/MCEditTool.h6
-rw-r--r--logic/trans/TranslationDownloader.h3
-rw-r--r--logic/updater/DownloadTask.h4
-rw-r--r--logic/updater/GoUpdate.h16
-rw-r--r--logic/updater/UpdateChecker.h4
-rw-r--r--tests/CMakeLists.txt2
76 files changed, 259 insertions, 116 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cfff5ae2..411c4b16 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.9)
+cmake_minimum_required(VERSION 3.2.0)
string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BUILD_DIR}" IS_IN_SOURCE_BUILD)
if(IS_IN_SOURCE_BUILD)
@@ -34,8 +34,10 @@ set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${PROJECT_BINARY_DIR}/jars)
######## Set compiler flags ########
include(UseCXX14)
include(Coverage)
+include(GenerateExportHeader)
set(CMAKE_CXX_FLAGS " -Wall ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror=return-type")
+set(CMAKE_CXX_VISIBILITY_PRESET hidden)
# cmake code needed for the coverity scan upload
include(Coverity)
diff --git a/application/CMakeLists.txt b/application/CMakeLists.txt
index 1ba19bc2..1cc37a5d 100644
--- a/application/CMakeLists.txt
+++ b/application/CMakeLists.txt
@@ -323,7 +323,7 @@ if(WIN32)
set(MultiMC_LINK_ADDITIONAL_LIBS ${MultiMC_LINK_ADDITIONAL_LIBS} Qt5::WinMain)
endif(WIN32)
-include_directories(../logic)
+include_directories(../logic ${CMAKE_CURRENT_BINARY_DIR}/../logic)
# Qt 5 stuff
qt5_wrap_ui(MULTIMC_UI ${MULTIMC_UIS})
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp
index 891842b5..b50d0160 100644
--- a/application/MainWindow.cpp
+++ b/application/MainWindow.cpp
@@ -1105,6 +1105,8 @@ void MainWindow::instanceFromZipPack(QString instName, QString instGroup, QStrin
errorMsg += tr("Not an instance");
CustomMessageBox::selectable(this, tr("Error"), errorMsg, QMessageBox::Warning)->show();
return;
+ default:
+ break;
}
newInstance->setName(instName);
diff --git a/application/pages/OtherLogsPage.h b/application/pages/OtherLogsPage.h
index 9a5a6ed4..564b26d2 100644
--- a/application/pages/OtherLogsPage.h
+++ b/application/pages/OtherLogsPage.h
@@ -70,7 +70,7 @@ private:
private:
Ui::OtherLogsPage *ui;
QString m_path;
- RecursiveFileSystemWatcher *m_watcher;
QString m_currentFile;
IPathMatcher::Ptr m_fileFilter;
+ RecursiveFileSystemWatcher *m_watcher;
};
diff --git a/logic/BaseInstaller.h b/logic/BaseInstaller.h
index d4f43beb..dd804085 100644
--- a/logic/BaseInstaller.h
+++ b/logic/BaseInstaller.h
@@ -17,6 +17,8 @@
#include <memory>
+#include "multimc_logic_export.h"
+
class OneSixInstance;
class QDir;
class QString;
@@ -25,7 +27,7 @@ class Task;
struct BaseVersion;
typedef std::shared_ptr<BaseVersion> BaseVersionPtr;
-class BaseInstaller
+class MULTIMC_LOGIC_EXPORT BaseInstaller
{
public:
BaseInstaller();
diff --git a/logic/BaseInstance.h b/logic/BaseInstance.h
index 070a9838..7fbd5de5 100644
--- a/logic/BaseInstance.h
+++ b/logic/BaseInstance.h
@@ -28,6 +28,8 @@
#include "launch/MessageLevel.h"
#include "pathmatcher/IPathMatcher.h"
+#include "multimc_logic_export.h"
+
class QDir;
class Task;
class LaunchTask;
@@ -44,7 +46,7 @@ typedef std::shared_ptr<BaseInstance> InstancePtr;
* To create a new instance type, create a new class inheriting from this class
* and implement the pure virtual functions.
*/
-class BaseInstance : public QObject, public std::enable_shared_from_this<BaseInstance>
+class MULTIMC_LOGIC_EXPORT BaseInstance : public QObject, public std::enable_shared_from_this<BaseInstance>
{
Q_OBJECT
protected:
diff --git a/logic/BaseVersionList.h b/logic/BaseVersionList.h
index ce36e286..e8d0cca7 100644
--- a/logic/BaseVersionList.h
+++ b/logic/BaseVersionList.h
@@ -20,8 +20,8 @@
#include <QAbstractListModel>
#include "BaseVersion.h"
-
-class Task;
+#include "tasks/Task.h"
+#include "multimc_logic_export.h"
/*!
* \brief Class that each instance type's version list derives from.
@@ -35,7 +35,7 @@ class Task;
* all have a default implementation, but they can be overridden by plugins to
* change the behavior of the list.
*/
-class BaseVersionList : public QAbstractListModel
+class MULTIMC_LOGIC_EXPORT BaseVersionList : public QAbstractListModel
{
Q_OBJECT
public:
diff --git a/logic/CMakeLists.txt b/logic/CMakeLists.txt
index fce89ac8..1f6b62bf 100644
--- a/logic/CMakeLists.txt
+++ b/logic/CMakeLists.txt
@@ -308,7 +308,9 @@ if(WIN32)
endif()
# Add common library
-add_library(MultiMC_logic STATIC ${LOGIC_SOURCES})
+add_library(MultiMC_logic SHARED ${LOGIC_SOURCES})
+
+generate_export_header(MultiMC_logic)
# Use system zlib on unix and Qt ZLIB on Windows
if(UNIX)
@@ -328,3 +330,5 @@ target_link_libraries(MultiMC_logic xz-embedded unpack200 iconfix libUtil Logica
${ZLIB_LIBRARIES} ${MultiMC_LINK_ADDITIONAL_LIBS})
add_dependencies(MultiMC_logic QuaZIP)
+
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
diff --git a/logic/Env.h b/logic/Env.h
index a53a62cb..b81cfa62 100644
--- a/logic/Env.h
+++ b/logic/Env.h
@@ -4,6 +4,8 @@
#include <QString>
#include <QMap>
+#include "multimc_logic_export.h"
+
class IconList;
class QNetworkAccessManager;
class HttpMetaCache;
@@ -15,7 +17,7 @@ class BaseVersion;
#endif
#define ENV (Env::getInstance())
-class Env
+class MULTIMC_LOGIC_EXPORT Env
{
friend class MultiMC;
private:
diff --git a/logic/Exception.h b/logic/Exception.h
index 2664910e..0dae39a0 100644
--- a/logic/Exception.h
+++ b/logic/Exception.h
@@ -6,7 +6,9 @@
#include <QLoggingCategory>
#include <exception>
-class Exception : public std::exception
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT Exception : public std::exception
{
public:
Exception(const QString &message) : std::exception(), m_message(message)
@@ -30,12 +32,3 @@ public:
private:
QString m_message;
};
-
-#define DECLARE_EXCEPTION(name) \
- class name##Exception : public ::Exception \
- { \
- public: \
- name##Exception(const QString &message) : Exception(message) \
- { \
- } \
- }
diff --git a/logic/FileSystem.h b/logic/FileSystem.h
index e70f3165..a66e7ead 100644
--- a/logic/FileSystem.h
+++ b/logic/FileSystem.h
@@ -4,10 +4,17 @@
#include "Exception.h"
+#include "multimc_logic_export.h"
+
namespace FS
{
-DECLARE_EXCEPTION(FileSystem);
-void write(const QString &filename, const QByteArray &data);
-QByteArray read(const QString &filename);
+class MULTIMC_LOGIC_EXPORT FileSystemException : public ::Exception
+{
+public:
+ FileSystemException(const QString &message) : Exception(message) {}
+};
+
+void MULTIMC_LOGIC_EXPORT write(const QString &filename, const QByteArray &data);
+QByteArray MULTIMC_LOGIC_EXPORT read(const QString &filename);
}
diff --git a/logic/GZip.h b/logic/GZip.h
index cd9f53d8..7ccf1d38 100644
--- a/logic/GZip.h
+++ b/logic/GZip.h
@@ -1,7 +1,9 @@
#pragma once
#include <QByteArray>
-class GZip
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT GZip
{
public:
static bool inflate(const QByteArray &compressedBytes, QByteArray &uncompressedBytes);
diff --git a/logic/InstanceList.h b/logic/InstanceList.h
index 07a71ffb..1799080a 100644
--- a/logic/InstanceList.h
+++ b/logic/InstanceList.h
@@ -21,10 +21,12 @@
#include "BaseInstance.h"
+#include "multimc_logic_export.h"
+
class BaseInstance;
class QDir;
-class InstanceList : public QAbstractListModel
+class MULTIMC_LOGIC_EXPORT InstanceList : public QAbstractListModel
{
Q_OBJECT
private:
diff --git a/logic/Json.h b/logic/Json.h
index 55f0cfc1..f03f777a 100644
--- a/logic/Json.h
+++ b/logic/Json.h
@@ -16,7 +16,11 @@
namespace Json
{
-DECLARE_EXCEPTION(Json);
+class MULTIMC_LOGIC_EXPORT JsonException : public ::Exception
+{
+public:
+ JsonException(const QString &message) : Exception(message) {}
+};
/// @throw FileSystemException
void write(const QJsonDocument &doc, const QString &filename);
diff --git a/logic/MMCStrings.h b/logic/MMCStrings.h
index b2dd3912..5606b909 100644
--- a/logic/MMCStrings.h
+++ b/logic/MMCStrings.h
@@ -2,7 +2,9 @@
#include <QString>
+#include "multimc_logic_export.h"
+
namespace Strings
{
- int naturalCompare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs);
+ int MULTIMC_LOGIC_EXPORT naturalCompare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs);
}
diff --git a/logic/MMCZip.h b/logic/MMCZip.h
index 0107d7a6..a3167079 100644
--- a/logic/MMCZip.h
+++ b/logic/MMCZip.h
@@ -7,6 +7,8 @@
#include "SeparatorPrefixTree.h"
#include <functional>
+#include "multimc_logic_export.h"
+
class QuaZip;
namespace MMCZip
@@ -19,7 +21,7 @@ namespace MMCZip
* \param recursive Whether to pack sub-directories as well or only files.
* \return true if success, false otherwise.
*/
- bool compressSubDir(QuaZip *zip, QString dir, QString origDir, QSet<QString> &added,
+ bool MULTIMC_LOGIC_EXPORT compressSubDir(QuaZip *zip, QString dir, QString origDir, QSet<QString> &added,
QString prefix = QString(), const SeparatorPrefixTree <'/'> * blacklist = nullptr);
/**
@@ -29,23 +31,23 @@ namespace MMCZip
* \param recursive Whether to pack the subdirectories as well, or just regular files.
* \return true if success, false otherwise.
*/
- bool compressDir(QString zipFile, QString dir, QString prefix = QString(), const SeparatorPrefixTree <'/'> * blacklist = nullptr);
+ bool MULTIMC_LOGIC_EXPORT compressDir(QString zipFile, QString dir, QString prefix = QString(), const SeparatorPrefixTree <'/'> * blacklist = nullptr);
/// filter function for @mergeZipFiles - passthrough
- bool noFilter(QString key);
+ bool MULTIMC_LOGIC_EXPORT noFilter(QString key);
/// filter function for @mergeZipFiles - ignores METAINF
- bool metaInfFilter(QString key);
+ bool MULTIMC_LOGIC_EXPORT metaInfFilter(QString key);
/**
* Merge two zip files, using a filter function
*/
- bool mergeZipFiles(QuaZip *into, QFileInfo from, QSet<QString> &contained, std::function<bool(QString)> filter);
+ bool MULTIMC_LOGIC_EXPORT mergeZipFiles(QuaZip *into, QFileInfo from, QSet<QString> &contained, std::function<bool(QString)> filter);
/**
* take a source jar, add mods to it, resulting in target jar
*/
- bool createModdedJar(QString sourceJarPath, QString targetJarPath, const QList<Mod>& mods);
+ bool MULTIMC_LOGIC_EXPORT createModdedJar(QString sourceJarPath, QString targetJarPath, const QList<Mod>& mods);
/**
* Extract a whole archive.
@@ -55,5 +57,5 @@ namespace MMCZip
* left empty.
* \return The list of the full paths of the files extracted, empty on failure.
*/
- QStringList extractDir(QString fileCompressed, QString dir = QString());
+ QStringList MULTIMC_LOGIC_EXPORT extractDir(QString fileCompressed, QString dir = QString());
} \ No newline at end of file
diff --git a/logic/RecursiveFileSystemWatcher.h b/logic/RecursiveFileSystemWatcher.h
index a2a9e7e3..07bce0b9 100644
--- a/logic/RecursiveFileSystemWatcher.h
+++ b/logic/RecursiveFileSystemWatcher.h
@@ -4,7 +4,9 @@
#include <QDir>
#include "pathmatcher/IPathMatcher.h"
-class RecursiveFileSystemWatcher : public QObject
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT RecursiveFileSystemWatcher : public QObject
{
Q_OBJECT
public:
diff --git a/logic/auth/AuthSession.h b/logic/auth/AuthSession.h
index 2ac170fa..dede90a9 100644
--- a/logic/auth/AuthSession.h
+++ b/logic/auth/AuthSession.h
@@ -4,13 +4,15 @@
#include <QMultiMap>
#include <memory>
+#include "multimc_logic_export.h"
+
struct User
{
QString id;
QMultiMap<QString, QString> properties;
};
-struct AuthSession
+struct MULTIMC_LOGIC_EXPORT AuthSession
{
bool MakeOffline(QString offline_playername);
diff --git a/logic/auth/MojangAccount.h b/logic/auth/MojangAccount.h
index 47ebf91b..5cf8a0f2 100644
--- a/logic/auth/MojangAccount.h
+++ b/logic/auth/MojangAccount.h
@@ -25,6 +25,9 @@
#include <memory>
#include "AuthSession.h"
+#include "multimc_logic_export.h"
+MULTIMC_LOGIC_EXPORT
+
class Task;
class YggdrasilTask;
class MojangAccount;
@@ -58,7 +61,7 @@ enum AccountStatus
* Said information may include things such as that account's username, client token, and access
* token if the user chose to stay logged in.
*/
-class MojangAccount : public QObject
+class MULTIMC_LOGIC_EXPORT MojangAccount : public QObject
{
Q_OBJECT
public: /* construction */
diff --git a/logic/auth/MojangAccountList.h b/logic/auth/MojangAccountList.h
index b68343f2..49b71fab 100644
--- a/logic/auth/MojangAccountList.h
+++ b/logic/auth/MojangAccountList.h
@@ -22,6 +22,8 @@
#include "auth/MojangAccount.h"
+#include "multimc_logic_export.h"
+
/*!
* \brief List of available Mojang accounts.
* This should be loaded in the background by MultiMC on startup.
@@ -31,7 +33,7 @@
* all have a default implementation, but they can be overridden by subclasses to
* change the behavior of the list.
*/
-class MojangAccountList : public QAbstractListModel
+class MULTIMC_LOGIC_EXPORT MojangAccountList : public QAbstractListModel
{
Q_OBJECT
public:
@@ -126,7 +128,7 @@ public:
* If the username given is an empty string, sets the active account to nothing.
*/
virtual void setActiveAccount(const QString &username);
-
+
/*!
* Returns true if any of the account is at least Validated
*/
diff --git a/logic/forge/ForgeInstaller.h b/logic/forge/ForgeInstaller.h
index ae30177f..0de762b6 100644
--- a/logic/forge/ForgeInstaller.h
+++ b/logic/forge/ForgeInstaller.h
@@ -20,11 +20,13 @@
#include <QString>
#include <memory>
+#include "multimc_logic_export.h"
+
class MinecraftProfile;
class ForgeInstallTask;
struct ForgeVersion;
-class ForgeInstaller : public BaseInstaller
+class MULTIMC_LOGIC_EXPORT ForgeInstaller : public BaseInstaller
{
friend class ForgeInstallTask;
public:
diff --git a/logic/forge/ForgeVersionList.h b/logic/forge/ForgeVersionList.h
index 35af3233..e2e8c3f8 100644
--- a/logic/forge/ForgeVersionList.h
+++ b/logic/forge/ForgeVersionList.h
@@ -25,7 +25,9 @@
#include "net/NetJob.h"
#include "forge/ForgeVersion.h"
-class ForgeVersionList : public BaseVersionList
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT ForgeVersionList : public BaseVersionList
{
Q_OBJECT
public:
diff --git a/logic/ftb/FTBPlugin.h b/logic/ftb/FTBPlugin.h
index 30913d19..6851d8a5 100644
--- a/logic/ftb/FTBPlugin.h
+++ b/logic/ftb/FTBPlugin.h
@@ -2,8 +2,10 @@
#include <BaseInstance.h>
+#include "multimc_logic_export.h"
+
// Pseudo-plugin for FTB related things. Super derpy!
-class FTBPlugin
+class MULTIMC_LOGIC_EXPORT FTBPlugin
{
public:
static void initialize(SettingsObjectPtr globalSettings);
diff --git a/logic/icons/IconList.h b/logic/icons/IconList.h
index cc2ba5c4..971db824 100644
--- a/logic/icons/IconList.h
+++ b/logic/icons/IconList.h
@@ -25,9 +25,11 @@
#include "settings/Setting.h"
#include "Env.h" // there is a global icon list inside Env.
+#include "multimc_logic_export.h"
+
class QFileSystemWatcher;
-class IconList : public QAbstractListModel
+class MULTIMC_LOGIC_EXPORT IconList : public QAbstractListModel
{
Q_OBJECT
public:
diff --git a/logic/icons/MMCIcon.h b/logic/icons/MMCIcon.h
index cf087aa4..753e916d 100644
--- a/logic/icons/MMCIcon.h
+++ b/logic/icons/MMCIcon.h
@@ -17,7 +17,10 @@
#include <QString>
#include <QDateTime>
#include <QIcon>
-struct MMCImage
+
+#include "multimc_logic_export.h"
+
+struct MULTIMC_LOGIC_EXPORT MMCImage
{
QIcon icon;
QString filename;
@@ -28,7 +31,7 @@ struct MMCImage
}
};
-struct MMCIcon
+struct MULTIMC_LOGIC_EXPORT MMCIcon
{
enum Type : unsigned
{
diff --git a/logic/java/JavaChecker.h b/logic/java/JavaChecker.h
index a25eef93..3399f07e 100644
--- a/logic/java/JavaChecker.h
+++ b/logic/java/JavaChecker.h
@@ -3,6 +3,8 @@
#include <QTimer>
#include <memory>
+#include "multimc_logic_export.h"
+
class JavaChecker;
@@ -20,7 +22,7 @@ struct JavaCheckResult
typedef std::shared_ptr<QProcess> QProcessPtr;
typedef std::shared_ptr<JavaChecker> JavaCheckerPtr;
-class JavaChecker : public QObject
+class MULTIMC_LOGIC_EXPORT JavaChecker : public QObject
{
Q_OBJECT
public:
diff --git a/logic/java/JavaUtils.h b/logic/java/JavaUtils.h
index cde3050e..d4dd2409 100644
--- a/logic/java/JavaUtils.h
+++ b/logic/java/JavaUtils.h
@@ -27,7 +27,9 @@
#include <windows.h>
#endif
-class JavaUtils : public QObject
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT JavaUtils : public QObject
{
Q_OBJECT
public:
diff --git a/logic/java/JavaVersionList.h b/logic/java/JavaVersionList.h
index d78f9e7c..905a5a7b 100644
--- a/logic/java/JavaVersionList.h
+++ b/logic/java/JavaVersionList.h
@@ -22,6 +22,8 @@
#include "tasks/Task.h"
#include "java/JavaCheckerJob.h"
+#include "multimc_logic_export.h"
+
class JavaListLoadTask;
struct JavaVersion : public BaseVersion
@@ -54,7 +56,7 @@ struct JavaVersion : public BaseVersion
typedef std::shared_ptr<JavaVersion> JavaVersionPtr;
-class JavaVersionList : public BaseVersionList
+class MULTIMC_LOGIC_EXPORT JavaVersionList : public BaseVersionList
{
Q_OBJECT
public:
diff --git a/logic/launch/LaunchTask.h b/logic/launch/LaunchTask.h
index bd0485c8..eb13a72d 100644
--- a/logic/launch/LaunchTask.h
+++ b/logic/launch/LaunchTask.h
@@ -22,7 +22,9 @@
#include "LoggedProcess.h"
#include "LaunchStep.h"
-class LaunchTask: public Task
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT LaunchTask: public Task
{
Q_OBJECT
protected:
diff --git a/logic/launch/steps/CheckJava.cpp b/logic/launch/steps/CheckJava.cpp
index 92c65d0a..9c5fd404 100644
--- a/logic/launch/steps/CheckJava.cpp
+++ b/logic/launch/steps/CheckJava.cpp
@@ -57,7 +57,6 @@ void CheckJava::executeTask()
if (javaUnixTime != storedUnixTime)
{
m_JavaChecker = std::make_shared<JavaChecker>();
- bool successful = false;
QString errorLog;
QString version;
emit logLine(tr("Checking Java version..."), MessageLevel::MultiMC);
diff --git a/logic/launch/steps/LaunchMinecraft.cpp b/logic/launch/steps/LaunchMinecraft.cpp
index 4cde2d9f..95438003 100644
--- a/logic/launch/steps/LaunchMinecraft.cpp
+++ b/logic/launch/steps/LaunchMinecraft.cpp
@@ -81,8 +81,8 @@ void LaunchMinecraft::on_state(LoggedProcess::State state)
case LoggedProcess::Finished:
{
m_parent->setPid(-1);
- auto exitCode = m_process.exitCode();
//FIXME: make this work again
+ // auto exitCode = m_process.exitCode();
// m_postlaunchprocess.processEnvironment().insert("INST_EXITCODE", QString(exitCode));
// run post-exit
emitSucceeded();
diff --git a/logic/launch/steps/TextPrint.h b/logic/launch/steps/TextPrint.h
index 3846bf84..fdd9014a 100644
--- a/logic/launch/steps/TextPrint.h
+++ b/logic/launch/steps/TextPrint.h
@@ -19,7 +19,13 @@
#include <launch/LoggedProcess.h>
#include <java/JavaChecker.h>
-class TextPrint: public LaunchStep
+#include "multimc_logic_export.h"
+
+/*
+ * FIXME: maybe do not export
+ */
+
+class MULTIMC_LOGIC_EXPORT TextPrint: public LaunchStep
{
Q_OBJECT
public:
diff --git a/logic/liteloader/LiteLoaderInstaller.h b/logic/liteloader/LiteLoaderInstaller.h
index 490d2107..5afa4f6c 100644
--- a/logic/liteloader/LiteLoaderInstaller.h
+++ b/logic/liteloader/LiteLoaderInstaller.h
@@ -21,7 +21,9 @@
#include "BaseInstaller.h"
#include "liteloader/LiteLoaderVersionList.h"
-class LiteLoaderInstaller : public BaseInstaller
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT LiteLoaderInstaller : public BaseInstaller
{
public:
LiteLoaderInstaller();
diff --git a/logic/liteloader/LiteLoaderVersionList.h b/logic/liteloader/LiteLoaderVersionList.h
index f3f78349..e25f2c64 100644
--- a/logic/liteloader/LiteLoaderVersionList.h
+++ b/logic/liteloader/LiteLoaderVersionList.h
@@ -25,6 +25,8 @@
#include "net/NetJob.h"
#include <minecraft/RawLibrary.h>
+#include "multimc_logic_export.h"
+
class LLListLoadTask;
class QNetworkReply;
@@ -65,7 +67,7 @@ public:
};
typedef std::shared_ptr<LiteLoaderVersion> LiteLoaderVersionPtr;
-class LiteLoaderVersionList : public BaseVersionList
+class MULTIMC_LOGIC_EXPORT LiteLoaderVersionList : public BaseVersionList
{
Q_OBJECT
public:
diff --git a/logic/minecraft/LegacyInstance.h b/logic/minecraft/LegacyInstance.h
index 0930c290..8663daba 100644
--- a/logic/minecraft/LegacyInstance.h
+++ b/logic/minecraft/LegacyInstance.h
@@ -17,10 +17,12 @@
#include "minecraft/MinecraftInstance.h"
+#include "multimc_logic_export.h"
+
class ModList;
class Task;
-class LegacyInstance : public MinecraftInstance
+class MULTIMC_LOGIC_EXPORT LegacyInstance : public MinecraftInstance
{
Q_OBJECT
public:
diff --git a/logic/minecraft/LwjglVersionList.h b/logic/minecraft/LwjglVersionList.h
index 9584f837..84abaab1 100644
--- a/logic/minecraft/LwjglVersionList.h
+++ b/logic/minecraft/LwjglVersionList.h
@@ -24,10 +24,12 @@
#include "BaseVersion.h"
#include "BaseVersionList.h"
+#include "multimc_logic_export.h"
+
class LWJGLVersion;
typedef std::shared_ptr<LWJGLVersion> PtrLWJGLVersion;
-class LWJGLVersion : public BaseVersion
+class MULTIMC_LOGIC_EXPORT LWJGLVersion : public BaseVersion
{
public:
LWJGLVersion(const QString &name, const QString &url)
@@ -60,7 +62,7 @@ protected:
QString m_url;
};
-class LWJGLVersionList : public BaseVersionList
+class MULTIMC_LOGIC_EXPORT LWJGLVersionList : public BaseVersionList
{
Q_OBJECT
public:
diff --git a/logic/minecraft/MinecraftInstance.h b/logic/minecraft/MinecraftInstance.h
index 39a51b9a..b3af2fe8 100644
--- a/logic/minecraft/MinecraftInstance.h
+++ b/logic/minecraft/MinecraftInstance.h
@@ -3,9 +3,11 @@
#include "minecraft/Mod.h"
#include <QProcess>
+#include "multimc_logic_export.h"
+
class ModList;
-class MinecraftInstance: public BaseInstance
+class MULTIMC_LOGIC_EXPORT MinecraftInstance: public BaseInstance
{
public:
MinecraftInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir);
diff --git a/logic/minecraft/MinecraftProfile.h b/logic/minecraft/MinecraftProfile.h
index d97f7bb8..6f56e848 100644
--- a/logic/minecraft/MinecraftProfile.h
+++ b/logic/minecraft/MinecraftProfile.h
@@ -25,10 +25,13 @@
#include "VersionFile.h"
#include "JarMod.h"
+#include "multimc_logic_export.h"
+
class ProfileStrategy;
class OneSixInstance;
-class MinecraftProfile : public QAbstractListModel
+
+class MULTIMC_LOGIC_EXPORT MinecraftProfile : public QAbstractListModel
{
Q_OBJECT
friend class ProfileStrategy;
diff --git a/logic/minecraft/MinecraftVersion.h b/logic/minecraft/MinecraftVersion.h
index 3795cb41..234e5566 100644
--- a/logic/minecraft/MinecraftVersion.h
+++ b/logic/minecraft/MinecraftVersion.h
@@ -24,11 +24,13 @@
#include "VersionFile.h"
#include "VersionSource.h"
+#include "multimc_logic_export.h"
+
class MinecraftProfile;
class MinecraftVersion;
typedef std::shared_ptr<MinecraftVersion> MinecraftVersionPtr;
-class MinecraftVersion : public BaseVersion, public ProfilePatch
+class MULTIMC_LOGIC_EXPORT MinecraftVersion : public BaseVersion, public ProfilePatch
{
public: /* methods */
bool usesLegacyLauncher();
diff --git a/logic/minecraft/MinecraftVersionList.h b/logic/minecraft/MinecraftVersionList.h
index 8e45d35a..110f8a66 100644
--- a/logic/minecraft/MinecraftVersionList.h
+++ b/logic/minecraft/MinecraftVersionList.h
@@ -24,10 +24,12 @@
#include "minecraft/MinecraftVersion.h"
#include <net/NetJob.h>
+#include "multimc_logic_export.h"
+
class MCVListLoadTask;
class MCVListVersionUpdateTask;
-class MinecraftVersionList : public BaseVersionList
+class MULTIMC_LOGIC_EXPORT MinecraftVersionList : public BaseVersionList
{
Q_OBJECT
private:
diff --git a/logic/minecraft/ModList.h b/logic/minecraft/ModList.h
index 70eb5569..823854ed 100644
--- a/logic/minecraft/ModList.h
+++ b/logic/minecraft/ModList.h
@@ -22,6 +22,8 @@
#include "minecraft/Mod.h"
+#include "multimc_logic_export.h"
+
class LegacyInstance;
class BaseInstance;
class QFileSystemWatcher;
@@ -30,7 +32,7 @@ class QFileSystemWatcher;
* A legacy mod list.
* Backed by a folder.
*/
-class ModList : public QAbstractListModel
+class MULTIMC_LOGIC_EXPORT ModList : public QAbstractListModel
{
Q_OBJECT
public:
diff --git a/logic/minecraft/OneSixInstance.cpp b/logic/minecraft/OneSixInstance.cpp
index 6cea55d2..57fa0a68 100644
--- a/logic/minecraft/OneSixInstance.cpp
+++ b/logic/minecraft/OneSixInstance.cpp
@@ -292,7 +292,7 @@ std::shared_ptr<Task> OneSixInstance::createJarModdingTask()
class JarModTask : public Task
{
public:
- explicit JarModTask(std::shared_ptr<OneSixInstance> inst) : m_inst(inst), Task(nullptr)
+ explicit JarModTask(std::shared_ptr<OneSixInstance> inst) : Task(nullptr), m_inst(inst)
{
}
virtual void executeTask()
diff --git a/logic/minecraft/OneSixInstance.h b/logic/minecraft/OneSixInstance.h
index 42902366..963bd152 100644
--- a/logic/minecraft/OneSixInstance.h
+++ b/logic/minecraft/OneSixInstance.h
@@ -20,7 +20,9 @@
#include "minecraft/MinecraftProfile.h"
#include "minecraft/ModList.h"
-class OneSixInstance : public MinecraftInstance
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT OneSixInstance : public MinecraftInstance
{
Q_OBJECT
public:
diff --git a/logic/minecraft/SkinUtils.h b/logic/minecraft/SkinUtils.h
index bab9d45e..5584bf6c 100644
--- a/logic/minecraft/SkinUtils.h
+++ b/logic/minecraft/SkinUtils.h
@@ -17,7 +17,9 @@
#include <QPixmap>
+#include "multimc_logic_export.h"
+
namespace SkinUtils
{
-QPixmap getFaceFromCache(QString username, int height = 64, int width = 64);
+QPixmap MULTIMC_LOGIC_EXPORT getFaceFromCache(QString username, int height = 64, int width = 64);
}
diff --git a/logic/minecraft/VersionFilterData.h b/logic/minecraft/VersionFilterData.h
index 339e3891..98db2484 100644
--- a/logic/minecraft/VersionFilterData.h
+++ b/logic/minecraft/VersionFilterData.h
@@ -4,6 +4,8 @@
#include <QSet>
#include <QDateTime>
+#include "multimc_logic_export.h"
+
struct FMLlib
{
QString filename;
@@ -29,4 +31,4 @@ struct VersionFilterData
// Currently discouraged java version (anything equal and above will be discouraged)
QString discouragedJavaVersion;
};
-extern VersionFilterData g_VersionFilterData;
+extern VersionFilterData MULTIMC_LOGIC_EXPORT g_VersionFilterData;
diff --git a/logic/net/ByteArrayDownload.h b/logic/net/ByteArrayDownload.h
index a5d8cebe..e2fc2911 100644
--- a/logic/net/ByteArrayDownload.h
+++ b/logic/net/ByteArrayDownload.h
@@ -16,8 +16,10 @@
#pragma once
#include "NetAction.h"
+#include "multimc_logic_export.h"
+
typedef std::shared_ptr<class ByteArrayDownload> ByteArrayDownloadPtr;
-class ByteArrayDownload : public NetAction
+class MULTIMC_LOGIC_EXPORT ByteArrayDownload : public NetAction
{
Q_OBJECT
public:
diff --git a/logic/net/CacheDownload.h b/logic/net/CacheDownload.h
index 7f95a69d..f640b740 100644
--- a/logic/net/CacheDownload.h
+++ b/logic/net/CacheDownload.h
@@ -20,19 +20,22 @@
#include <QCryptographicHash>
#include <QSaveFile>
-class INetworkValidator
+#include "multimc_logic_export.h"
+
+/* FIXME: move to its own file(s) */
+class MULTIMC_LOGIC_EXPORT INetworkValidator
{
public:
virtual ~INetworkValidator() {}
virtual void validate(const QByteArray &data) = 0;
};
-class JsonValidator : public INetworkValidator
+class MULTIMC_LOGIC_EXPORT JsonValidator : public INetworkValidator
{
public:
void validate(const QByteArray &data) override;
};
-class MD5HashValidator : public INetworkValidator
+class MULTIMC_LOGIC_EXPORT MD5HashValidator : public INetworkValidator
{
public:
explicit MD5HashValidator(const QByteArray &expected)
@@ -44,7 +47,7 @@ private:
};
typedef std::shared_ptr<class CacheDownload> CacheDownloadPtr;
-class CacheDownload : public NetAction
+class MULTIMC_LOGIC_EXPORT CacheDownload : public NetAction
{
Q_OBJECT
private:
diff --git a/logic/net/HttpMetaCache.h b/logic/net/HttpMetaCache.h
index 042f66bf..fba3fe5a 100644
--- a/logic/net/HttpMetaCache.h
+++ b/logic/net/HttpMetaCache.h
@@ -19,9 +19,11 @@
#include <qtimer.h>
#include <memory>
+#include "multimc_logic_export.h"
+
class HttpMetaCache;
-struct MetaEntry
+struct MULTIMC_LOGIC_EXPORT MetaEntry
{
QString base;
QString path;
@@ -35,7 +37,7 @@ struct MetaEntry
typedef std::shared_ptr<MetaEntry> MetaEntryPtr;
-class HttpMetaCache : public QObject
+class MULTIMC_LOGIC_EXPORT HttpMetaCache : public QObject
{
Q_OBJECT
public:
diff --git a/logic/net/NetJob.h b/logic/net/NetJob.h
index 9e4656c7..85a8bf83 100644
--- a/logic/net/NetJob.h
+++ b/logic/net/NetJob.h
@@ -24,10 +24,12 @@
#include "tasks/Task.h"
#include "QObjectPtr.h"
+#include "multimc_logic_export.h"
+
class NetJob;
typedef QObjectPtr<NetJob> NetJobPtr;
-class NetJob : public Task
+class MULTIMC_LOGIC_EXPORT NetJob : public Task
{
Q_OBJECT
public:
diff --git a/logic/net/PasteUpload.h b/logic/net/PasteUpload.h
index e353f421..11850c71 100644
--- a/logic/net/PasteUpload.h
+++ b/logic/net/PasteUpload.h
@@ -4,7 +4,9 @@
#include <QNetworkReply>
#include <memory>
-class PasteUpload : public Task
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT PasteUpload : public Task
{
Q_OBJECT
public:
diff --git a/logic/net/URLConstants.h b/logic/net/URLConstants.h
index 01d1482b..b04f44ba 100644
--- a/logic/net/URLConstants.h
+++ b/logic/net/URLConstants.h
@@ -17,6 +17,8 @@
#include <QString>
+#include "multimc_logic_export.h"
+
namespace URLConstants
{
extern const QString AWS_DOWNLOAD_BASE;
@@ -26,7 +28,7 @@ extern const QString AWS_DOWNLOAD_INDEXES;
extern const QString ASSETS_BASE;
extern const QString RESOURCE_BASE;
extern const QString LIBRARY_BASE;
-extern const QString SKINS_BASE;
+MULTIMC_LOGIC_EXPORT extern const QString SKINS_BASE;
extern const QString AUTH_BASE;
extern const QString FORGE_LEGACY_URL;
extern const QString FORGE_GRADLE_URL;
diff --git a/logic/news/NewsChecker.h b/logic/news/NewsChecker.h
index effa80bf..b8b90728 100644
--- a/logic/news/NewsChecker.h
+++ b/logic/news/NewsChecker.h
@@ -23,7 +23,9 @@
#include "NewsEntry.h"
-class NewsChecker : public QObject
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT NewsChecker : public QObject
{
Q_OBJECT
public:
diff --git a/logic/notifications/NotificationChecker.h b/logic/notifications/NotificationChecker.h
index 92bc23dc..a2d92ab9 100644
--- a/logic/notifications/NotificationChecker.h
+++ b/logic/notifications/NotificationChecker.h
@@ -5,7 +5,9 @@
#include "net/NetJob.h"
#include "net/CacheDownload.h"
-class NotificationChecker : public QObject
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT NotificationChecker : public QObject
{
Q_OBJECT
diff --git a/logic/resources/IconResourceHandler.h b/logic/resources/IconResourceHandler.h
index 6f933ad4..44fafc07 100644
--- a/logic/resources/IconResourceHandler.h
+++ b/logic/resources/IconResourceHandler.h
@@ -4,7 +4,9 @@
#include "ResourceHandler.h"
-class IconResourceHandler : public ResourceHandler
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT IconResourceHandler : public ResourceHandler
{
public:
explicit IconResourceHandler(const QString &key);
diff --git a/logic/resources/Resource.h b/logic/resources/Resource.h
index 40a6d871..63e97b88 100644
--- a/logic/resources/Resource.h
+++ b/logic/resources/Resource.h
@@ -9,6 +9,8 @@
#include "ResourceObserver.h"
#include "TypeMagic.h"
+#include "multimc_logic_export.h"
+
class ResourceHandler;
/** Frontend class for resources
@@ -27,7 +29,7 @@ class ResourceHandler;
*
* @note Always pass resource around using Resource::Ptr! Copy and move constructors are disabled for a reason.
*/
-class Resource : public std::enable_shared_from_this<Resource>
+class MULTIMC_LOGIC_EXPORT Resource : public std::enable_shared_from_this<Resource>
{
// only allow creation from Resource::create and disallow passing around non-pointers
explicit Resource(const QString &resource);
diff --git a/logic/resources/ResourceHandler.h b/logic/resources/ResourceHandler.h
index a4f638ec..f09d8904 100644
--- a/logic/resources/ResourceHandler.h
+++ b/logic/resources/ResourceHandler.h
@@ -3,6 +3,8 @@
#include <QVariant>
#include <memory>
+#include "multimc_logic_export.h"
+
class Resource;
/** Base class for things that can retrieve a resource.
@@ -11,7 +13,7 @@ class Resource;
* call Resource::registerHandler<MyResourceHandler>("<id>"), where <id> is the
* prefix of the resource ("web", "icon", etc.)
*/
-class ResourceHandler
+class MULTIMC_LOGIC_EXPORT ResourceHandler
{
public:
virtual ~ResourceHandler() {}
diff --git a/logic/resources/ResourceObserver.h b/logic/resources/ResourceObserver.h
index ef946c32..cf4fa619 100644
--- a/logic/resources/ResourceObserver.h
+++ b/logic/resources/ResourceObserver.h
@@ -5,12 +5,13 @@
#include <QObject>
#include <QMetaProperty>
+#include "multimc_logic_export.h"
class QVariant;
class Resource;
/// Base class for things that can use a resource
-class ResourceObserver
+class MULTIMC_LOGIC_EXPORT ResourceObserver
{
public:
virtual ~ResourceObserver();
@@ -39,7 +40,7 @@ private:
*
* If no name is given an attempt to find a default property for some common classes is done.
*/
-class QObjectResourceObserver : public QObject, public ResourceObserver
+class MULTIMC_LOGIC_EXPORT QObjectResourceObserver : public QObject, public ResourceObserver
{
public:
explicit QObjectResourceObserver(QObject *target, const char *property = nullptr);
@@ -57,7 +58,7 @@ private:
* * We need Func in order to std::forward the function
*/
template <typename Ret, typename Arg, typename Func>
-class FunctionResourceObserver : public ResourceObserver
+class MULTIMC_LOGIC_EXPORT FunctionResourceObserver : public ResourceObserver
{
std::function<Ret(Arg)> m_function;
public:
diff --git a/logic/screenshots/ImgurAlbumCreation.h b/logic/screenshots/ImgurAlbumCreation.h
index f4adf6f2..469174e4 100644
--- a/logic/screenshots/ImgurAlbumCreation.h
+++ b/logic/screenshots/ImgurAlbumCreation.h
@@ -2,8 +2,10 @@
#include "net/NetAction.h"
#include "Screenshot.h"
+#include "multimc_logic_export.h"
+
typedef std::shared_ptr<class ImgurAlbumCreation> ImgurAlbumCreationPtr;
-class ImgurAlbumCreation : public NetAction
+class MULTIMC_LOGIC_EXPORT ImgurAlbumCreation : public NetAction
{
public:
explicit ImgurAlbumCreation(QList<ScreenshotPtr> screenshots);
diff --git a/logic/screenshots/ImgurUpload.h b/logic/screenshots/ImgurUpload.h
index f6f4c3a1..0a766b8f 100644
--- a/logic/screenshots/ImgurUpload.h
+++ b/logic/screenshots/ImgurUpload.h
@@ -2,8 +2,10 @@
#include "net/NetAction.h"
#include "Screenshot.h"
+#include "multimc_logic_export.h"
+
typedef std::shared_ptr<class ImgurUpload> ImgurUploadPtr;
-class ImgurUpload : public NetAction
+class MULTIMC_LOGIC_EXPORT ImgurUpload : public NetAction
{
public:
explicit ImgurUpload(ScreenshotPtr shot);
diff --git a/logic/settings/INIFile.h b/logic/settings/INIFile.h
index f32c5591..5013eb2d 100644
--- a/logic/settings/INIFile.h
+++ b/logic/settings/INIFile.h
@@ -19,8 +19,10 @@
#include <QVariant>
#include <QIODevice>
+#include "multimc_logic_export.h"
+
// Sectionless INI parser (for instance config files)
-class INIFile : public QMap<QString, QVariant>
+class MULTIMC_LOGIC_EXPORT INIFile : public QMap<QString, QVariant>
{
public:
explicit INIFile();
diff --git a/logic/settings/INISettingsObject.h b/logic/settings/INISettingsObject.h
index a93eea78..426b62f5 100644
--- a/logic/settings/INISettingsObject.h
+++ b/logic/settings/INISettingsObject.h
@@ -21,10 +21,12 @@
#include "settings/SettingsObject.h"
+#include "multimc_logic_export.h"
+
/*!
* \brief A settings object that stores its settings in an INIFile.
*/
-class INISettingsObject : public SettingsObject
+class MULTIMC_LOGIC_EXPORT INISettingsObject : public SettingsObject
{
Q_OBJECT
public:
diff --git a/logic/settings/Setting.h b/logic/settings/Setting.h
index fd814795..6d53ac6d 100644
--- a/logic/settings/Setting.h
+++ b/logic/settings/Setting.h
@@ -20,21 +20,23 @@
#include <QStringList>
#include <memory>
+#include "multimc_logic_export.h"
+
class SettingsObject;
/*!
*
*/
-class Setting : public QObject
+class MULTIMC_LOGIC_EXPORT Setting : public QObject
{
Q_OBJECT
public:
/**
* Construct a Setting
- *
+ *
* Synonyms are all the possible names used in the settings object, in order of preference.
* First synonym is the ID, which identifies the setting in MultiMC.
- *
+ *
* defVal is the default value that will be returned when the settings object
* doesn't have any value for this setting.
*/
diff --git a/logic/settings/SettingsObject.h b/logic/settings/SettingsObject.h
index 0f299c5d..82193903 100644
--- a/logic/settings/SettingsObject.h
+++ b/logic/settings/SettingsObject.h
@@ -21,6 +21,8 @@
#include <QVariant>
#include <memory>
+#include "multimc_logic_export.h"
+
class Setting;
class SettingsObject;
@@ -38,7 +40,7 @@ typedef std::shared_ptr<SettingsObject> SettingsObjectPtr;
*
* \sa Setting
*/
-class SettingsObject : public QObject
+class MULTIMC_LOGIC_EXPORT SettingsObject : public QObject
{
Q_OBJECT
public:
diff --git a/logic/status/StatusChecker.h b/logic/status/StatusChecker.h
index 28283eb3..c1a54dba 100644
--- a/logic/status/StatusChecker.h
+++ b/logic/status/StatusChecker.h
@@ -21,7 +21,9 @@
#include <net/NetJob.h>
-class StatusChecker : public QObject
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT StatusChecker : public QObject
{
Q_OBJECT
public:
diff --git a/logic/tasks/SequentialTask.h b/logic/tasks/SequentialTask.h
index 1c90765c..69031095 100644
--- a/logic/tasks/SequentialTask.h
+++ b/logic/tasks/SequentialTask.h
@@ -5,7 +5,9 @@
#include <QQueue>
#include <memory>
-class SequentialTask : public Task
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT SequentialTask : public Task
{
Q_OBJECT
public:
diff --git a/logic/tasks/Task.h b/logic/tasks/Task.h
index 04899c69..2b0ccbcd 100644
--- a/logic/tasks/Task.h
+++ b/logic/tasks/Task.h
@@ -18,7 +18,9 @@
#include <QObject>
#include <QString>
-class Task : public QObject
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT Task : public QObject
{
Q_OBJECT
public:
diff --git a/logic/tools/BaseExternalTool.h b/logic/tools/BaseExternalTool.h
index be23036d..fe1b5dc6 100644
--- a/logic/tools/BaseExternalTool.h
+++ b/logic/tools/BaseExternalTool.h
@@ -3,11 +3,13 @@
#include <QObject>
#include <BaseInstance.h>
+#include "multimc_logic_export.h"
+
class BaseInstance;
class SettingsObject;
class QProcess;
-class BaseExternalTool : public QObject
+class MULTIMC_LOGIC_EXPORT BaseExternalTool : public QObject
{
Q_OBJECT
public:
@@ -19,7 +21,7 @@ protected:
SettingsObjectPtr globalSettings;
};
-class BaseDetachedTool : public BaseExternalTool
+class MULTIMC_LOGIC_EXPORT BaseDetachedTool : public BaseExternalTool
{
Q_OBJECT
public:
@@ -33,7 +35,7 @@ protected:
virtual void runImpl() = 0;
};
-class BaseExternalToolFactory
+class MULTIMC_LOGIC_EXPORT BaseExternalToolFactory
{
public:
virtual ~BaseExternalToolFactory();
@@ -51,7 +53,7 @@ protected:
SettingsObjectPtr globalSettings;
};
-class BaseDetachedToolFactory : public BaseExternalToolFactory
+class MULTIMC_LOGIC_EXPORT BaseDetachedToolFactory : public BaseExternalToolFactory
{
public:
virtual BaseDetachedTool *createDetachedTool(InstancePtr instance, QObject *parent = 0);
diff --git a/logic/tools/BaseProfiler.h b/logic/tools/BaseProfiler.h
index 5191f7b8..3340b7e4 100644
--- a/logic/tools/BaseProfiler.h
+++ b/logic/tools/BaseProfiler.h
@@ -2,12 +2,14 @@
#include "BaseExternalTool.h"
+#include "multimc_logic_export.h"
+
class BaseInstance;
class SettingsObject;
class LaunchTask;
class QProcess;
-class BaseProfiler : public BaseExternalTool
+class MULTIMC_LOGIC_EXPORT BaseProfiler : public BaseExternalTool
{
Q_OBJECT
public:
@@ -29,7 +31,7 @@ signals:
void abortLaunch(const QString &message);
};
-class BaseProfilerFactory : public BaseExternalToolFactory
+class MULTIMC_LOGIC_EXPORT BaseProfilerFactory : public BaseExternalToolFactory
{
public:
virtual BaseProfiler *createProfiler(InstancePtr instance, QObject *parent = 0);
diff --git a/logic/tools/JProfiler.h b/logic/tools/JProfiler.h
index b5440b0b..d658d6c2 100644
--- a/logic/tools/JProfiler.h
+++ b/logic/tools/JProfiler.h
@@ -2,7 +2,9 @@
#include "BaseProfiler.h"
-class JProfilerFactory : public BaseProfilerFactory
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT JProfilerFactory : public BaseProfilerFactory
{
public:
QString name() const override { return "JProfiler"; }
diff --git a/logic/tools/JVisualVM.h b/logic/tools/JVisualVM.h
index 45de2618..0674da13 100644
--- a/logic/tools/JVisualVM.h
+++ b/logic/tools/JVisualVM.h
@@ -2,7 +2,9 @@
#include "BaseProfiler.h"
-class JVisualVMFactory : public BaseProfilerFactory
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT JVisualVMFactory : public BaseProfilerFactory
{
public:
QString name() const override { return "JVisualVM"; }
diff --git a/logic/tools/MCEditTool.h b/logic/tools/MCEditTool.h
index bd40f02d..c287f1ea 100644
--- a/logic/tools/MCEditTool.h
+++ b/logic/tools/MCEditTool.h
@@ -2,7 +2,9 @@
#include "BaseExternalTool.h"
-class MCEditTool : public BaseDetachedTool
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT MCEditTool : public BaseDetachedTool
{
Q_OBJECT
public:
@@ -13,7 +15,7 @@ protected:
void runImpl() override;
};
-class MCEditFactory : public BaseDetachedToolFactory
+class MULTIMC_LOGIC_EXPORT MCEditFactory : public BaseDetachedToolFactory
{
public:
QString name() const override { return "MCEdit"; }
diff --git a/logic/trans/TranslationDownloader.h b/logic/trans/TranslationDownloader.h
index 78e7fe1c..e7893805 100644
--- a/logic/trans/TranslationDownloader.h
+++ b/logic/trans/TranslationDownloader.h
@@ -5,11 +5,12 @@
#include <memory>
#include <QObject>
#include <net/NetJob.h>
+#include "multimc_logic_export.h"
class ByteArrayDownload;
class NetJob;
-class TranslationDownloader : public QObject
+class MULTIMC_LOGIC_EXPORT TranslationDownloader : public QObject
{
Q_OBJECT
diff --git a/logic/updater/DownloadTask.h b/logic/updater/DownloadTask.h
index d77c2b2c..83b4a142 100644
--- a/logic/updater/DownloadTask.h
+++ b/logic/updater/DownloadTask.h
@@ -19,13 +19,15 @@
#include "net/NetJob.h"
#include "GoUpdate.h"
+#include "multimc_logic_export.h"
+
namespace GoUpdate
{
/*!
* The DownloadTask is a task that takes a given version ID and repository URL,
* downloads that version's files from the repository, and prepares to install them.
*/
-class DownloadTask : public Task
+class MULTIMC_LOGIC_EXPORT DownloadTask : public Task
{
Q_OBJECT
diff --git a/logic/updater/GoUpdate.h b/logic/updater/GoUpdate.h
index 479f1eeb..b8a534de 100644
--- a/logic/updater/GoUpdate.h
+++ b/logic/updater/GoUpdate.h
@@ -2,13 +2,15 @@
#include <QByteArray>
#include <net/NetJob.h>
+#include "multimc_logic_export.h"
+
namespace GoUpdate
{
/**
* A temporary object exchanged between updated checker and the actual update task
*/
-struct Status
+struct MULTIMC_LOGIC_EXPORT Status
{
bool updateAvailable = false;
@@ -25,7 +27,7 @@ struct Status
/**
* Struct that describes an entry in a VersionFileEntry's `Sources` list.
*/
-struct FileSource
+struct MULTIMC_LOGIC_EXPORT FileSource
{
FileSource(QString type, QString url, QString compression="")
{
@@ -48,7 +50,7 @@ typedef QList<FileSource> FileSourceList;
/**
* Structure that describes an entry in a GoUpdate version's `Files` list.
*/
-struct VersionFileEntry
+struct MULTIMC_LOGIC_EXPORT VersionFileEntry
{
QString path;
int mode;
@@ -64,7 +66,7 @@ typedef QList<VersionFileEntry> VersionFileList;
/**
* Structure that describes an operation to perform when installing updates.
*/
-struct Operation
+struct MULTIMC_LOGIC_EXPORT Operation
{
static Operation CopyOp(QString fsource, QString fdest, int fmode=0644)
{
@@ -102,13 +104,13 @@ typedef QList<Operation> OperationList;
/**
* Loads the file list from the given version info JSON object into the given list.
*/
-bool parseVersionInfo(const QByteArray &data, VersionFileList& list, QString &error);
+bool MULTIMC_LOGIC_EXPORT parseVersionInfo(const QByteArray &data, VersionFileList& list, QString &error);
/*!
* Takes a list of file entries for the current version's files and the new version's files
* and populates the downloadList and operationList with information about how to download and install the update.
*/
-bool processFileLists
+bool MULTIMC_LOGIC_EXPORT processFileLists
(
const VersionFileList &currentVersion,
const VersionFileList &newVersion,
@@ -125,7 +127,7 @@ bool processFileLists
*
* @return false if the path couldn't be fixed (is invalid)
*/
-bool fixPathForOSX(QString &path);
+bool MULTIMC_LOGIC_EXPORT fixPathForOSX(QString &path);
}
Q_DECLARE_METATYPE(GoUpdate::Status); \ No newline at end of file
diff --git a/logic/updater/UpdateChecker.h b/logic/updater/UpdateChecker.h
index 39ccd138..c7fad10e 100644
--- a/logic/updater/UpdateChecker.h
+++ b/logic/updater/UpdateChecker.h
@@ -20,7 +20,9 @@
#include <QUrl>
-class UpdateChecker : public QObject
+#include "multimc_logic_export.h"
+
+class MULTIMC_LOGIC_EXPORT UpdateChecker : public QObject
{
Q_OBJECT
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 238accf9..d6487a65 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,7 +1,7 @@
# run the unit tests with `make test`
find_package(Qt5 COMPONENTS Test Core Network)
-include_directories(../logic)
+include_directories(../logic ${CMAKE_CURRENT_BINARY_DIR}/../logic)
include_directories(../depends/util/include/)
unset(MultiMC_TESTS)