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

Tools - Cleanup #10444

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 0 additions & 2 deletions .github/workflows/arma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:
steps:
- name: Checkout the source code
uses: actions/checkout@v4
- name: Validate SQF
run: python3 tools/sqf_validator.py
- name: Validate Config
run: python3 tools/config_style_checker.py
- name: Validate Stringtables
Expand Down
62 changes: 1 addition & 61 deletions docs/wiki/development/setting-up-the-development-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,66 +88,6 @@ To start the game using this build, you can use the following modline:

To create a complete build that you can use without the source files, with full binarization and all optimizations, run `$ hemtt release` in the root folder. This will populate the `.hemttout/release` folder with binarized PBOs and an archive in `releases` that you can redistribute. These handle like those of any other mod.


## 4. Setup and Building (Mikero Tools)

### 4.1 Initial Setup

Navigate to `tools` folder in command line.

```
cd "[location of the ACE3 project]\tools"
```

Execute `setup.py` to create symbolic links to P-drive and Arma 3 directory required for building.


Should the script fail, you can create the required links manually. First, create `z` folders both in your Arma 3 directory and on your P-drive. Then run the following commands as admin, replacing the text in brackets with the appropriate paths:

```bat
mklink /J "[Arma 3 installation folder]\z\ace" "[location of the ACE3 project]"
mklink /J "P:\z\ace" "[location of the ACE3 project]"
```

Then, copy the `cba` folder from the `include\x` folder to `P:\x\cba`. Create the `x` folder if needed. That folder contains the parts of the CBA source code that are required for the macros to work.


## 4.2 Creating a Test Build

To create a development build of ACE3 to test changes or to debug something, run the `build.py` file in the `tools` folder. This will populate the `addons` folder with binarized PBOs. These PBOs still point to the source files in their respective folders however, which allows you to use [file patching](#file-patching). This also means that you cannot distribute this build to others.

To start the game using this build, you can use the following modline:

```sh
-mod=@CBA_A3;z\ace
```

## 4.3 Creating a Release Build

To create a complete build of ACE3 that you can use without the source files you will need to:

- Ensure `.hpp` is **NOT** in pboProject's "Exclude From Pbo" list

When the requirements are met:

- Execute `make.py version increment_build <other-increment-args> force checkexternal release` in the `tools` folder, replacing `<other-increment-args>` with the part of version you want to increment (options described below)

This will populate the `release` folder with binarized PBOs, compiled extensions, copied extras, bisigns and a bikey. Additionally, an archive file will also be created in the folder. The folder and archive handle like those of any other mod.

Different `make.py` command line options include:

- `version` - update version number in all files and leave them in working directory (leaving this out will still update the version in all files present in the `release` folder, but they will be reverted to not disturb the working directory)
- `increment_build` - increments _build_ version number
- `increment_patch` - increments _patch_ version number (ignored with `increment_minor` or `increment_major`)
- `increment_minor` - increments _minor_ version number and resets _patch_ version number to `0` (ignored with `increment_major`)
- `increment_major` - increments _major_ version number and resets _minor_ and _patch_ version numbers to `0`
- `force` - force rebuild all PBOs, even those already present in the `release` directory
- `checkexternal` - check external references (incompatible only with `<component1> <component2>` and `force <component1> <component2>`)
- `release` - create release packages/archives
- `<component1> <component2>` - build only specified component(s) (incompatible with `release`)
- `force <component1> <component2>` - force rebuild specified component(s) (incompatible with `release`)


## 7. File Patching

File Patching allows you to change the files in an addon while the game is running, requiring only a restart of the mission. This makes it great for debugging, as it cuts down the time required between tests.
Expand Down Expand Up @@ -187,4 +127,4 @@ Files must exist in the built PBOs for file patching to work. If you create a ne

Configs are not patched during run time, only at load time. You do not have to rebuild a PBO to make config changes, just restart Arma. You can get around this though if you are on the dev branch of Arma 3 and running the [diagnostic exe](https://community.bistudio.com/wiki/Arma_3_Diagnostics_Exe). That includes `diag_mergeConfigFile` which takes a full system path (as in `diag_mergeConfigFile ["p:\z\ace\addons\my_module\config.cpp"]`) and allows you selectively reload config files.

If you need to add/remove files, then you'll need to run HEMTT/`build.py` again without the game running, and restart. That is all that is required to add new files for further use in testing.
If you need to add/remove files, then you'll need to run HEMTT again without the game running, and restart. That is all that is required to add new files for further use in testing.
10 changes: 0 additions & 10 deletions tools/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Validate SQF",
"command": "${config:python.pythonPath}",
"options": {
"cwd": "${workspaceFolder}/tools"
},
"args": [
"sqf_validator.py"
]
},
{
"label": "Validate Config",
"command": "${config:python.pythonPath}",
Expand Down
104 changes: 0 additions & 104 deletions tools/build.py

This file was deleted.

19 changes: 6 additions & 13 deletions tools/config_style_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@
import fnmatch
import os
import re
import ntpath
import sys
import argparse

def check_config_style(filepath):
bad_count_file = 0
def pushClosing(t):
closingStack.append(closing.expr)
closing << Literal( closingFor[t[0]] )

def popClosing():
closing << closingStack.pop()

reIsClass = re.compile(r'^\s*class(.*)')
reIsClassInherit = re.compile(r'^\s*class(.*):')
Expand Down Expand Up @@ -42,7 +35,7 @@ def popClosing():
# We ignore everything inside a string
isInString = False
# Used to store the starting type of a string, so we can match that to the end of a string
inStringType = '';
inStringType = ''

lastIsCurlyBrace = False
checkForSemiColumn = False
Expand Down Expand Up @@ -109,7 +102,7 @@ def popClosing():

else: # Look for the end of our comment block
if (c == '*'):
checkIfNextIsClosingBlock = True;
checkIfNextIsClosingBlock = True
elif (checkIfNextIsClosingBlock):
if (c == '/'):
isInCommentBlock = False
Expand Down Expand Up @@ -163,10 +156,10 @@ def main():
rootDir = folder

for root, dirnames, filenames in os.walk(rootDir + '/' + args.module):
for filename in fnmatch.filter(filenames, '*.cpp'):
sqf_list.append(os.path.join(root, filename))
for filename in fnmatch.filter(filenames, '*.hpp'):
sqf_list.append(os.path.join(root, filename))
for filename in fnmatch.filter(filenames, '*.cpp'):
sqf_list.append(os.path.join(root, filename))
for filename in fnmatch.filter(filenames, '*.hpp'):
sqf_list.append(os.path.join(root, filename))

for filename in sqf_list:
bad_count = bad_count + check_config_style(filename)
Expand Down
131 changes: 0 additions & 131 deletions tools/config_validator.py

This file was deleted.

Loading