Skip to content

Commit

Permalink
Add support for building with HEMTT v1.0+ (#1565)
Browse files Browse the repository at this point in the history
Co-authored-by: jonpas <jonpas33@gmail.com>
  • Loading branch information
PabstMirror and jonpas committed Aug 29, 2023
1 parent 6ce801b commit 66264b9
Show file tree
Hide file tree
Showing 45 changed files with 1,078 additions and 738 deletions.
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);
}
15 changes: 15 additions & 0 deletions .hemtt/hooks/pre_build/01_set_version.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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();
let scriptversion_date = date("[year repr:last_two][month][day]");
scriptversion.replace("000000", scriptversion_date);
HEMTT_VFS.join("addons").join("main").join("script_version.hpp").create_file().write(scriptversion);
print("addons/main/script_version.hpp build set to " + scriptversion_date);
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"
16 changes: 8 additions & 8 deletions addons/common/Cfg3DEN.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ class Cfg3DEN {
class Date: Title {
class Controls: Controls {
class ValueYear: ctrlCombo {
onLoad = "\
params ['_ctrlYear'];\
onLoad = QUOTE(\
params [ARR_1('_ctrlYear')];\
for '_y' from 1900 to 2050 do {\
_ctrlYear lbSetValue [_ctrlYear lbAdd str _y, _y];\
_ctrlYear lbSetValue [ARR_2(_ctrlYear lbAdd str _y,_y)];\
};\
_ctrlYear lbSetCurSel 53;\
";
);
};
};
};
Expand All @@ -27,13 +27,13 @@ class Cfg3DEN {
class Init {
class Attributes {
class Callsign {
expression = "\
expression = QUOTE(\
if (isNil 'CBA_fnc_setCallsign') then {\
_this setGroupID [_value];\
_this setGroupID [ARR_1(_value)];\
} else {\
[_this, _value] call CBA_fnc_setCallsign;\
[ARR_2(_this,_value)] call CBA_fnc_setCallsign;\
};\
";
);
};
};
};
Expand Down
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_1("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_1("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_1("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
8 changes: 4 additions & 4 deletions addons/common/test_position.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ _result = _value call CBA_fnc_getPos;
TEST_TRUE(_result isEqualTo EXPECTED,_funcName);

////////////////////////////////////////////////////////////////////////////////////////////////////

#undef EXPECTED
#define EXPECTED [1,2,0] // Pos 3D

_value = EXPECTED;
Expand All @@ -50,7 +50,7 @@ _value set [0,-1];
TEST_TRUE(_result isEqualTo EXPECTED,_funcName);

////////////////////////////////////////////////////////////////////////////////////////////////////

#undef EXPECTED
#define EXPECTED [1,2] // Pos 2D

_value = EXPECTED;
Expand All @@ -62,7 +62,7 @@ _value set [0,-1];
TEST_TRUE(_result isEqualTo EXPECTED,_funcName);

////////////////////////////////////////////////////////////////////////////////////////////////////

#undef EXPECTED
#define EXPECTED [1,1,0] //Pos nearest to [0,0,0]

_value = [[0,0,0], [[10,10,0],[1,1,0], [5,5,0]]];
Expand All @@ -71,7 +71,7 @@ _result = _value call CBA_fnc_getNearest;
TEST_TRUE(_result isEqualTo EXPECTED,_funcName);

////////////////////////////////////////////////////////////////////////////////////////////////////

#undef EXPECTED
#define EXPECTED [[1,1,0], [5,5,0]] //Pos within distance 10

_value = [[0,0,0], [[30,30,0],[1,1,0], [5,5,0]], 10];
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/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LOG(MSG_INIT);
ADDON = false;

#include "XEH_PREP.sqf"
#include "initSettings.sqf";
#include "initSettings.sqf"

[QGVAR(debug), {_this call CBA_fnc_debug}] call CBA_fnc_addEventHandler;

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
#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

0 comments on commit 66264b9

Please sign in to comment.