KP-Liberation/_tools
SongWei 3bb6921710 changes 2020-03-22 02:27:25 +11:00
..
src Add mapDisplay property to build tool config 2019-07-24 14:38:29 +02:00
.gitignore Re-add package-lock.json 2019-05-08 17:58:52 +01:00
README.md Initial implementation of Gulp based mission builder 2018-02-16 18:47:23 +01:00
_presets.json changes 2020-03-22 02:27:25 +11:00
gulpfile.ts Set mission title depending on currently built mission 2019-07-24 14:38:29 +02:00
package-lock.json Add gulp-modify-file, update dependencies 2019-07-24 14:38:29 +02:00
package.json Switch CI to GitHub Actions from Circle-CI 2019-09-17 19:08:46 +02:00
tsconfig.json Initial implementation of Gulp based mission builder 2018-02-16 18:47:23 +01:00

README.md

KP Liberation builder

Requirements

nodejs version >=7.

Usage

# Install dependencies
npm install

# Run mission build
npm run build


# Run task with local gulp via npx
npx gulp <task_name>

# With gulp-cli and gulp 4 installed globally
gulp <task_name>

Task Desc
clean removes build/ dir
build assembles missionfolder and sets config values
pbo packs missionfolders into PBOs
zip creates release ZIPs
default runs build, pbo and zip

Build files will be outputted to build/ dir.

Configuration

presets.json

This file should contain an JSON array of Presets, for every preset one mission file will be built.

Every Preset entry should have following structure:

{
    // Source folder with mission.sqm, relative to <missionsFolder>
    // If mission.sqm is in root of <missionsFolder> should be set to empty string
    "sourceFolder": "kp_liberation.Altis", 

    // Name and map is used to build output directory: <missionName>.<map>
    // Name different than source allows to build multiple version of mission on same map
    // Combination of <missionName> and <map> should be unique for every preset
    "missionName": "kp_liberation",
    "map": "Altis",

    // Keys of <variables> object represent variables in <configFile>.
    // These variables values will be set to corresponding value in <variables>
    "configFile": "kp_liberation_config.sqf",
    "variables": {
        "KP_liberation_preset_blufor": 0,
        "KP_liberation_preset_opfor": 0,
        "KP_liberation_preset_resistance": 0,
        "KP_liberation_preset_civilians": 0,
        "KP_liberation_arsenal": 0
    }
}

gulpfile.ts

paths variable in gulpfile holds filesystem paths required to build missions.

/** 
 * Mission folders configuration
*/
const paths: FolderStructureInfo = {
    // Folder with mission scripts
    frameworkFolder: resolve('..', 'Missionframework'),

    // Folder with base mission.sqm folders
    missionsFolder: resolve('..', 'Missionbasefiles'),

    // Output directory
    workDir: resolve("./build")
};