Skip to content

Commit

Permalink
Merge pull request #9 from CleverRaven/master
Browse files Browse the repository at this point in the history
catchup to cleverraven
  • Loading branch information
Maleclypse authored Jan 2, 2020
2 parents a4a34e7 + 9eb7975 commit 6ab2e88
Show file tree
Hide file tree
Showing 1,321 changed files with 99,814 additions and 51,713 deletions.
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ readability-*,\
-cert-msc51-cpp,\
-misc-non-private-member-variables-in-classes,\
-modernize-avoid-c-arrays,\
-modernize-deprecated-headers,\
-modernize-pass-by-value,\
-modernize-return-braced-init-list,\
-modernize-use-auto,\
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ jobs:
compiler: clang
addons: &clang60
apt:
packages: ["clang-6.0", "g++-multilib", "libc6-dbg", "g++-6", "libsdl2-dev", "libsdl2-ttf-dev", "libsdl2-image-dev", "libsdl2-mixer-dev"]
packages: ["clang-6.0", "g++-multilib", "libc6-dbg", "g++-6", "libsdl2-dev", "libsdl2-ttf-dev", "libsdl2-image-dev", "libsdl2-mixer-dev", "libpulse-dev", "libpulse0=1:8.0-0ubuntu3.10", "libpulse-mainloop-glib0=1:8.0-0ubuntu3.10"]
sources: [*apt_sources, llvm-toolchain-xenial-6.0]

- env: CLANG=clang++-7
Expand Down
382 changes: 196 additions & 186 deletions CMakeLists.txt

Large diffs are not rendered by default.

22 changes: 19 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
# make DYNAMIC_LINKING=1
# Use MSYS2 as the build environment on Windows
# make MSYS2=1
# Turn off all optimizations, even debug-friendly optimizations
# make NOOPT=1
# Astyle all source files.
# make astyle
# Check if source files are styled properly.
Expand All @@ -89,13 +91,19 @@ WARNINGS = \
-Wold-style-cast \
-Woverloaded-virtual \
-Wpedantic
ifndef CLANG
WARNINGS += -Wsuggest-override
endif
# Uncomment below to disable warnings
#WARNINGS = -w
DEBUGSYMS = -g
#PROFILE = -pg
#OTHERS = -O3
#DEFINES = -DNDEBUG

# Tells ccache to keep comments, as they can be meaningful to the compiler (as to suppress warnings).
export CCACHE_COMMENTS=1

# Disable debug. Comment this out to get logging.
#DEFINES = -DENABLE_LOGGING

Expand Down Expand Up @@ -303,10 +311,18 @@ ifdef RELEASE
endif

ifndef RELEASE
ifeq ($(shell $(CXX) -E -Og - < /dev/null > /dev/null 2>&1 && echo fog),fog)
OPTLEVEL = -Og
else
ifdef NOOPT
# While gcc claims to include all information required for
# debugging at -Og, at least with gcc 8.3, control flow
# doesn't move line-by-line at -Og. Provide a command-line
# way to turn off optimization (make NOOPT=1) entirely.
OPTLEVEL = -O0
else
ifeq ($(shell $(CXX) -E -Og - < /dev/null > /dev/null 2>&1 && echo fog),fog)
OPTLEVEL = -Og
else
OPTLEVEL = -O0
endif
endif
CXXFLAGS += $(OPTLEVEL)
endif
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ We also have the following build guides:

## Contribute

Cataclysm:Dark Days Ahead is the result of contributions from over 900 volunteers under the Creative Commons Attribution ShareAlike 3.0 license. The code and content of the game is free to use, modify, and redistribute for any purpose whatsoever. See http://creativecommons.org/licenses/by-sa/3.0/ for details.
Cataclysm:Dark Days Ahead is the result of contributions from over 1000 volunteers under the Creative Commons Attribution ShareAlike 3.0 license. The code and content of the game is free to use, modify, and redistribute for any purpose whatsoever. See http://creativecommons.org/licenses/by-sa/3.0/ for details.
Some code distributed with the project is not part of the project and is released under different software licenses, the files covered by different software licenses have their own license notices.

[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=146201)](https://www.bountysource.com/trackers/146201-clever-raven-cataclysm-dda?utm_source=146201&utm_medium=shield&utm_campaign=TRACKER_BADGE)
Expand Down
1 change: 1 addition & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
!config/
!deps*.zip
*.iml
.cxx
.DS_Store
Expand Down
39 changes: 29 additions & 10 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,25 @@ if (keystorePropertiesFile.exists()) {
def njobs = getProperty("j")

def localize = getProperty("localize").toBoolean()
def abi32 = getProperty("abi32").toBoolean()
def abi64 = getProperty("abi64").toBoolean()
def abi_arm_32 = getProperty("abi_arm_32").toBoolean()
def abi_arm_64 = getProperty("abi_arm_64").toBoolean()
def abi_x86_32 = getProperty("abi_x86_32").toBoolean()
def abi_x86_64 = getProperty("abi_x86_64").toBoolean()
def deps = getProperty("deps")
def override_version = getProperty("override_version")
def version_header_path = getProperty("version_header_path")
def override_compileSdkVersion = getProperty("override_compileSdkVersion").toInteger()
def override_minSdkVersion = getProperty("override_minSdkVersion").toInteger()
def override_targetSdkVersion = getProperty("override_targetSdkVersion").toInteger()
def override_ndkBuildAppPlatform = getProperty("override_ndkBuildAppPlatform")

if (!abi32 && !abi64) {
throw new GradleException("Both `abi32` and `abi64` properties are set to false")
println("Using compileSdkVersion: $override_compileSdkVersion")
println("Using minSdkVersion: $override_minSdkVersion")
println("Using targetSdkVersion: $override_targetSdkVersion")
println("Using ndkBuildAppPlatform: $override_ndkBuildAppPlatform")

if (!abi_arm_32 && !abi_arm_64 && !abi_x86_32 && !abi_x86_64) {
throw new GradleException("All supported ABI properties are set to false!")
}
if (!file(deps).exists()) {
throw new GradleException("Dependencies file does not exist:" + deps)
Expand Down Expand Up @@ -94,7 +105,7 @@ unzipDeps.dependsOn makeLocalization
preBuild.dependsOn unzipDeps

android {
compileSdkVersion 28
compileSdkVersion override_compileSdkVersion

if (override_version.isEmpty()) {
println("Generating version number to $version_header_path")
Expand Down Expand Up @@ -127,14 +138,15 @@ android {
}

defaultConfig {
minSdkVersion 14
targetSdkVersion 28
minSdkVersion override_minSdkVersion
targetSdkVersion override_targetSdkVersion
versionCode Integer.valueOf(System.env.UPSTREAM_BUILD_NUMBER ?: 1)
versionName new File("$version_header_path").text.split('\"')[1]
if (buildAsApplication) {
applicationId "com.cleverraven.cataclysmdda"
setProperty("archivesBaseName", "cataclysmdda-" + versionName)
}
resValue "string", "app_name", "Cataclysm DDA"

splits {
// Configures multiple APKs based on ABI.
Expand All @@ -144,20 +156,26 @@ android {
// Resets the list of ABIs that Gradle should create APKs for to none.
reset()
// Specifies a list of ABIs that Gradle should create APKs for.
if (abi32) {
if (abi_arm_32) {
include "armeabi-v7a"
}
if (abi64) {
if (abi_arm_64) {
include "arm64-v8a"
}
if (abi_x86_32) {
include "x86"
}
if (abi_x86_64) {
include "x86_64"
}
// Specifies that we do not want to also generate a universal APK that includes all ABIs.
universalApk false
}
}

externalNativeBuild {
ndkBuild {
arguments "APP_PLATFORM=android-16", "-j$njobs"
arguments "APP_PLATFORM=$override_ndkBuildAppPlatform", "-j$njobs"
}
}
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -169,6 +187,7 @@ android {
experimental {
dimension "version"
applicationIdSuffix ".experimental"
resValue "string", "app_name", "Cataclysm DDA (experimental)"
}
}

Expand Down
Binary file modified android/app/deps.zip
Binary file not shown.
Binary file added android/app/deps_debug.zip
Binary file not shown.
1 change: 0 additions & 1 deletion android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Cataclysm DDA</string>
<string name="installing">Installing game data...</string>
<string name="upgrading">Upgrading game data...</string>
</resources>
36 changes: 30 additions & 6 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,21 @@ j=2
# You can override this from the command line by passing "-Plocalize=#"
localize=true

# This property controls whether to build 32 bit ABI
# You can override this from the command line by passing "-Pabi32=#"
abi32=true
# This property controls whether to build arm 32 bit ABI
# You can override this from the command line by passing "-Pabi_arm_32=#"
abi_arm_32=true

# This property controls whether to build 64 bit ABI
# You can override this from the command line by passing "-Pabi64=#"
abi64=true
# This property controls whether to build arm 64 bit ABI
# You can override this from the command line by passing "-Pabi_arm_64=#"
abi_arm_64=true

# This property controls whether to build x86 32 bit ABI
# You can override this from the command line by passing "-Pabi_x86_32=#"
abi_x86_32=false

# This property controls whether to build x86 64 bit ABI
# You can override this from the command line by passing "-Pabi_x86_64=#"
abi_x86_64=false

# This property controls which dependencies file to use
# You can override this from the command line by passing "-Pdeps=#"
Expand All @@ -43,3 +51,19 @@ override_version=
# This property controls path where overriden version number header should be generated
# You can override this from the command line by passing "-Pversion_header_path=#"
version_header_path=app/jni/src/version.h

# This property controls which compileSdkVersion should be used
# You can override this from the command line by passing "-Poverride_compileSdkVersion=#"
override_compileSdkVersion=28

# This property controls which minSdkVersion should be used
# You can override this from the command line by passing "-Poverride_minSdkVersion=#"
override_minSdkVersion=14

# This property controls which targetSdkVersion should be used
# You can override this from the command line by passing "-Poverride_targetSdkVersion=#"
override_targetSdkVersion=28

# This property controls which ndkBuildAppPlatform should be used
# You can override this from the command line by passing "-Poverride_ndkBuildAppPlatform=#"
override_ndkBuildAppPlatform=android-16
2 changes: 1 addition & 1 deletion build-scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ then
cd android
# Specify dumb terminal to suppress gradle's constatnt output of time spent building, which
# fills the log with nonsense.
TERM=dumb ./gradlew assembleRelease -Pj=$num_jobs -Plocalize=false -Pabi32=false -Pabi64=true -Pdeps=/home/travis/build/CleverRaven/Cataclysm-DDA/android/app/deps.zip
TERM=dumb ./gradlew assembleRelease -Pj=$num_jobs -Plocalize=false -Pabi_arm_32=false -Pabi_arm_64=true -Pdeps=/home/travis/build/CleverRaven/Cataclysm-DDA/android/app/deps.zip
else
make -j "$num_jobs" RELEASE=1 CCACHE=1 BACKTRACE=1 CROSS="$CROSS_COMPILATION" LINTJSON=0

Expand Down
25 changes: 22 additions & 3 deletions build-scripts/get_all_mods.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,31 @@
with open(blacklist_filename) as blacklist_file:
blacklist = {s.rstrip('\n') for s in blacklist_file.readlines()}

mods = []
mods_to_keep = []

def add_mods(mods):
for mod in mods:
if not mod in all_mod_dependecies:
# Either an invalid mod id, or blacklisted.
return False
for mod in mods:
if not mod in mods_to_keep:
mods_to_keep.append(mod)
return True

all_mod_dependecies = {}

for info in glob.glob('data/mods/*/modinfo.json'):
mod_info = json.load(open(info))
mods.extend(e["ident"] for e in mod_info if e["type"] == "MOD_INFO")
for e in mod_info:
if e["type"] == "MOD_INFO":
ident = e["ident"]
if not ident in blacklist:
all_mod_dependecies[ident] = e.get("dependencies", [])

mods_to_keep = [mod for mod in mods if mod not in blacklist]
for mod in all_mod_dependecies:
if not mod in mods_to_keep:
if add_mods(all_mod_dependecies[mod]):
mods_to_keep.append(mod)

print(','.join(mods_to_keep))
43 changes: 0 additions & 43 deletions build-scripts/mod_test_blacklist
Original file line number Diff line number Diff line change
@@ -1,51 +1,8 @@
aftershock
alt_map_key
Animatronics
Battery_Overhaul_Legacy_Mode
blazemod
cbm_slots
classic_zombies
crazy_cataclysm
crt_expansion
desertpack
DinoMod
ew_pack
FIC_Weapons
FujiStruct
generic_guns
Graphical_Overmap
growable-pots
Heavy miners
hydroponics
magiclysm
manualbionicinstall
mapgen_demo
Medieval_Stuff
MMA
modular_turrets
more_locations
More_Survival_Tools
mutant_npcs
my_sweet_cataclysm
national_guard_camp
No_Anthills
No_Bees
no_faults
no_filthy_clothing
No_Fungi
no_medieval_items
no_npc_food
No_Rail_Stations
No_Triffids
novitamins
realguns
safeautodoc
Salvaged_Robots
sees_player_hitbutton
sees_player_retro
sleepdeprivation
speedydex
stats_through_kills
Tanks
Tolerate_This
Urban_Development
46 changes: 23 additions & 23 deletions data/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
# Cataclysm data files
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.1.4)

SET(CATACLYSM_DATA_DIRS
${CMAKE_SOURCE_DIR}/data/font
${CMAKE_SOURCE_DIR}/data/json
${CMAKE_SOURCE_DIR}/data/mods
${CMAKE_SOURCE_DIR}/data/names
${CMAKE_SOURCE_DIR}/data/raw
${CMAKE_SOURCE_DIR}/data/motd
${CMAKE_SOURCE_DIR}/data/credits
${CMAKE_SOURCE_DIR}/data/title
${CMAKE_SOURCE_DIR}/data/font
${CMAKE_SOURCE_DIR}/data/json
${CMAKE_SOURCE_DIR}/data/mods
${CMAKE_SOURCE_DIR}/data/names
${CMAKE_SOURCE_DIR}/data/raw
${CMAKE_SOURCE_DIR}/data/motd
${CMAKE_SOURCE_DIR}/data/credits
${CMAKE_SOURCE_DIR}/data/title
)

IF(SOUND)
SET(CATACLYSM_DATA_DIRS
${CATACLYSM_DATA_DIRS}
${CMAKE_SOURCE_DIR}/data/sound
)
SET(CATACLYSM_DATA_DIRS
${CATACLYSM_DATA_DIRS}
${CMAKE_SOURCE_DIR}/data/sound
)
ENDIF(SOUND)

IF(TILES)
SET(CATACLYSM_DATA_DIRS
${CATACLYSM_DATA_DIRS}
${CMAKE_SOURCE_DIR}/gfx
)
SET(CATACLYSM_DATA_DIRS
${CATACLYSM_DATA_DIRS}
${CMAKE_SOURCE_DIR}/gfx
)
ENDIF(TILES)

SET(CATACLYSM_DATA_FILES
${CMAKE_SOURCE_DIR}/data/changelog.txt
${CMAKE_SOURCE_DIR}/data/cataicon.ico
${CMAKE_SOURCE_DIR}/data/fontdata.json
${CMAKE_SOURCE_DIR}/LICENSE.txt
${CMAKE_SOURCE_DIR}/data/changelog.txt
${CMAKE_SOURCE_DIR}/data/cataicon.ico
${CMAKE_SOURCE_DIR}/data/fontdata.json
${CMAKE_SOURCE_DIR}/LICENSE.txt
)

IF(RELEASE)
install(DIRECTORY ${CATACLYSM_DATA_DIRS} DESTINATION ${DATA_PREFIX})
install(FILES ${CATACLYSM_DATA_FILES} DESTINATION ${DATA_PREFIX})
install(DIRECTORY ${CATACLYSM_DATA_DIRS} DESTINATION ${DATA_PREFIX})
install(FILES ${CATACLYSM_DATA_FILES} DESTINATION ${DATA_PREFIX})
ENDIF(RELEASE)
Loading

0 comments on commit 6ab2e88

Please sign in to comment.