Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/upload' into trait-flag-improv…
Browse files Browse the repository at this point in the history
…ement
  • Loading branch information
chaosvolt committed Sep 1, 2023
2 parents 4bc145a + 2d75e1b commit 2bf1d30
Show file tree
Hide file tree
Showing 1,622 changed files with 441,868 additions and 652,545 deletions.
4 changes: 4 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Leave the headings unless they don't apply to your PR, and remove the comment blocks (surrounded with <!–– and ––>) when you are done.
NOTE: Please grant permission for repository maintainers to edit your PR. It is EXTREMELY common for PRs to be held up due to trivial changes being requested and the author being unavailable to make them.
CODE STYLE: please follow below guide.
JSON: https://github.com/cataclysmbnteam/Cataclysm-BN/blob/upload/doc/JSON_STYLE.md
C++: https://github.com/cataclysmbnteam/Cataclysm-BN/blob/upload/doc/CODE_STYLE.md
-->

#### Summary
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/manual-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
type: string
env:
VERSION: ${{ inputs.version }}
VCPKG_BINARY_SOURCES: "default"
jobs:
release:
name: Create Release
Expand Down Expand Up @@ -231,7 +232,7 @@ jobs:
- name: Build CBN (windows)
if: matrix.mxe != 'none'
env:
PLATFORM: /opt/mxe/usr/bin/${{ matrix.mxe }}-w64-mingw32.static-
PLATFORM: /opt/mxe/usr/bin/${{ matrix.mxe }}-w64-mingw32.static.gcc11-
run: |
make -j$((`nproc`+0)) CROSS="${PLATFORM}" TILES=1 SOUND=1 RELEASE=1 LANGUAGES=all PCH=0 bindist
mv cataclysmbn-${{ inputs.version }}.zip cbn-${{ matrix.artifact }}-${{ inputs.version }}.zip
Expand Down Expand Up @@ -278,8 +279,8 @@ jobs:
mv ./app/build/outputs/apk/stable/release/*.apk ../cbn-${{ matrix.artifact }}-${{ inputs.version }}.apk
elif [ ${{ matrix.android }} = bundle ]
then
./gradlew -Pj=$((`nproc`+0)) assembleStableRelease -Poverride_version=${{ inputs.version }}
mv ./app/build/outputs/bundle/stable/*.aab ../cbn-${{ matrix.artifact }}-${{ inputs.version }}.aab
./gradlew -Pj=$((`nproc`+0)) bundleStableRelease -Poverride_version=${{ inputs.version }}
mv ./app/build/outputs/bundle/stableRelease/*.aab ../cbn-${{ matrix.artifact }}-${{ inputs.version }}.aab
fi
- name: Upload release asset
id: upload-release-asset
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
cmake: 0
tiles: 0
sound: 0
lua: 0
test-stage: 1
title: GCC 12, Ubuntu, Curses
native: linux64
Expand All @@ -39,14 +40,25 @@ jobs:
cmake: 1
tiles: 1
sound: 1
lua: 1
languages: all
native: linux64
title: GCC 12, Ubuntu, Tiles, CMake, Languages
title: GCC 12, Ubuntu, Tiles, Sound, Lua, CMake, Languages
- compiler: g++-12
os: ubuntu-22.04
cmake: 0
tiles: 1
sound: 1
lua: 1
test-stage: 1
title: GCC 11, Ubuntu, Tiles, Sound, Lua
native: linux64
- compiler: g++-11
os: ubuntu-22.04
cmake: 0
tiles: 1
sound: 0
lua: 0
sanitize: address
native: linux64
title: GCC 12, Ubuntu, Tiles, NoSound, ASan
Expand All @@ -55,6 +67,7 @@ jobs:
cmake: 0
tiles: 1
sound: 0
lua: 0
sanitize: address,undefined
native: linux64
title: Clang 14, Ubuntu, Tiles, NoSound, ASan, UBSan
Expand All @@ -63,10 +76,11 @@ jobs:
cmake: 0
tiles: 1
sound: 1
lua: 1
test-stage: 1
native: osx
grep_clang_version_rxp: "14\\.[0-9]+\\.[0-9]+"
title: Clang 14, macOS 12, Tiles, Localize
title: Clang 14, macOS 12, Tiles, Sound, Localize, Lua
name: ${{ matrix.title }}
runs-on: ${{ matrix.os }}
env:
Expand All @@ -76,6 +90,7 @@ jobs:
OS: ${{ matrix.os }}
TILES: ${{ matrix.tiles }}
SOUND: ${{ matrix.sound }}
LUA: ${{ matrix.lua }}
SANITIZE: ${{ matrix.sanitize }}
TEST_STAGE: ${{ matrix.test-stage }}
LANGUAGES: ${{ matrix.languages }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push-translation-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: "Install Python3"
run: |
sudo apt install python3-pip
sudo pip3 install polib
sudo pip3 install polib luaparser
- name: "Checkout"
uses: actions/checkout@v3
- name: "Generate translation template"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,14 @@ jobs:
- name: Build CBN (linux)
if: runner.os == 'Linux' && matrix.mxe == 'none' && matrix.android == 'none'
run: |
make -j$((`nproc`+0)) TILES=${{ matrix.tiles }} SOUND=${{ matrix.tiles }} RELEASE=1 LANGUAGES=all PCH=0 bindist
make -j$((`nproc`+0)) TILES=${{ matrix.tiles }} SOUND=${{ matrix.tiles }} LUA=1 RELEASE=1 LANGUAGES=all PCH=0 bindist
mv cataclysmbn-unstable.tar.gz cbn-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.tar.gz
- name: Build CBN (windows)
if: matrix.mxe != 'none'
env:
PLATFORM: /opt/mxe/usr/bin/${{ matrix.mxe }}-w64-mingw32.static.gcc11-
run: |
make -j$((`nproc`+0)) CROSS="${PLATFORM}" TILES=1 SOUND=1 RELEASE=1 LANGUAGES=all PCH=0 bindist
make -j$((`nproc`+0)) CROSS="${PLATFORM}" TILES=1 SOUND=1 LUA=1 RELEASE=1 LANGUAGES=all PCH=0 bindist
mv cataclysmbn-unstable.zip cbn-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.zip
- name: Build CBN (windows msvc)
if: runner.os == 'Windows'
Expand All @@ -244,7 +244,7 @@ jobs:
- name: Build CBN (osx)
if: runner.os == 'macOS'
run: |
make -j3 TILES=${{ matrix.tiles }} SOUND=${{ matrix.tiles }} RELEASE=1 LANGUAGES=all USE_HOME_DIR=1 OSX_MIN=11 PCH=0 dmgdist COMPILER=clang++
make -j3 TILES=${{ matrix.tiles }} SOUND=${{ matrix.tiles }} LUA=1 RELEASE=1 LANGUAGES=all USE_HOME_DIR=1 OSX_MIN=11 PCH=0 dmgdist COMPILER=clang++
mv CataclysmBN-unstable.dmg cbn-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.dmg
- name: Set up JDK 8 (android)
if: runner.os == 'Linux' && matrix.android != 'none' && matrix.mxe == 'none'
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ SET(CMAKE_TLS_VERIFY ON)
option(TILES "Build graphical tileset version." "OFF")
option(CURSES "Build curses version." "ON")
option(SOUND "Support for in-game sounds & music." "OFF")
option(LUA "Support for in-game scripting with Lua." "OFF")
option(BACKTRACE "Support for printing stack backtraces on crash" "ON")
option(LIBBACKTRACE "Print backtrace with libbacktrace." "OFF")
option(USE_HOME_DIR "Use user's home directory for save files." "ON")
Expand Down Expand Up @@ -201,6 +202,7 @@ ENDIF (CMAKE_BUILD_TYPE STREQUAL Debug)
MESSAGE(STATUS "TILES : ${TILES}")
MESSAGE(STATUS "CURSES : ${CURSES}")
MESSAGE(STATUS "SOUND : ${SOUND}")
MESSAGE(STATUS "LUA : ${LUA}")
MESSAGE(STATUS "BACKTRACE : ${BACKTRACE}")
MESSAGE(STATUS "USE_HOME_DIR : ${USE_HOME_DIR}\n")

Expand Down
4 changes: 4 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ PLF List and PLF Colony (src/list.h, src/colony.h) are licensed under the zLib l

getpost (tools/json_tools/format/getpost.h) is licensed under the MIT license, see file for text of license.

Lua (src/lua/*) is licensed under the MIT license, see src_lua/LICENSE.md for text of license.

sol2 (src/sol/*) is licensed under the MIT license, see src/sol/sol.hpp for text of license.



fmtlib (src/fmtlib_*) is licensed under the MIT license (https://github.com/fmtlib/fmt/blob/master/LICENSE.rst). The full license text is as follows:
Expand Down
36 changes: 30 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# LTO Set to 1 to enable link-time optimization.
# TILES Set to 1 to enable tiles. Requires SDL.
# SOUND Set to 1 to enable sounds. Requires SDL.
# LUA Set to 1 to enable Lua.
#
# Platforms:
# Linux/Cygwin native
Expand Down Expand Up @@ -166,8 +167,11 @@ CHKJSON_BIN = $(BUILD_PREFIX)chkjson
BINDIST_DIR = $(BUILD_PREFIX)bindist
BUILD_DIR = $(CURDIR)
SRC_DIR = src
LUA_SRC_DIR = $(SRC_DIR)/lua
ASTYLE_BINARY = astyle

CXXFLAGS += -I$(SRC_DIR) -I$(LUA_SRC_DIR)

# Enable astyle by default
ifndef ASTYLE
ASTYLE = 1
Expand Down Expand Up @@ -264,8 +268,10 @@ endif
# when preprocessor defines change, but the source doesn't
ODIR = $(BUILD_PREFIX)obj
ODIRTILES = $(BUILD_PREFIX)obj/tiles
ODIRLUA = $(BUILD_PREFIX)obj/lua
W32ODIR = $(BUILD_PREFIX)objwin
W32ODIRTILES = $(W32ODIR)/tiles
W32ODIRLUA = $(W32ODIR)/lua

ifdef AUTO_BUILD_PREFIX
BUILD_PREFIX = $(if $(RELEASE),release-)$(if $(DEBUG_SYMBOLS),symbol-)$(if $(TILES),tiles-)$(if $(SOUND),sound-)$(if $(BACKTRACE),back-$(if $(LIBBACKTRACE),libbacktrace-))$(if $(SANITIZE),sanitize-)$(if $(MAPSIZE),map-$(MAPSIZE)-)$(if $(USE_XDG_DIR),xdg-)$(if $(USE_HOME_DIR),home-)$(if $(DYNAMIC_LINKING),dynamic-)$(if $(MSYS2),msys2-)
Expand Down Expand Up @@ -573,6 +579,7 @@ ifeq ($(TARGETSYSTEM),WINDOWS)
BINDIST = $(W32BINDIST)
BINDIST_CMD = $(W32BINDIST_CMD)
ODIR = $(W32ODIR)
ODIRLUA = $(W32ODIRLUA)
ifeq ($(DYNAMIC_LINKING), 1)
# Windows isn't sold with programming support, these are static to remove MinGW dependency.
LDFLAGS += -static-libgcc -static-libstdc++
Expand Down Expand Up @@ -794,6 +801,7 @@ TESTSRC := $(wildcard tests/*.cpp)
TESTHDR := $(wildcard tests/*.h)
JSON_FORMATTER_SOURCES := tools/format/format.cpp src/json.cpp
CHKJSON_SOURCES := src/chkjson/chkjson.cpp src/json.cpp
LUA_SOURCES := $(wildcard $(LUA_SRC_DIR)/*.c)
CLANG_TIDY_PLUGIN_SOURCES := \
$(wildcard tools/clang-tidy-plugin/*.cpp tools/clang-tidy-plugin/*/*.cpp)
TOOLHDR := $(wildcard tools/*/*.h)
Expand All @@ -815,6 +823,13 @@ ifeq ($(TARGETSYSTEM),WINDOWS)
endif
OBJS = $(sort $(patsubst %,$(ODIR)/%,$(_OBJS)))

ifeq ($(LUA), 1)
DEFINES += -DLUA
LUA_OBJS = $(sort $(LUA_SOURCES:$(LUA_SRC_DIR)/%.c=$(ODIRLUA)/%.o))
else
LUA_OBJS =
endif

ifdef LANGUAGES
L10N = localization
endif
Expand Down Expand Up @@ -872,12 +887,12 @@ endif
all: version $(CHECKS) $(TARGET) $(L10N) $(TESTS)
@

$(TARGET): $(OBJS)
$(TARGET): $(OBJS) $(LUA_OBJS)
ifeq ($(VERBOSE),1)
+$(LD) $(W32FLAGS) -o $(TARGET) $(OBJS) $(LDFLAGS)
+$(LD) $(W32FLAGS) -o $(TARGET) $(OBJS) $(LUA_OBJS) $(LDFLAGS)
else
@echo "Linking $@..."
@+$(LD) $(W32FLAGS) -o $(TARGET) $(OBJS) $(LDFLAGS)
@+$(LD) $(W32FLAGS) -o $(TARGET) $(OBJS) $(LUA_OBJS) $(LDFLAGS)
@echo Done!
endif

Expand All @@ -892,12 +907,12 @@ endif
$(PCH_P): $(PCH_H)
-$(CXX) $(CPPFLAGS) $(DEFINES) $(subst -Werror,,$(CXXFLAGS)) -c $(PCH_H) -o $(PCH_P)

$(BUILD_PREFIX)$(TARGET_NAME).a: $(OBJS)
$(BUILD_PREFIX)$(TARGET_NAME).a: $(OBJS) $(LUA_OBJS)
ifeq ($(VERBOSE),1)
$(AR) rcs $(BUILD_PREFIX)$(TARGET_NAME).a $(filter-out $(ODIR)/main.o $(ODIR)/messages.o,$(OBJS))
$(AR) rcs $(BUILD_PREFIX)$(TARGET_NAME).a $(filter-out $(ODIR)/main.o $(ODIR)/messages.o,$(OBJS)) $(LUA_OBJS)
else
@echo "Creating $@..."
@$(AR) rcs $(BUILD_PREFIX)$(TARGET_NAME).a $(filter-out $(ODIR)/main.o $(ODIR)/messages.o,$(OBJS))
@$(AR) rcs $(BUILD_PREFIX)$(TARGET_NAME).a $(filter-out $(ODIR)/main.o $(ODIR)/messages.o,$(OBJS)) $(LUA_OBJS)
endif

.PHONY: version
Expand All @@ -911,6 +926,7 @@ version:

# Unconditionally create the object dir on every invocation.
$(shell mkdir -p $(ODIR))
$(shell mkdir -p $(ODIRLUA))

$(ODIR)/%.o: $(SRC_DIR)/%.cpp $(PCH_P)
ifeq ($(VERBOSE), 1)
Expand All @@ -928,6 +944,14 @@ else
@$(RC) $(RFLAGS) $< -o $@
endif

$(ODIRLUA)/%.o: $(LUA_SRC_DIR)/%.c
ifeq ($(VERBOSE), 1)
$(CXX) -xc -std=c11 -c $< -o $@
else
@echo $(@F)
@$(CXX) -xc -std=c11 -c $< -o $@
endif

src/version.h: version

src/version.cpp: src/version.h
Expand Down
4 changes: 2 additions & 2 deletions README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

[![안정판][stable-releases-badge]][stable-releases] [![최신 릴리즈][all-releases-badge]][all-releases]

[stable-releases]: https://github.com/cataclysmbnteam/cataclysm-BN/releases/tag/cbn-0.2
[stable-releases]: https://github.com/cataclysmbnteam/cataclysm-BN/releases/tag/cbn-0.3
[stable-releases-badge]: https://img.shields.io/github/v/release/cataclysmbnteam/cataclysm-BN?style=for-the-badge&color=success&label=stable
[all-releases]: https://github.com/cataclysmbnteam/cataclysm-BN/releases
[all-releases]: https://github.com/cataclysmbnteam/Cataclysm-BN/releases?q=prerelease%3Atrue&expanded=true
[all-releases-badge]: https://img.shields.io/github/v/release/cataclysmbnteam/cataclysm-BN?style=for-the-badge&color=important&label=Latest%20Release&include_prereleases&sort=date

| [소스 코드][source-zip-archive] | [저장소에서 클론하기][clone] |
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ Find a way to stop the Cataclysm ... or become one of its strongest monsters.

[![Stable][stable-releases-badge]][stable-releases] [![Recent][all-releases-badge]][all-releases]

[stable-releases]: https://github.com/cataclysmbnteam/Cataclysm-BN/releases/tag/cbn-0.2
[stable-releases]: https://github.com/cataclysmbnteam/Cataclysm-BN/releases/tag/cbn-0.3
[stable-releases-badge]: <https://img.shields.io/github/v/release/cataclysmbnteam/Cataclysm-BN?style=for-the-badge&color=success&label=stable>
[all-releases]: https://github.com/cataclysmbnteam/Cataclysm-BN/releases
[all-releases]: https://github.com/cataclysmbnteam/Cataclysm-BN/releases?q=prerelease%3Atrue&expanded=true
[all-releases-badge]: https://img.shields.io/github/v/release/cataclysmbnteam/Cataclysm-BN?style=for-the-badge&color=important&label=Latest%20Release&include_prereleases&sort=date

| [Source Code][source-zip-archive] | [Clone From Repo][clone] |
Expand Down
2 changes: 1 addition & 1 deletion build-data/osx/dmgsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def icon_from_app(app_path):
format = defines.get('format', 'UDBZ')

# Volume size (must be large enough for your files)
size = defines.get('size', '200M')
size = defines.get('size', None)

# Files to include
files = [ application ]
Expand Down
8 changes: 7 additions & 1 deletion build-scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,13 @@ else
# Use a blacklist of mods that currently fail to load cleanly. Hopefully this list will
# shrink over time.
blacklist=build-scripts/mod_test_blacklist
mods="$(./build-scripts/get_all_mods.py $blacklist)"
if [ "$LUA" == "1" ]
then
do_lua="1"
else
do_lua="0"
fi
mods="$(./build-scripts/get_all_mods.py $blacklist $do_lua)"
run_tests ./tests/cata_test --user-dir=all_modded --mods="$mods" '~*'
fi
fi
Expand Down
7 changes: 6 additions & 1 deletion build-scripts/get_all_mods.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
import glob
import json

blacklist_filename, = sys.argv[1:]
assert(len(sys.argv) == 3)
blacklist_filename = sys.argv[1]
do_lua = sys.argv[2] == "1"

with open(blacklist_filename) as blacklist_file:
blacklist = {s.rstrip('\n') for s in blacklist_file.readlines()}

Expand All @@ -26,6 +29,8 @@ def add_mods(mods):
mod_info = json.load(open(info))
for e in mod_info:
if e["type"] == "MOD_INFO":
if not do_lua and "lua_api_version" in e:
continue
ident = e["id"]
if not ident in blacklist:
all_mod_dependencies[ident] = e.get("dependencies", [])
Expand Down
Loading

0 comments on commit 2bf1d30

Please sign in to comment.