Skip to content

Commit 66264b9

Browse files
PabstMirrorjonpas
andauthored
Add support for building with HEMTT v1.0+ (CBATeam#1565)
Co-authored-by: jonpas <[email protected]>
1 parent 6ce801b commit 66264b9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1078
-738
lines changed

.github/workflows/arma.yml

+12-10
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout the source code
14-
uses: actions/checkout@master
14+
uses: actions/checkout@v3
1515
- name: Validate SQF
1616
run: python3 tools/sqf_validator.py
1717
- name: Validate Config
@@ -25,7 +25,7 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: Checkout the source code
28-
uses: actions/checkout@master
28+
uses: actions/checkout@v3
2929
- name: Lint (sqflint)
3030
uses: arma-actions/sqflint@master
3131
continue-on-error: true # No failure due to many false-positives
@@ -34,13 +34,15 @@ jobs:
3434
runs-on: ubuntu-latest
3535
steps:
3636
- name: Checkout the source code
37-
uses: actions/checkout@master
38-
- name: Build using HEMTT
39-
uses: arma-actions/hemtt@master
40-
with:
41-
command: build --release --ci
37+
uses: actions/checkout@v3
38+
- name: Setup HEMTT
39+
uses: arma-actions/hemtt@v1
40+
- name: Run HEMTT build
41+
run: hemtt build
42+
- name: Rename build folder
43+
run: mv .hemttout/build .hemttout/@CBA_A3
4244
- name: Upload Artifact
43-
uses: actions/upload-artifact@v2-preview
45+
uses: actions/upload-artifact@v3
4446
with:
45-
name: CBA_A3-${{ github.sha }}-nobin
46-
path: releases/CBA_A3_*.zip
47+
name: CBA_A3_${{ github.sha }}-nobin
48+
path: .hemttout/@*

.github/workflows/documentation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout the source code
13-
uses: actions/checkout@master
13+
uses: actions/checkout@v3
1414
- name: Install Python packages
1515
run: |
1616
pip3 install wheel

.github/workflows/pboproject.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ jobs:
2727
env:
2828
ARMA3_DATA_URL: ${{ secrets.ARMA3_DATA_URL }}
2929
- name: Checkout CBA A3
30-
uses: actions/checkout@v2
30+
uses: actions/checkout@v3
3131
with:
3232
path: x\cba
3333
persist-credentials: false
3434
- name: Checkout pull request
35-
uses: actions/checkout@v2
35+
uses: actions/checkout@v3
3636
if: ${{ github.event_name == 'pull_request_target' }}
3737
with:
3838
path: pullrequest
@@ -53,13 +53,13 @@ jobs:
5353
env:
5454
PYTHONUNBUFFERED: 1
5555
- name: Archive logs
56-
uses: actions/upload-artifact@v2
56+
uses: actions/upload-artifact@v3
5757
if: ${{ always() }}
5858
with:
5959
name: logs
6060
path: temp/*.log
6161
- name: Archive @cba_a3
62-
uses: actions/upload-artifact@v2
62+
uses: actions/upload-artifact@v3
6363
with:
6464
name: '@cba_a3-${{ github.sha }}'
6565
path: x\cba\release\@cba_a3

.gitignore

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
release/*
22
releases/*
33
keys/*
4+
.hemttout
45
hemtt
56
hemtt.exe
6-
tools/hemtt*.tar.gz*
7-
tools/hemtt*.zip*
8-
.hemtt/local
97
*.cache
108
*.pbo
119
texHeaders.bin
@@ -18,6 +16,7 @@ Thumbs.db
1816
/store/wiki/*
1917
.vscode/*
2018

19+
*.zip
2120
*.7z
2221

2322
/addons/CBA_Project.sublime-workspace
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
let releases = HEMTT_RFS.join("releases");
2+
3+
let src = releases.join(HEMTT.project().prefix() + "-" + HEMTT.project().version().to_string() + ".zip");
4+
let dst = releases.join(HEMTT.project().name() + "_v" + HEMTT.project().version().to_string_short() + ".zip");
5+
6+
print("Moving zip to " + dst);
7+
if !src.move(dst) {
8+
fatal("Failed to move " + src + " to " + dst);
9+
}
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
let modcpp = HEMTT_VFS.join("mod.cpp").open_file().read();
2+
modcpp.replace("0.0.0", HEMTT.project().version().to_string_short());
3+
HEMTT_VFS.join("mod.cpp").create_file().write(modcpp);
4+
print("mod.cpp version set");
5+
6+
let cfgmodshpp = HEMTT_VFS.join("addons").join("main_a3").join("CfgMods.hpp").open_file().read();
7+
cfgmodshpp.replace("0.0.0", HEMTT.project().version().to_string_short());
8+
HEMTT_VFS.join("addons").join("main_a3").join("CfgMods.hpp").create_file().write(cfgmodshpp);
9+
print("addons/main_a3/CfgMods.hpp version set");
10+
11+
let scriptversion = HEMTT_VFS.join("addons").join("main").join("script_version.hpp").open_file().read();
12+
let scriptversion_date = date("[year repr:last_two][month][day]");
13+
scriptversion.replace("000000", scriptversion_date);
14+
HEMTT_VFS.join("addons").join("main").join("script_version.hpp").create_file().write(scriptversion);
15+
print("addons/main/script_version.hpp build set to " + scriptversion_date);

.hemtt/project.toml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name = "CBA_A3"
2+
prefix = "cba"
3+
author = "CBATeam"
4+
5+
[files]
6+
include = [
7+
"mod.cpp",
8+
"README.md",
9+
"LICENSE.md",
10+
"logo_cba_ca.paa",
11+
"meta.cpp",
12+
"userconfig/**",
13+
]
14+
15+
[version]
16+
git_hash = 0
17+
18+
[asc]
19+
enabled = true
20+
exclude = [
21+
"/initsettings.sqf",
22+
"/initkeybinds.sqf",
23+
"/xeh_prep.sqf",
24+
"/backwards_comp.sqf",
25+
"settings/gui_createcategory.sqf",
26+
"diagnostic/fnc_isdebugconsoleallowed.sqf",
27+
"xeh/fnc_initdisplay.sqf",
28+
"xeh/fnc_startloadingscreen.sqf",
29+
"xeh/fnc_endloadingscreen.sqf",
30+
]
31+
32+
[hemtt.config]
33+
preset = "Hemtt"
34+
35+
[hemtt.release]
36+
folder = "CBA_A3"

addons/common/Cfg3DEN.hpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ class Cfg3DEN {
1010
class Date: Title {
1111
class Controls: Controls {
1212
class ValueYear: ctrlCombo {
13-
onLoad = "\
14-
params ['_ctrlYear'];\
13+
onLoad = QUOTE(\
14+
params [ARR_1('_ctrlYear')];\
1515
for '_y' from 1900 to 2050 do {\
16-
_ctrlYear lbSetValue [_ctrlYear lbAdd str _y, _y];\
16+
_ctrlYear lbSetValue [ARR_2(_ctrlYear lbAdd str _y,_y)];\
1717
};\
1818
_ctrlYear lbSetCurSel 53;\
19-
";
19+
);
2020
};
2121
};
2222
};
@@ -27,13 +27,13 @@ class Cfg3DEN {
2727
class Init {
2828
class Attributes {
2929
class Callsign {
30-
expression = "\
30+
expression = QUOTE(\
3131
if (isNil 'CBA_fnc_setCallsign') then {\
32-
_this setGroupID [_value];\
32+
_this setGroupID [ARR_1(_value)];\
3333
} else {\
34-
[_this, _value] call CBA_fnc_setCallsign;\
34+
[ARR_2(_this,_value)] call CBA_fnc_setCallsign;\
3535
};\
36-
";
36+
);
3737
};
3838
};
3939
};

addons/common/fnc_switchPlayer.sqf

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ _dummyUnit = (_ar select 4) createUnit [_type, [0, 0, 0], [], 0, "NONE"]; // Joi
4343
if (isNull _dummyUnit) exitWith { hint "Sorry, something went wrong, dummyUnit is null" };
4444
[_oldUnit] join _dummyGroup;
4545

46-
LOG_1("1.Dummy created, State saved and put oldUnit in new group: %1", _dummyGroup);
46+
LOG_1("1.Dummy created, State saved and put oldUnit in new group: %1",_dummyGroup);
4747

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

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

52-
LOG_1("2.New unit created, local: %1", local _newUnit);
52+
LOG_1("2.New unit created, local: %1",local _newUnit);
5353
sleep 1;
5454

5555
addSwitchableUnit _newUnit;
@@ -58,7 +58,7 @@ selectPlayer _newUnit;
5858
_newUnit setRank (_ar select 2);
5959
_newUnit addScore (_ar select 3);
6060

61-
LOG_1("3.State transfered, switched player control to new unit, local: %1", local _newUnit);
61+
LOG_1("3.State transfered, switched player control to new unit, local: %1",local _newUnit);
6262
sleep 1;
6363
if (_ar select 7 != "") then
6464
{

addons/common/test_position.sqf

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ _result = _value call CBA_fnc_getPos;
3838
TEST_TRUE(_result isEqualTo EXPECTED,_funcName);
3939

4040
////////////////////////////////////////////////////////////////////////////////////////////////////
41-
41+
#undef EXPECTED
4242
#define EXPECTED [1,2,0] // Pos 3D
4343

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

5252
////////////////////////////////////////////////////////////////////////////////////////////////////
53-
53+
#undef EXPECTED
5454
#define EXPECTED [1,2] // Pos 2D
5555

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

6464
////////////////////////////////////////////////////////////////////////////////////////////////////
65-
65+
#undef EXPECTED
6666
#define EXPECTED [1,1,0] //Pos nearest to [0,0,0]
6767

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

7373
////////////////////////////////////////////////////////////////////////////////////////////////////
74-
74+
#undef EXPECTED
7575
#define EXPECTED [[1,1,0], [5,5,0]] //Pos within distance 10
7676

7777
_value = [[0,0,0], [[30,30,0],[1,1,0], [5,5,0]], 10];

addons/diagnostic/CfgDisplay3DEN.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ class Display3DEN {
55
class MenuStrip: ctrlMenuStrip {
66
class Items {
77
class DebugConsole {
8-
shortcuts[] = {INPUT_CTRL_OFFSET + DIK_D};
8+
shortcuts[] = {QUOTE(INPUT_CTRL_OFFSET + DIK_D)};
99
};
1010
class FunctionsViewer {
11-
shortcuts[] = {INPUT_ALT_OFFSET + DIK_F};
11+
shortcuts[] = {QUOTE(INPUT_ALT_OFFSET + DIK_F)};
1212
};
1313
class ConfigViewer {
14-
shortcuts[] = {INPUT_ALT_OFFSET + DIK_G};
14+
shortcuts[] = {QUOTE(INPUT_ALT_OFFSET + DIK_G)};
1515
};
1616
};
1717
};

addons/diagnostic/CfgFunctions.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class CfgFunctions {
1919
class A3 {
2020
class Debug {
2121
class isDebugConsoleAllowed {
22-
file = PATHTOF(fnc_isDebugConsoleAllowed.sqf);
22+
file = QPATHTOF(fnc_isDebugConsoleAllowed.sqf);
2323
};
2424
};
2525
};

addons/diagnostic/XEH_preInit.sqf

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LOG(MSG_INIT);
66
ADDON = false;
77

88
#include "XEH_PREP.sqf"
9-
#include "initSettings.sqf";
9+
#include "initSettings.sqf"
1010

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

addons/diagnostic/fnc_isDebugConsoleAllowed.sqf

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ if (str missionConfigFile == "A3\Missions_F_Bootcamp\Scenarios\Arsenal.VR\descri
55
if (!isMultiplayer && {getNumber (missionConfigFile >> "enableDebugConsoleSP") == 1}) exitWith {true};
66

77
call {
8-
#include "\a3\functions_f\Debug\fn_isDebugConsoleAllowed.sqf";
8+
#include "\a3\functions_f\debug\fn_isDebugConsoleAllowed.sqf"
99
};

addons/diagnostic/gui.hpp

+15-15
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ class RscTitles {
1313
onLoad = QUOTE(uiNamespace setVariable [ARR_2('GVAR(Error)',_this select 0)]);
1414
idc = -1;
1515
font = "RobotoCondensedBold";
16-
sizeEx = 0.55 * GUI_GRID_CENTER_H;
17-
x = 0 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X;
18-
y = 5 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y;
19-
w = 40 * GUI_GRID_CENTER_W;
20-
h = 10 * GUI_GRID_CENTER_H;
16+
sizeEx = QUOTE(0.55 * GUI_GRID_CENTER_H);
17+
x = QUOTE( 0 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X);
18+
y = QUOTE( 5 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y);
19+
w = QUOTE(40 * GUI_GRID_CENTER_W);
20+
h = QUOTE(10 * GUI_GRID_CENTER_H);
2121
colorBackground[] = {1,0.2,0,0.8};
2222
};
2323
};
@@ -29,22 +29,22 @@ class GVAR(watchInput): RscEdit {
2929
autocomplete = "scripting";
3030
shadow = 0;
3131
font = "EtelkaMonospacePro";
32-
x = 0.5 * GUI_GRID_W;
33-
y = 11 * GUI_GRID_H;
34-
w = 21 * GUI_GRID_W;
35-
h = 1 * GUI_GRID_H;
36-
sizeEx = 0.7 * GUI_GRID_H;
32+
x = QUOTE(0.5 * GUI_GRID_W);
33+
y = QUOTE(11 * GUI_GRID_H);
34+
w = QUOTE(21 * GUI_GRID_W);
35+
h = QUOTE(1 * GUI_GRID_H);
36+
sizeEx = QUOTE(0.7 * GUI_GRID_H);
3737
};
3838

3939
class GVAR(watchOutput): RscEdit {
4040
lineSpacing = 1;
4141
style = ST_NO_RECT;
4242
shadow = 0;
4343
font = "EtelkaMonospacePro";
44-
x = 0.5 * GUI_GRID_W;
45-
y = 12 * GUI_GRID_H;
46-
w = 21 * GUI_GRID_W;
47-
h = 1 * GUI_GRID_H;
44+
x = QUOTE(0.5 * GUI_GRID_W);
45+
y = QUOTE(12 * GUI_GRID_H);
46+
w = QUOTE(21 * GUI_GRID_W);
47+
h = QUOTE(1 * GUI_GRID_H);
4848
colorBackground[] = {0,0,0,0.75};
49-
sizeEx = 0.7 * GUI_GRID_H;
49+
sizeEx = QUOTE(0.7 * GUI_GRID_H);
5050
};

addons/jr/config.cpp

-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
#include "script_component.hpp"
22

3-
#define private 0 // hidden
4-
#define protected 1 // hidden but usable
5-
#define public 2 // visible
6-
7-
#define ReadAndWrite 0 //! any modifications enabled
8-
#define ReadAndCreate 1 //! only adding new class members is allowed
9-
#define ReadOnly 2 //! no modifications enabled
10-
#define ReadOnlyVerified 3 //! no modifications enabled, CRC test applied
11-
123
class CfgPatches {
134
class ADDON {
145
name = CSTRING(component);

addons/jr/jr_classes.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//ASDG prefixed original classes preserved to ensure compatibility
22

33
class asdg_SlotInfo { // Base class
4-
scope = private;
4+
scope = 0;
55
linkProxy = "defaultProxy";
66
iconPosition[] = {0.0, 0.0};
77
iconScale = 0.0;

0 commit comments

Comments
 (0)