Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to extension packaging. #36

Open
wants to merge 2 commits into
base: dev/vcpkg
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,47 @@
name: Build Installer FOMOD Plugin
name: Build Installer FOMOD

on:
push:
branches: master
pull_request:
types: [opened, synchronize, reopened]

env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"

jobs:
build:
runs-on: windows-2022
steps:
- name: Build Installer FOMOD Plugin
uses: ModOrganizer2/build-with-mob-action@master
# https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-actions-cache
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
mo2-dependencies: cmake_common uibase
setup-python: false
version: 6.7.0
modules:
cache: true

- uses: actions/checkout@v4

- name: "Set environmental variables"
shell: bash
run: |
echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV

- name: Configure Installer FOMOD
shell: pwsh
run: |
cmake --preset vs2022-windows-standalone `
"-DCMAKE_PREFIX_PATH=${env:QT_ROOT_DIR}\msvc2019_64" `
"-DCMAKE_INSTALL_PREFIX=install"

- name: Build Installer FOMOD
run: cmake --build vsbuild --config RelWithDebInfo --target INSTALL
8 changes: 3 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ cmake_minimum_required(VERSION 3.16)

project(installer_fomod)

if(DEFINED DEPENDENCIES_DIR)
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/mo2.cmake)
else()
include(${CMAKE_CURRENT_LIST_DIR}/../cmake_common/mo2.cmake)
endif()
find_package(mo2-cmake CONFIG REQUIRED)

mo2_configure_extension()

add_subdirectory(src)
60 changes: 60 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"configurePresets": [
{
"errors": {
"deprecated": true
},
"hidden": true,
"name": "cmake-dev",
"warnings": {
"deprecated": true,
"dev": true
}
},
{
"cacheVariables": {
"VCPKG_MANIFEST_NO_DEFAULT_FEATURES": {
"type": "BOOL",
"value": "ON"
}
},
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"hidden": true,
"name": "vcpkg"
},
{
"hidden": true,
"inherits": ["vcpkg"],
"name": "vcpkg-dev"
},
{
"binaryDir": "${sourceDir}/vsbuild",
"architecture": {
"strategy": "set",
"value": "x64"
},
"cacheVariables": {
"CMAKE_CXX_FLAGS": "/EHsc /MP /W4",
"VCPKG_TARGET_TRIPLET": {
"type": "STRING",
"value": "x64-windows-static-md"
}
},
"generator": "Visual Studio 17 2022",
"inherits": ["cmake-dev", "vcpkg-dev"],
"name": "vs2022-windows",
"toolset": "v143"
},
{
"cacheVariables": {
"VCPKG_MANIFEST_FEATURES": {
"type": "STRING",
"value": "standalone"
}
},
"inherits": "vs2022-windows",
"name": "vs2022-windows-standalone"
}
],
"version": 4
}
34 changes: 34 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"id": "mo2-installer-fomod",
"name": "FOMOD Installer",
"version": "1.8.0",
"description": "Installer for XML based FOMOD archives.",
"author": {
"name": "Mod Organizer 2",
"homepage": "https://www.modorganizer.org/"
},
"contributors": [
"AL",
"AnyOldName3",
"Drew Warwick",
"Hugues92",
"Holt59",
"isanae",
"Krzysztof Starecki",
"LePresidente",
"LostDragonist",
"Silarn",
"Tannin",
"TheBloke",
"Thomas Tanner"
],
"type": "plugin",
"content": {
"plugins": {
"autodetect": true
},
"translations": {
"autodetect": "translations"
}
}
}
6 changes: 5 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
cmake_minimum_required(VERSION 3.16)

find_package(mo2-cmake CONFIG REQUIRED)
find_package(mo2-uibase CONFIG REQUIRED)

add_library(installer_fomod SHARED)
mo2_configure_plugin(installer_fomod WARNINGS OFF)
mo2_install_target(installer_fomod)
target_link_libraries(installer_fomod PRIVATE mo2::uibase)
mo2_install_plugin(installer_fomod)
28 changes: 0 additions & 28 deletions src/SConscript

This file was deleted.

29 changes: 15 additions & 14 deletions src/fomodinstallerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,10 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "fomodinstallerdialog.h"
#include "ui_fomodinstallerdialog.h"

#include "fomodscreenshotdialog.h"
#include "igamefeatures.h"
#include "imoinfo.h"
#include "iplugingame.h"
#include "log.h"
#include "report.h"
#include "scopeguard.h"
#include "scriptextender.h"
#include "utility.h"
#include "xmlreader.h"
#include <array>
#include <sstream>
#include <utility>
#include <vector>

#include <QCheckBox>
#include <QCompleter>
Expand All @@ -43,10 +37,17 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.

#include <Shellapi.h>

#include <array>
#include <sstream>
#include <utility>
#include <vector>
#include <uibase/game_features/igamefeatures.h>
#include <uibase/game_features/scriptextender.h>
#include <uibase/imoinfo.h>
#include <uibase/iplugingame.h>
#include <uibase/log.h>
#include <uibase/report.h>
#include <uibase/scopeguard.h>
#include <uibase/utility.h>

#include "fomodscreenshotdialog.h"
#include "xmlreader.h"

using namespace MOBase;

Expand Down
12 changes: 6 additions & 6 deletions src/fomodinstallerdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.

#pragma once

#include "guessedvalue.h"
#include "ifiletree.h"
#include "imoinfo.h"
#include "iplugininstaller.h"
#include "ipluginlist.h"

#include <QDialog>
#include <QGroupBox>
#include <QMetaType>
Expand All @@ -34,6 +28,12 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <functional>
#include <vector>

#include <uibase/guessedvalue.h>
#include <uibase/ifiletree.h>
#include <uibase/imoinfo.h>
#include <uibase/iplugininstaller.h>
#include <uibase/ipluginlist.h>

#include "installerfomod.h"

class QAbstractButton;
Expand Down
5 changes: 2 additions & 3 deletions src/fomodscreenshotdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
*/

#include "fomodscreenshotdialog.h"
#include "ui_fomodscreenshotdialog.h"

#include "scalelabel.h"

#include <QDirIterator>
#include <QFrame>
#include <QProxyStyle>
Expand All @@ -30,6 +27,8 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <QTableWidget>
#include <QWindow>

#include "scalelabel.h"

constexpr int kScreenshotTileWidth = 100;
constexpr int kScreenshotTileHeight = 80;
constexpr int kScreenshotTileSpacing = 16;
Expand Down
50 changes: 0 additions & 50 deletions src/installerFomod.pro

This file was deleted.

Loading
Loading