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

Add support for building with HEMTT v1.0+ #1565

Merged
merged 25 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e06658f
Hemmit Config Compat
PabstMirror Jan 15, 2023
57b87c4
fix
PabstMirror Jan 15, 2023
3d6a89c
Create fn_isdebugconsoleallowed.sqf
PabstMirror Jan 20, 2023
4213ffe
test
PabstMirror Jan 20, 2023
b972868
asc:exclude - use forward slashes
PabstMirror Jan 20, 2023
f10a937
undo assert changes
PabstMirror Jan 20, 2023
aab30f0
Merge branch 'master' into hemmit10test
jonpas May 16, 2023
12f0672
Adapt to HEMTT v1
jonpas May 16, 2023
d72d8ac
Set version in CfgMods.hpp and build in script_version.hpp in HEMTT hook
jonpas May 16, 2023
3bc46af
Add missing includes, Fix script_version build set, Update HEMTT config
jonpas May 16, 2023
e964c35
Reenable ASC
jonpas May 16, 2023
57622af
Fix LOG macros
jonpas May 16, 2023
d2a10fb
JR - Remove private/protected/public/Read defines
jonpas May 16, 2023
6736af6
Adapt flexiMenu to HEMTT v1
jonpas May 16, 2023
051812b
Set build to date in HEMTT hook
jonpas May 20, 2023
1cc0a4c
Merge branch 'master' into hemmit10test
jonpas Jun 26, 2023
88bce47
Fix multi-line config quote issues
jonpas Jun 26, 2023
5dff99b
Keep old hemtt.toml for backward compatibility
PabstMirror Jun 26, 2023
571e197
fix semi-colon usage after #include
PabstMirror Jul 27, 2023
0cb477b
Merge branch 'master' into hemmit10test
PabstMirror Jul 27, 2023
afbf9d8
hemtt 1.8 RC2 math update
PabstMirror Jul 30, 2023
aa21617
Merge branch 'master' into hemmit10test
PabstMirror Aug 17, 2023
7b3bb3f
Update test_position.sqf
PabstMirror Aug 17, 2023
3e2852b
Create settings.json
PabstMirror Aug 17, 2023
f52a33a
update includes for 2.12
PabstMirror Aug 17, 2023
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
22 changes: 12 additions & 10 deletions .github/workflows/arma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@master
uses: actions/checkout@v3
- name: Validate SQF
run: python3 tools/sqf_validator.py
- name: Validate Config
Expand All @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@master
uses: actions/checkout@v3
- name: Lint (sqflint)
uses: arma-actions/sqflint@master
continue-on-error: true # No failure due to many false-positives
Expand All @@ -34,13 +34,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@master
- name: Build using HEMTT
uses: arma-actions/hemtt@master
with:
command: build --release --ci
uses: actions/checkout@v3
- name: Setup HEMTT
uses: arma-actions/hemtt@v1
- name: Run HEMTT build
run: hemtt build
- name: Rename build folder
run: mv .hemttout/build .hemttout/@CBA_A3
- name: Upload Artifact
uses: actions/upload-artifact@v2-preview
uses: actions/upload-artifact@v3
with:
name: CBA_A3-${{ github.sha }}-nobin
path: releases/CBA_A3_*.zip
name: CBA_A3_${{ github.sha }}-nobin
path: .hemttout/@*
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@master
uses: actions/checkout@v3
- name: Install Python packages
run: |
pip3 install wheel
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pboproject.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ jobs:
env:
ARMA3_DATA_URL: ${{ secrets.ARMA3_DATA_URL }}
- name: Checkout CBA A3
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: x\cba
persist-credentials: false
- name: Checkout pull request
uses: actions/checkout@v2
uses: actions/checkout@v3
if: ${{ github.event_name == 'pull_request_target' }}
with:
path: pullrequest
Expand All @@ -53,13 +53,13 @@ jobs:
env:
PYTHONUNBUFFERED: 1
- name: Archive logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: logs
path: temp/*.log
- name: Archive @cba_a3
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: '@cba_a3-${{ github.sha }}'
path: x\cba\release\@cba_a3
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
release/*
releases/*
keys/*
.hemttout
hemtt
hemtt.exe
tools/hemtt*.tar.gz*
tools/hemtt*.zip*
.hemtt/local
*.cache
*.pbo
texHeaders.bin
Expand All @@ -18,6 +16,7 @@ Thumbs.db
/store/wiki/*
.vscode/*

*.zip
*.7z

/addons/CBA_Project.sublime-workspace
Expand Down
9 changes: 9 additions & 0 deletions .hemtt/hooks/post_release/01_rename_zip.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
let releases = HEMTT_RFS.join("releases");

let src = releases.join(HEMTT.project().prefix() + "-" + HEMTT.project().version().to_string() + ".zip");
let dst = releases.join(HEMTT.project().name() + "_v" + HEMTT.project().version().to_string_short() + ".zip");

print("Moving zip to " + dst);
if !src.move(dst) {
fatal("Failed to move " + src + " to " + dst);
}
14 changes: 14 additions & 0 deletions .hemtt/hooks/pre_build/01_set_version.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
let modcpp = HEMTT_VFS.join("mod.cpp").open_file().read();
modcpp.replace("0.0.0", HEMTT.project().version().to_string_short());
HEMTT_VFS.join("mod.cpp").create_file().write(modcpp);
print("mod.cpp version set");

let cfgmodshpp = HEMTT_VFS.join("addons").join("main_a3").join("CfgMods.hpp").open_file().read();
cfgmodshpp.replace("0.0.0", HEMTT.project().version().to_string_short());
HEMTT_VFS.join("addons").join("main_a3").join("CfgMods.hpp").create_file().write(cfgmodshpp);
print("addons/main_a3/CfgMods.hpp version set");

let scriptversion = HEMTT_VFS.join("addons").join("main").join("script_version.hpp").open_file().read();
scriptversion.replace("000000", HEMTT.project().version().build().to_string()); // TODO date %y%m%d (eg. 220912)
HEMTT_VFS.join("addons").join("main").join("script_version.hpp").create_file().write(scriptversion);
print("addons/main/script_version.hpp build set");
36 changes: 36 additions & 0 deletions .hemtt/project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name = "CBA_A3"
prefix = "cba"
author = "CBATeam"

[files]
include = [
"mod.cpp",
"README.md",
"LICENSE.md",
"logo_cba_ca.paa",
"meta.cpp",
"userconfig/**",
]

[version]
git_hash = 0

[asc]
enabled = true
exclude = [
"/initsettings.sqf",
"/initkeybinds.sqf",
"/xeh_prep.sqf",
"/backwards_comp.sqf",
"settings/gui_createcategory.sqf",
"diagnostic/fnc_isdebugconsoleallowed.sqf",
"xeh/fnc_initdisplay.sqf",
"xeh/fnc_startloadingscreen.sqf",
"xeh/fnc_endloadingscreen.sqf",
]

[hemtt.config]
preset = "Hemtt"

[hemtt.release]
folder = "CBA_A3"
6 changes: 3 additions & 3 deletions addons/common/fnc_switchPlayer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ _dummyUnit = (_ar select 4) createUnit [_type, [0, 0, 0], [], 0, "NONE"]; // Joi
if (isNull _dummyUnit) exitWith { hint "Sorry, something went wrong, dummyUnit is null" };
[_oldUnit] join _dummyGroup;

LOG(format["1.Dummy created, State saved and put oldUnit in new group: %1", _dummyGroup]);
LOG_1("1.Dummy created, State saved and put oldUnit in new group: %1",_dummyGroup);

private _newUnit = _dummyGroup createUnit [_type, _ar select 5, [], 0, "NONE"];

if (isNull _newUnit) exitWith { hint "Sorry, something went wrong, newUnit is null" };

LOG(format["2.New unit created, local: %1", local _newUnit]);
LOG_1("2.New unit created, local: %1",local _newUnit);
sleep 1;

addSwitchableUnit _newUnit;
Expand All @@ -58,7 +58,7 @@ selectPlayer _newUnit;
_newUnit setRank (_ar select 2);
_newUnit addScore (_ar select 3);

LOG(format["3.State transfered, switched player control to new unit, local: %1", local _newUnit]);
LOG_1("3.State transfered, switched player control to new unit, local: %1",local _newUnit);
sleep 1;
if (_ar select 7 != "") then
{
Expand Down
6 changes: 3 additions & 3 deletions addons/diagnostic/CfgDisplay3DEN.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ class Display3DEN {
class MenuStrip: ctrlMenuStrip {
class Items {
class DebugConsole {
shortcuts[] = {INPUT_CTRL_OFFSET + DIK_D};
shortcuts[] = {QUOTE(INPUT_CTRL_OFFSET + DIK_D)};
};
class FunctionsViewer {
shortcuts[] = {INPUT_ALT_OFFSET + DIK_F};
shortcuts[] = {QUOTE(INPUT_ALT_OFFSET + DIK_F)};
};
class ConfigViewer {
shortcuts[] = {INPUT_ALT_OFFSET + DIK_G};
shortcuts[] = {QUOTE(INPUT_ALT_OFFSET + DIK_G)};
};
};
};
Expand Down
2 changes: 1 addition & 1 deletion addons/diagnostic/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CfgFunctions {
class A3 {
class Debug {
class isDebugConsoleAllowed {
file = PATHTOF(fnc_isDebugConsoleAllowed.sqf);
file = QPATHTOF(fnc_isDebugConsoleAllowed.sqf);
};
};
};
Expand Down
2 changes: 1 addition & 1 deletion addons/diagnostic/fnc_isDebugConsoleAllowed.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ if (str missionConfigFile == "A3\Missions_F_Bootcamp\Scenarios\Arsenal.VR\descri
if (!isMultiplayer && {getNumber (missionConfigFile >> "enableDebugConsoleSP") == 1}) exitWith {true};

call {
#include "\a3\functions_f\Debug\fn_isDebugConsoleAllowed.sqf";
#include "\a3\functions_f\debug\fn_isDebugConsoleAllowed.sqf";
};
30 changes: 15 additions & 15 deletions addons/diagnostic/gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ class RscTitles {
onLoad = QUOTE(uiNamespace setVariable [ARR_2('GVAR(Error)',_this select 0)]);
idc = -1;
font = "RobotoCondensedBold";
sizeEx = 0.55 * GUI_GRID_CENTER_H;
x = 0 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X;
y = 5 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y;
w = 40 * GUI_GRID_CENTER_W;
h = 10 * GUI_GRID_CENTER_H;
sizeEx = QUOTE(0.55 * GUI_GRID_CENTER_H);
x = QUOTE( 0 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X);
y = QUOTE( 5 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y);
w = QUOTE(40 * GUI_GRID_CENTER_W);
h = QUOTE(10 * GUI_GRID_CENTER_H);
colorBackground[] = {1,0.2,0,0.8};
};
};
Expand All @@ -29,22 +29,22 @@ class GVAR(watchInput): RscEdit {
autocomplete = "scripting";
shadow = 0;
font = "EtelkaMonospacePro";
x = 0.5 * GUI_GRID_W;
y = 11 * GUI_GRID_H;
w = 21 * GUI_GRID_W;
h = 1 * GUI_GRID_H;
sizeEx = 0.7 * GUI_GRID_H;
x = QUOTE(0.5 * GUI_GRID_W);
y = QUOTE(11 * GUI_GRID_H);
w = QUOTE(21 * GUI_GRID_W);
h = QUOTE(1 * GUI_GRID_H);
sizeEx = QUOTE(0.7 * GUI_GRID_H);
};

class GVAR(watchOutput): RscEdit {
lineSpacing = 1;
style = ST_NO_RECT;
shadow = 0;
font = "EtelkaMonospacePro";
x = 0.5 * GUI_GRID_W;
y = 12 * GUI_GRID_H;
w = 21 * GUI_GRID_W;
h = 1 * GUI_GRID_H;
x = QUOTE(0.5 * GUI_GRID_W);
y = QUOTE(12 * GUI_GRID_H);
w = QUOTE(21 * GUI_GRID_W);
h = QUOTE(1 * GUI_GRID_H);
colorBackground[] = {0,0,0,0.75};
sizeEx = 0.7 * GUI_GRID_H;
sizeEx = QUOTE(0.7 * GUI_GRID_H);
};
9 changes: 0 additions & 9 deletions addons/jr/config.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
#include "script_component.hpp"

#define private 0 // hidden
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the only one used in one place, I removed those defines, should be fine?

#define protected 1 // hidden but usable
#define public 2 // visible

#define ReadAndWrite 0 //! any modifications enabled
#define ReadAndCreate 1 //! only adding new class members is allowed
#define ReadOnly 2 //! no modifications enabled
#define ReadOnlyVerified 3 //! no modifications enabled, CRC test applied

class CfgPatches {
class ADDON {
name = CSTRING(component);
Expand Down
2 changes: 1 addition & 1 deletion addons/jr/jr_classes.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//ASDG prefixed original classes preserved to ensure compatibility

class asdg_SlotInfo { // Base class
scope = private;
scope = 0;
linkProxy = "defaultProxy";
iconPosition[] = {0.0, 0.0};
iconScale = 0.0;
Expand Down
Loading