commit
766dfb17d9
52
README.md
52
README.md
@ -11,7 +11,14 @@
|
|||||||
- Easily switch between different projects.
|
- Easily switch between different projects.
|
||||||
|
|
||||||
# Requirements
|
# Requirements
|
||||||
- [git-bash](https://git-scm.com/download/win)
|
- [Killing Floor 2](https://store.steampowered.com/app/232090/Killing_Floor_2/);
|
||||||
|
- Killing Floor 2 - SDK;
|
||||||
|
- [git-bash](https://git-scm.com/download/win).
|
||||||
|
|
||||||
|
# Limits
|
||||||
|
You can keep mod sources anywhere, but `Killing Floor 2` and `Killing Floor 2 - SDK` must be installed on the system drive (C:\ in most cases).
|
||||||
|
|
||||||
|
(I plan to fix this limitation in the future)
|
||||||
|
|
||||||
# Add to your project
|
# Add to your project
|
||||||
Make sure that the location of folders and files in your project as follows (Correct it if it's not):
|
Make sure that the location of folders and files in your project as follows (Correct it if it's not):
|
||||||
@ -54,21 +61,13 @@ If your project contains several mutators, *.upk files, external dependencies, o
|
|||||||
When you run compilation for the first time or do `./tools/builder --init` `builder.cfg` appears in your project folder.
|
When you run compilation for the first time or do `./tools/builder --init` `builder.cfg` appears in your project folder.
|
||||||
Edit it to set build/test/upload options. The config contains the necessary comments inside.
|
Edit it to set build/test/upload options. The config contains the necessary comments inside.
|
||||||
|
|
||||||
Edit the files in the PublicationContent folder - they are responsible for the description in the Steam Workshop.
|
Edit the files in the `PublicationContent` folder - they are responsible for the description in the Steam Workshop.
|
||||||
|
|
||||||
## Project filesystem
|
## Project filesystem
|
||||||
If you have *.upk or localization files, they must be in a specific location.
|
If you have *.upk or localization files, they must be in a specific location.
|
||||||
|
|
||||||
Change the filesystem of the project to such a form that everything works correctly:
|
Change the filesystem of the project to such a form that everything works correctly:
|
||||||
```
|
```
|
||||||
/Localization
|
|
||||||
/INT
|
|
||||||
*.int
|
|
||||||
/PublicationContent
|
|
||||||
preview.png
|
|
||||||
description.txt
|
|
||||||
tags.txt
|
|
||||||
title.txt
|
|
||||||
/SomePackageName1
|
/SomePackageName1
|
||||||
*.upk
|
*.upk
|
||||||
/Classes
|
/Classes
|
||||||
@ -79,17 +78,44 @@ Change the filesystem of the project to such a form that everything works correc
|
|||||||
/Classes
|
/Classes
|
||||||
*.uc
|
*.uc
|
||||||
*.upkg
|
*.upkg
|
||||||
|
/PublicationContent
|
||||||
|
preview.png
|
||||||
|
description.txt
|
||||||
|
tags.txt
|
||||||
|
title.txt
|
||||||
|
/Localization
|
||||||
|
/INT
|
||||||
|
*.int
|
||||||
/Config
|
/Config
|
||||||
*.ini
|
*.ini
|
||||||
|
/BrewedPC
|
||||||
|
*.*
|
||||||
/tools
|
/tools
|
||||||
builder
|
builder
|
||||||
builder.cfg
|
builder.cfg
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Note:** Use the `BrewedPC` folder for additional content such as sound files for your weapons or other stuff. This will be copied to the final BrewedPC before being uploaded to the workshop.
|
||||||
|
By the way, this allows you to use a script to upload maps (although this was not its original purpose). Just put the map(s) in `BrewedPC` (don't forget to edit the `PublicationContent`) and run `./tools/builder -u`.
|
||||||
|
|
||||||
## Examples (Projects that use KF2-BuildTools)
|
## Examples (Projects that use KF2-BuildTools)
|
||||||
[LightTIM](https://github.com/GenZmeY/KF2-LightTIM) - simplest case (one mutator)
|
**Simplest case (one mutator):**
|
||||||
[ServerExt](https://github.com/GenZmeY/KF2-Server-Extension) - Two mutators are compiled, there are *.upk files and localization
|
- [AdminAutoLogin](https://github.com/GenZmeY/KF2-AdminAutoLogin)
|
||||||
[UnofficialMod](https://github.com/GenZmeY/UnofficialMod) - Three mutators are compiled (one of them is a dependency), two mutators are uploaded to the steam workshop
|
- [StartWave](https://github.com/GenZmeY/KF2-StartWave)
|
||||||
|
- [TAWOD](https://github.com/GenZmeY/KF2-TAWOD)
|
||||||
|
- [ZedSpawner](https://github.com/GenZmeY/KF2-ZedSpawner)
|
||||||
|
|
||||||
|
**Mutator + Localization:**
|
||||||
|
- [ControlledVoteCollector](https://github.com/GenZmeY/KF2-ControlledVoteCollector)
|
||||||
|
- [CustomTraderInventory](https://github.com/GenZmeY/KF2-CustomTraderInventory)
|
||||||
|
- [YetAnotherScoreboard](https://github.com/GenZmeY/KF2-YetAnotherScoreboard)
|
||||||
|
|
||||||
|
**Two mutators are compiled, there are upk and localization:**
|
||||||
|
- [ServerExt](https://github.com/GenZmeY/KF2-Server-Extension)
|
||||||
|
|
||||||
|
**Three mutators are compiled (one of them is a dependency),**
|
||||||
|
**two mutators are uploaded to the steam workshop:**
|
||||||
|
- [UnofficialMod](https://github.com/GenZmeY/UnofficialMod)
|
||||||
|
|
||||||
# Other
|
# Other
|
||||||
[TODO List](TODO.md)
|
[TODO List](TODO.md)
|
||||||
|
3
TODO.md
3
TODO.md
@ -1,8 +1,5 @@
|
|||||||
# TODO:
|
# TODO:
|
||||||
- [ ] *.upk (or *.kfm) with it's own filesystem (like in weapon packs)
|
|
||||||
- [ ] add kf2 support in another steam library (`Steam\steamapps\libraryfolders.vdf` may help)
|
- [ ] add kf2 support in another steam library (`Steam\steamapps\libraryfolders.vdf` may help)
|
||||||
- [x] close the KFEditor window only after it stops writing to Launch.log to be able to show warnings
|
|
||||||
- [ ] hooks (precompile, postcompile, prebrew, etc...)
|
- [ ] hooks (precompile, postcompile, prebrew, etc...)
|
||||||
- [ ] improve error parser (class vs name mismatch, etc...)
|
- [ ] improve error parser (class vs name mismatch, etc...)
|
||||||
- [ ] manual brew config setting
|
|
||||||
- [ ] server testing
|
- [ ] server testing
|
||||||
|
3
USAGE.md
3
USAGE.md
@ -11,7 +11,6 @@ Available options:
|
|||||||
-i, --init generate builder.cfg and PublicationContent
|
-i, --init generate builder.cfg and PublicationContent
|
||||||
-c, --compile compile package(s)
|
-c, --compile compile package(s)
|
||||||
-b, --brew compress *.upk and place inside *.u
|
-b, --brew compress *.upk and place inside *.u
|
||||||
-bm, --brew-manual the same (almost) as above, but with patched kfeditor by @notpeelz
|
|
||||||
-u, --upload upload package(s) to the Steam Workshop
|
-u, --upload upload package(s) to the Steam Workshop
|
||||||
-t, --test run local single player test
|
-t, --test run local single player test
|
||||||
-f, --force overwrites existing files when used with --init
|
-f, --force overwrites existing files when used with --init
|
||||||
@ -23,8 +22,8 @@ Available options:
|
|||||||
-h, --help show this help
|
-h, --help show this help
|
||||||
|
|
||||||
Short options can be combined, examples:
|
Short options can be combined, examples:
|
||||||
|
-if recreate build.cfg and PublicationContent, replace old ones
|
||||||
-cbu compile, brew, upload
|
-cbu compile, brew, upload
|
||||||
-cbmt compile, brew_manual, run_test
|
|
||||||
-cbhe compile and brew without closing kf2editor
|
-cbhe compile and brew without closing kf2editor
|
||||||
etc...
|
etc...
|
||||||
```
|
```
|
||||||
|
222
builder
222
builder
@ -64,6 +64,7 @@ KFLogs="$KFDoc/KFGame/Logs"
|
|||||||
MutSource="$(readlink -e "$ScriptDir/..")"
|
MutSource="$(readlink -e "$ScriptDir/..")"
|
||||||
MutConfig="$MutSource/Config"
|
MutConfig="$MutSource/Config"
|
||||||
MutLocalization="$MutSource/Localization"
|
MutLocalization="$MutSource/Localization"
|
||||||
|
MutBrewedPCAddon="$MutSource/BrewedPC"
|
||||||
MutBuilderConfig="$MutSource/builder.cfg"
|
MutBuilderConfig="$MutSource/builder.cfg"
|
||||||
MutPubContent="$MutSource/PublicationContent"
|
MutPubContent="$MutSource/PublicationContent"
|
||||||
MutPubContentDescription="$MutPubContent/description.txt"
|
MutPubContentDescription="$MutPubContent/description.txt"
|
||||||
@ -91,7 +92,6 @@ KFEditorConfBackup="$KFEditorConf.backup"
|
|||||||
ArgInit="false"
|
ArgInit="false"
|
||||||
ArgCompile="false"
|
ArgCompile="false"
|
||||||
ArgBrew="false"
|
ArgBrew="false"
|
||||||
ArgBrewManual="false"
|
|
||||||
ArgUpload="false"
|
ArgUpload="false"
|
||||||
ArgTest="false"
|
ArgTest="false"
|
||||||
ArgVersion="false"
|
ArgVersion="false"
|
||||||
@ -204,7 +204,6 @@ ${BLD}Available options:${DEF}
|
|||||||
-i, --init generate $(basename "$MutBuilderConfig") and $(basename "$MutPubContent")
|
-i, --init generate $(basename "$MutBuilderConfig") and $(basename "$MutPubContent")
|
||||||
-c, --compile compile package(s)
|
-c, --compile compile package(s)
|
||||||
-b, --brew compress *.upk and place inside *.u
|
-b, --brew compress *.upk and place inside *.u
|
||||||
-bm, --brew-manual the same (almost) as above, but with patched kfeditor by @notpeelz
|
|
||||||
-u, --upload upload package(s) to the Steam Workshop
|
-u, --upload upload package(s) to the Steam Workshop
|
||||||
-t, --test run local single player test
|
-t, --test run local single player test
|
||||||
-f, --force overwrites existing files when used with --init
|
-f, --force overwrites existing files when used with --init
|
||||||
@ -216,8 +215,8 @@ ${BLD}Available options:${DEF}
|
|||||||
-h, --help show this help
|
-h, --help show this help
|
||||||
|
|
||||||
${BLD}Short options can be combined, examples:${DEF}
|
${BLD}Short options can be combined, examples:${DEF}
|
||||||
|
-if recreate build.cfg and PublicationContent, replace old ones
|
||||||
-cbu compile, brew, upload
|
-cbu compile, brew, upload
|
||||||
-cbmt compile, brew_manual, run_test
|
|
||||||
-cbhe compile and brew without closing kf2editor
|
-cbhe compile and brew without closing kf2editor
|
||||||
etc...
|
etc...
|
||||||
EOF
|
EOF
|
||||||
@ -257,16 +256,25 @@ function restore_kfeditorconf ()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function print_list () # $1: List with spaces, $2: New separator
|
||||||
|
{
|
||||||
|
echo "${1// /$2}"
|
||||||
|
}
|
||||||
|
|
||||||
function init ()
|
function init ()
|
||||||
{
|
{
|
||||||
local PackageList=""
|
local PackageList=""
|
||||||
local AviableMutators=""
|
local AviableMutators=""
|
||||||
local AviableGamemodes=""
|
local AviableGamemodes=""
|
||||||
local ConfigGamemodes=""
|
local AviableMaps=""
|
||||||
local ProjectName=""
|
local ProjectName=""
|
||||||
local GitUsername=""
|
local GitUsername=""
|
||||||
local GitRemoteUrl=""
|
local GitRemoteUrl=""
|
||||||
local PublicationTags=""
|
local PublicationTags=""
|
||||||
|
local DefGamemode=""
|
||||||
|
local DefMap=""
|
||||||
|
local BaseList=""
|
||||||
|
local BaseListNext=""
|
||||||
|
|
||||||
if [[ -e "$MutBuilderConfig" ]]; then
|
if [[ -e "$MutBuilderConfig" ]]; then
|
||||||
if is_true "$ArgForce"; then
|
if is_true "$ArgForce"; then
|
||||||
@ -276,6 +284,16 @@ function init ()
|
|||||||
msg "creating new $(basename "$MutBuilderConfig")"
|
msg "creating new $(basename "$MutBuilderConfig")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
while read -r Map
|
||||||
|
do
|
||||||
|
if [[ -z "$AviableMaps" ]]; then
|
||||||
|
DefMap="$Map"
|
||||||
|
AviableMaps="$Map"
|
||||||
|
else
|
||||||
|
AviableMaps="$AviableMaps $Map"
|
||||||
|
fi
|
||||||
|
done < <(find "$MutBrewedPCAddon" -type f -iname '*.kfm' -printf "%f\n" | sort)
|
||||||
|
|
||||||
while read -r Package
|
while read -r Package
|
||||||
do
|
do
|
||||||
if [[ -z "$PackageList" ]]; then
|
if [[ -z "$PackageList" ]]; then
|
||||||
@ -285,44 +303,91 @@ function init ()
|
|||||||
fi
|
fi
|
||||||
done < <(find "$MutSource" -mindepth 2 -maxdepth 2 -type d -ipath '*/Classes' | sed -r 's|.+/([^/]+)/[^/]+|\1|' | sort)
|
done < <(find "$MutSource" -mindepth 2 -maxdepth 2 -type d -ipath '*/Classes' | sed -r 's|.+/([^/]+)/[^/]+|\1|' | sort)
|
||||||
|
|
||||||
if [[ -z "$PackageList" ]]; then
|
if [[ -n "$PackageList" ]]; then
|
||||||
die "No packages found! Check project filesystem, fix config and try again"
|
msg "packages found: $(print_list "$PackageList" ", ")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg "packages found: $PackageList"
|
# DISCLAMER: BigO nightmare (*)
|
||||||
|
# Remove seniors with a weak psyche from the screen
|
||||||
|
#
|
||||||
|
# (*) As planned though:
|
||||||
|
# Initialized once and quickly even on large projects,
|
||||||
|
# There is no point in optimizing this
|
||||||
|
if [[ -n "$PackageList" ]]; then
|
||||||
|
# find available mutators
|
||||||
|
BaseList='(KF)?Mutator'
|
||||||
|
BaseListNext=''
|
||||||
|
while [[ -n "$BaseList" ]]
|
||||||
|
do
|
||||||
|
for Base in $BaseList
|
||||||
|
do
|
||||||
for Package in $PackageList
|
for Package in $PackageList
|
||||||
do
|
do
|
||||||
# find available mutators
|
while read -r Class
|
||||||
while read -r MutClass
|
|
||||||
do
|
do
|
||||||
if [[ -z "$AviableMutators" ]]; then
|
if [[ -z "$AviableMutators" ]]; then
|
||||||
AviableMutators="$Package.$MutClass"
|
AviableMutators="$Package.$Class"
|
||||||
else
|
else
|
||||||
AviableMutators="$AviableMutators,$Package.$MutClass"
|
AviableMutators="$AviableMutators $Package.$Class"
|
||||||
fi
|
fi
|
||||||
done < <(grep -rihPo '\s.+extends\s(KF)?Mutator' "$MutSource/$Package" | awk '{ print $1 }')
|
if [[ -z "$BaseListNext" ]]; then
|
||||||
|
BaseListNext="$Class"
|
||||||
# find available gamemodes
|
|
||||||
while read -r GamemodeClass
|
|
||||||
do
|
|
||||||
if [[ -z "$AviableGamemodes" ]]; then
|
|
||||||
AviableGamemodes="$Package.$GamemodeClass"
|
|
||||||
else
|
else
|
||||||
AviableGamemodes="$AviableGamemodes,$Package.$GamemodeClass"
|
BaseListNext="$BaseListNext $Class"
|
||||||
fi
|
fi
|
||||||
done < <(grep -rihPo '\s.+extends\sKFGameInfo_' "$MutSource/$Package" | awk '{ print $1 }')
|
done < <(grep -rihPo "\s.+extends\s${Base}" "${MutSource}/${Package}" | awk '{ print $1 }')
|
||||||
|
done
|
||||||
|
done
|
||||||
|
BaseList="$BaseListNext"
|
||||||
|
BaseListNext=""
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# find available gamemodes
|
||||||
|
BaseList='KFGameInfo_'
|
||||||
|
BaseListNext=''
|
||||||
|
while [[ -n "$BaseList" ]]
|
||||||
|
do
|
||||||
|
for Base in $BaseList
|
||||||
|
do
|
||||||
|
for Package in $PackageList
|
||||||
|
do
|
||||||
|
while read -r Class
|
||||||
|
do
|
||||||
|
if [[ -z "$AviableGamemodes" ]]; then
|
||||||
|
AviableGamemodes="$Package.$Class"
|
||||||
|
if [[ -z "$DefGamemode" ]]; then
|
||||||
|
DefGamemode="$Package.$Class"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
AviableGamemodes="$AviableGamemodes $Package.$Class"
|
||||||
|
fi
|
||||||
|
if [[ -z "$BaseListNext" ]]; then
|
||||||
|
BaseListNext="$Class"
|
||||||
|
else
|
||||||
|
BaseListNext="$BaseListNext $Class"
|
||||||
|
fi
|
||||||
|
done < <(grep -rihPo "\s.+extends\s${Base}" "${MutSource}/${Package}" | awk '{ print $1 }')
|
||||||
|
done
|
||||||
|
done
|
||||||
|
BaseList="$BaseListNext"
|
||||||
|
BaseListNext=""
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -n "$AviableMutators" ]]; then
|
if [[ -n "$AviableMutators" ]]; then
|
||||||
msg "mutators found: $AviableMutators"
|
msg "mutators found: $(print_list "$AviableMutators" ", ")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "$AviableGamemodes" ]]; then
|
if [[ -z "$AviableGamemodes" ]]; then
|
||||||
ConfigGamemodes="KFGameContent.KFGameInfo_Survival"
|
DefGamemode="KFGameContent.KFGameInfo_Survival"
|
||||||
else
|
else
|
||||||
ConfigGamemodes="$AviableGamemodes"
|
msg "custom gamemodes found: $(print_list "$AviableGamemodes" ", ")"
|
||||||
msg "custom gamemodes found: $AviableGamemodes"
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$AviableMaps" ]]; then
|
||||||
|
DefMap="KF-Nuked"
|
||||||
|
else
|
||||||
|
msg "maps found: $(print_list "$AviableMaps" ", ")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if is_true "$ArgForce" || ! [[ -e "$MutBuilderConfig" ]]; then
|
if is_true "$ArgForce" || ! [[ -e "$MutBuilderConfig" ]]; then
|
||||||
@ -340,6 +405,16 @@ StripSource="True"
|
|||||||
PackageBuildOrder="$PackageList"
|
PackageBuildOrder="$PackageList"
|
||||||
|
|
||||||
|
|
||||||
|
### Brew parameters ###
|
||||||
|
|
||||||
|
# Packages you want to brew using @peelz's patched KFEditor.
|
||||||
|
# Useful for cases where regular brew doesn't put *.upk inside the package.
|
||||||
|
# Specify them with a space as a separator,
|
||||||
|
# The order doesn't matter
|
||||||
|
|
||||||
|
PackagePeelzBrew=""
|
||||||
|
|
||||||
|
|
||||||
### Steam Workshop upload parameters ###
|
### Steam Workshop upload parameters ###
|
||||||
|
|
||||||
# Mutators that will be uploaded to the workshop
|
# Mutators that will be uploaded to the workshop
|
||||||
@ -351,7 +426,7 @@ PackageUpload="$PackageList"
|
|||||||
### Test parameters ###
|
### Test parameters ###
|
||||||
|
|
||||||
# Map:
|
# Map:
|
||||||
Map="KF-Nuked"
|
Map="$DefMap"
|
||||||
|
|
||||||
# Game:
|
# Game:
|
||||||
# Survival: KFGameContent.KFGameInfo_Survival
|
# Survival: KFGameContent.KFGameInfo_Survival
|
||||||
@ -359,7 +434,7 @@ Map="KF-Nuked"
|
|||||||
# Endless: KFGameContent.KFGameInfo_Endless
|
# Endless: KFGameContent.KFGameInfo_Endless
|
||||||
# Objective: KFGameContent.KFGameInfo_Objective
|
# Objective: KFGameContent.KFGameInfo_Objective
|
||||||
# Versus: KFGameContent.KFGameInfo_VersusSurvival
|
# Versus: KFGameContent.KFGameInfo_VersusSurvival
|
||||||
Game="$ConfigGamemodes"
|
Game="$DefGamemode"
|
||||||
|
|
||||||
# Difficulty:
|
# Difficulty:
|
||||||
# Normal: 0
|
# Normal: 0
|
||||||
@ -375,7 +450,7 @@ Difficulty="0"
|
|||||||
GameLength="0"
|
GameLength="0"
|
||||||
|
|
||||||
# Mutators
|
# Mutators
|
||||||
Mutators="$AviableMutators"
|
Mutators="$(print_list "$AviableMutators" ",")"
|
||||||
|
|
||||||
# Additional parameters
|
# Additional parameters
|
||||||
Args=""
|
Args=""
|
||||||
@ -394,15 +469,16 @@ EOF
|
|||||||
|
|
||||||
if is_true "$ArgForce" || ! [[ -e "$MutPubContentDescription" ]]; then
|
if is_true "$ArgForce" || ! [[ -e "$MutPubContentDescription" ]]; then
|
||||||
:> "$MutPubContentDescription"
|
:> "$MutPubContentDescription"
|
||||||
echo "[h1]${ProjectName}[/h1]" >> "$MutPubContentDescription"
|
if [[ -n "$AviableGamemodes" ]] || [[ -n "$AviableMutators" ]] || [[ -n "$AviableMaps" ]]; then
|
||||||
echo "" >> "$MutPubContentDescription"
|
|
||||||
if [[ -n "$AviableGamemodes" ]] || [[ -n "$AviableMutators" ]]; then
|
|
||||||
echo "[h1]Description[/h1]" >> "$MutPubContentDescription"
|
echo "[h1]Description[/h1]" >> "$MutPubContentDescription"
|
||||||
|
if [[ -n "$AviableMaps" ]]; then
|
||||||
|
echo "[b]Maps:[/b][list][*]$(print_list "$AviableMaps" '[*]')[/list]" >> "$MutPubContentDescription"
|
||||||
|
fi
|
||||||
if [[ -n "$AviableGamemodes" ]]; then
|
if [[ -n "$AviableGamemodes" ]]; then
|
||||||
echo "[b]Gamemode(s):[/b] $AviableGamemodes" >> "$MutPubContentDescription"
|
echo "[b]Gamemodes:[/b][list][*]$(print_list "$AviableGamemodes" '[*]')[/list]" >> "$MutPubContentDescription"
|
||||||
fi
|
fi
|
||||||
if [[ -n "$AviableMutators" ]]; then
|
if [[ -n "$AviableMutators" ]]; then
|
||||||
echo "[b]Mutator(s):[/b] $AviableMutators" >> "$MutPubContentDescription"
|
echo "[b]Mutators:[/b][list][*]$(print_list "$AviableMutators" '[*]')[/list]" >> "$MutPubContentDescription"
|
||||||
fi
|
fi
|
||||||
echo "" >> "$MutPubContentDescription"
|
echo "" >> "$MutPubContentDescription"
|
||||||
fi
|
fi
|
||||||
@ -684,11 +760,16 @@ function publish_common ()
|
|||||||
mkdir -p "$KFPublishConfig"
|
mkdir -p "$KFPublishConfig"
|
||||||
cp -rf "$MutConfig"/* "$KFPublishConfig"
|
cp -rf "$MutConfig"/* "$KFPublishConfig"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -d "$MutBrewedPCAddon" ]]; then
|
||||||
|
mkdir -p "$KFPublishBrewedPC"
|
||||||
|
cp -rf "$MutBrewedPCAddon"/* "$KFPublishBrewedPC"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function brewed ()
|
function brewed () # $1: Wait for packages
|
||||||
{
|
{
|
||||||
for Package in $PackageUpload
|
for Package in $1
|
||||||
do
|
do
|
||||||
if ! test -f "$KFPublishBrewedPC/$Package.u"; then
|
if ! test -f "$KFPublishBrewedPC/$Package.u"; then
|
||||||
return 1
|
return 1
|
||||||
@ -705,12 +786,11 @@ function brew_cleanup ()
|
|||||||
find "$MutSource/$Package" -type f -name '*.upk' -printf "%f\n" | xargs -I{} find "$KFPublishBrewedPC" -type f -name {} -delete
|
find "$MutSource/$Package" -type f -name '*.upk' -printf "%f\n" | xargs -I{} find "$KFPublishBrewedPC" -type f -name {} -delete
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
rm -f "$KFPublishBrewedPC"/*.tmp
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function brew ()
|
function brew ()
|
||||||
{
|
{
|
||||||
|
local PackageBrew=""
|
||||||
local PID=""
|
local PID=""
|
||||||
|
|
||||||
msg "brewing"
|
msg "brewing"
|
||||||
@ -721,54 +801,46 @@ function brew ()
|
|||||||
die "You must compile packages before brewing. Use --compile option for this." 2
|
die "You must compile packages before brewing. Use --compile option for this." 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$PackagePeelzBrew" ]]; then
|
||||||
|
PackageBrew="$PackageBuildOrder"
|
||||||
|
else
|
||||||
|
for Package in $PackageBuildOrder
|
||||||
|
do
|
||||||
|
if ! echo "$PackagePeelzBrew" | grep -Pq "(^|\s+)$Package(\s+|$)"; then
|
||||||
|
PackageBrew="$Package "
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
rm -rf "$KFPublish"
|
rm -rf "$KFPublish"
|
||||||
|
|
||||||
mkdir -p "$KFPublishBrewedPC"
|
mkdir -p "$KFPublishBrewedPC"
|
||||||
|
|
||||||
if is_true "$ArgHoldEditor"; then
|
if is_true "$ArgHoldEditor"; then
|
||||||
CMD //C "cd /D $(cygpath -w "$KFWin64") && $(basename "$KFEditor") brewcontent -platform=PC $PackageUpload -useunpublished"
|
CMD //C "cd /D $(cygpath -w "$KFWin64") && $(basename "$KFEditor") brewcontent -platform=PC $PackageBrew -useunpublished"
|
||||||
if ! brewed; then
|
if ! brewed "$PackageBrew"; then
|
||||||
brew_cleanup
|
brew_cleanup
|
||||||
die "brewing failed"
|
die "brewing failed"
|
||||||
fi
|
fi
|
||||||
msg "${GRN}successfully brewed${DEF}"
|
|
||||||
else
|
else
|
||||||
CMD //C "cd /D $(cygpath -w "$KFWin64") && $(basename "$KFEditor") brewcontent -platform=PC $PackageUpload -useunpublished" &
|
CMD //C "cd /D $(cygpath -w "$KFWin64") && $(basename "$KFEditor") brewcontent -platform=PC $PackageBrew -useunpublished" &
|
||||||
PID="$!"
|
PID="$!"
|
||||||
while ps -p "$PID" &> /dev/null
|
while ps -p "$PID" &> /dev/null
|
||||||
do
|
do
|
||||||
if brewed; then
|
if brewed "$PackageBrew"; then
|
||||||
kill "$PID"
|
kill "$PID"
|
||||||
msg "${GRN}successfully brewed${DEF}"
|
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
if ! brewed; then
|
if ! brewed "$PackageBrew"; then
|
||||||
brew_cleanup
|
brew_cleanup
|
||||||
die "brewing failed"
|
die "brewing failed"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
publish_common
|
if [[ -n "$PackagePeelzBrew" ]]; then
|
||||||
brew_cleanup
|
msg "peelz brewing"
|
||||||
|
|
||||||
find "$KFPublish" -type d -empty -delete
|
|
||||||
}
|
|
||||||
|
|
||||||
function brew_manual ()
|
|
||||||
{
|
|
||||||
msg "manual brewing"
|
|
||||||
|
|
||||||
read_settings
|
|
||||||
|
|
||||||
if ! compiled; then
|
|
||||||
die "You must compile packages before brewing. Use --compile option for this." 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -rf "$KFPublish"
|
|
||||||
|
|
||||||
mkdir -p "$KFPublishBrewedPC"
|
|
||||||
|
|
||||||
if ! [[ -x "$KFEditorPatcher" ]]; then
|
if ! [[ -x "$KFEditorPatcher" ]]; then
|
||||||
get_latest_kfeditor_patcher "$KFEditorPatcher"
|
get_latest_kfeditor_patcher "$KFEditorPatcher"
|
||||||
@ -778,15 +850,17 @@ function brew_manual ()
|
|||||||
CMD //C "cd /D $(cygpath -w "$KFWin64") && $(basename "$KFEditorPatcher")"
|
CMD //C "cd /D $(cygpath -w "$KFWin64") && $(basename "$KFEditorPatcher")"
|
||||||
msg "${GRN}successfully patched${DEF}"
|
msg "${GRN}successfully patched${DEF}"
|
||||||
|
|
||||||
for Package in $PackageUpload
|
for Package in $PackagePeelzBrew
|
||||||
do
|
do
|
||||||
merge_packages "$Package"
|
merge_packages "$Package"
|
||||||
mv "$KFWin64/$Package.u" "$KFPublishBrewedPC"
|
mv "$KFWin64/$Package.u" "$KFPublishBrewedPC"
|
||||||
|
find "$MutSource/$Package" -type f -name '*.upk' -printf "%f\n" | xargs -I{} find "$KFPublishBrewedPC" -type f -name {} -delete
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
msg "${GRN}successfully brewed${DEF}"
|
msg "${GRN}successfully brewed${DEF}"
|
||||||
|
|
||||||
publish_common
|
rm -f "$KFPublishBrewedPC"/*.tmp
|
||||||
|
|
||||||
find "$KFPublish" -type d -empty -delete
|
find "$KFPublish" -type d -empty -delete
|
||||||
}
|
}
|
||||||
@ -803,8 +877,6 @@ function publish_unpublished ()
|
|||||||
find "$MutSource/$Package" -type f -name '*.upk' -exec cp -f {} "$KFPublishPackages" \;
|
find "$MutSource/$Package" -type f -name '*.upk' -exec cp -f {} "$KFPublishPackages" \;
|
||||||
done
|
done
|
||||||
|
|
||||||
publish_common
|
|
||||||
|
|
||||||
find "$KFPublish" -type d -empty -delete
|
find "$KFPublish" -type d -empty -delete
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -816,14 +888,18 @@ function upload ()
|
|||||||
|
|
||||||
read_settings
|
read_settings
|
||||||
|
|
||||||
if ! compiled; then
|
if ! compiled && ! test -d "$MutBrewedPCAddon"; then
|
||||||
die "You must compile packages before uploading. Use --compile option for this." 2
|
die "You must compile packages before uploading. Use --compile option for this." 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [[ -d "$KFPublish" ]]; then
|
if [[ -d "$KFPublish" ]]; then
|
||||||
|
brew_cleanup
|
||||||
|
elif [[ -d "$KFUnpublish" ]]; then
|
||||||
publish_unpublished
|
publish_unpublished
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
publish_common
|
||||||
|
|
||||||
Preview="${MutPubContentPreview}.$(preview_extension)"
|
Preview="${MutPubContentPreview}.$(preview_extension)"
|
||||||
|
|
||||||
if ! [[ -e "$Preview" ]]; then
|
if ! [[ -e "$Preview" ]]; then
|
||||||
@ -834,6 +910,9 @@ function upload ()
|
|||||||
|
|
||||||
find "$KFPublish" -type d -empty -delete
|
find "$KFPublish" -type d -empty -delete
|
||||||
|
|
||||||
|
# it's a bad idea to use the $KFPublish folder for upload
|
||||||
|
# because in that case some files won't get uploaded to the workshop for some reason
|
||||||
|
# so create a temporary folder to get around this
|
||||||
PreparedWsDir="$(mktemp -d -u -p "$KFDoc")"
|
PreparedWsDir="$(mktemp -d -u -p "$KFDoc")"
|
||||||
|
|
||||||
cat > "$MutWsInfo" <<EOF
|
cat > "$MutWsInfo" <<EOF
|
||||||
@ -874,7 +953,7 @@ function run_test ()
|
|||||||
|
|
||||||
read_settings
|
read_settings
|
||||||
|
|
||||||
if brewed; then
|
if brewed "$PackageBuildOrder"; then
|
||||||
msg "run test (brewed)"
|
msg "run test (brewed)"
|
||||||
else
|
else
|
||||||
UseUnpublished="-useunpublished"
|
UseUnpublished="-useunpublished"
|
||||||
@ -894,7 +973,6 @@ function parse_combined_params () # $1: Combined short parameters
|
|||||||
do
|
do
|
||||||
if [[ "$Position" -ge "$Length" ]]; then break; fi
|
if [[ "$Position" -ge "$Length" ]]; then break; fi
|
||||||
case "${Param:$Position:2}" in
|
case "${Param:$Position:2}" in
|
||||||
bm ) ((Position+=2)); ArgBrewManual="true" ;;
|
|
||||||
he ) ((Position+=2)); ArgHoldEditor="true" ;;
|
he ) ((Position+=2)); ArgHoldEditor="true" ;;
|
||||||
nc ) ((Position+=2)); ArgNoColors="true" ;;
|
nc ) ((Position+=2)); ArgNoColors="true" ;;
|
||||||
esac
|
esac
|
||||||
@ -926,7 +1004,6 @@ function parse_params () # $@: Args
|
|||||||
-i | --init ) ArgInit="true" ;;
|
-i | --init ) ArgInit="true" ;;
|
||||||
-c | --compile ) ArgCompile="true" ;;
|
-c | --compile ) ArgCompile="true" ;;
|
||||||
-b | --brew ) ArgBrew="true" ;;
|
-b | --brew ) ArgBrew="true" ;;
|
||||||
-bm | --brew-manual ) ArgBrewManual="true" ;;
|
|
||||||
-u | --upload ) ArgUpload="true" ;;
|
-u | --upload ) ArgUpload="true" ;;
|
||||||
-t | --test ) ArgTest="true" ;;
|
-t | --test ) ArgTest="true" ;;
|
||||||
-d | --debug ) ArgDebug="true" ;;
|
-d | --debug ) ArgDebug="true" ;;
|
||||||
@ -964,7 +1041,6 @@ function main ()
|
|||||||
if is_true "$ArgInit"; then init; fi
|
if is_true "$ArgInit"; then init; fi
|
||||||
if is_true "$ArgCompile"; then compile; fi
|
if is_true "$ArgCompile"; then compile; fi
|
||||||
if is_true "$ArgBrew"; then brew; fi
|
if is_true "$ArgBrew"; then brew; fi
|
||||||
if is_true "$ArgBrewManual"; then brew_manual; fi
|
|
||||||
if is_true "$ArgUpload"; then upload; fi
|
if is_true "$ArgUpload"; then upload; fi
|
||||||
if is_true "$ArgTest"; then run_test; fi
|
if is_true "$ArgTest"; then run_test; fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user