Skip to content

Commit

Permalink
Merge pull request #1 from CleverRaven/master
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
Maleclypse authored Sep 6, 2019
2 parents 433a419 + a97a9eb commit 846a688
Show file tree
Hide file tree
Showing 931 changed files with 93,616 additions and 68,140 deletions.
2 changes: 0 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ readability-*,\
-bugprone-misplaced-widening-cast,\
-bugprone-narrowing-conversions,\
-bugprone-unused-return-value,\
-bugprone-use-after-move,\
-cert-err34-c,\
-cert-flp30-c,\
-cert-msc30-c,\
Expand Down Expand Up @@ -49,7 +48,6 @@ readability-*,\
-readability-else-after-return,\
-readability-function-size,\
-readability-implicit-bool-conversion,\
-readability-inconsistent-declaration-parameter-name,\
-readability-isolate-declaration,\
-readability-magic-numbers,\
-readability-named-parameter,\
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,13 @@ name: JSON Validation

on:
push:
branches:
- master
paths:
- "*.json"
pull_request:
branches:
- master
paths:
- "*.json"

jobs:
build:

style-json:
name: JSON style check

runs-on: ubuntu-latest

steps:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/pr-validator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: PR Validator
on:
pull_request:
branches:
- master
jobs:
validate:
name: Validate PR
runs-on: ubuntu-latest
steps:
- name: "Validate SUMMARY"
uses: CleverRaven/pr-validator@master
with:
description-regex: '(\n|^)\s*`{0,3}SUMMARY: +(None|((Features|Content|Interface|Mods|Balance|Bugfixes|Performance|Infrastructure|Build|I18N) +".*"))`{0,3}\s*(\n|$)'
34 changes: 0 additions & 34 deletions COMPILING-FLATPAK.md

This file was deleted.

4 changes: 2 additions & 2 deletions ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ Remember to take part in the discussion of your suggestions.

### Questions

You should direct your questions to the forum or ask on IRC. You should also read the included documentation and additional text files, e.g. `COMPILING.md` if you have problems building.
You should direct your questions to the forum or ask on IRC. You should also read the included documentation and additional text files, e.g. [COMPILING.md](doc/COMPILING/COMPILING.md) if you have problems building.

## Bounties

We keep the development and direction of the game community-driven so placing a bounty *does not* necessarily mean that change will be incorporated into the main game. But it may be incorporated as a mod (or not). As such feel free to post bounties on what you like, but remember we don't do "bounty-driven" development. Good way of thinking about bounties is as encouragement for contributors to work on a particular issue, and certainly not as "paying for features".
Placing a bounty *does not* necessarily mean that change will be incorporated into the main game. Please coordinate in the issue you intend to place a bounty on to determine if it is a change the project will accept, and keep in mind that placing a bounty will not confer special status on the issue. A good way of thinking about bounties is as encouragement for contributors to work on a particular issue, and certainly not as "paying for features".

## Issue resolution

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ The source can either be downloaded as [an archive](https://github.com/CleverRav

## Compile

Please read [COMPILING.md](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/COMPILING.md) - it covers general information and more specific recipes for Linux, OS X, Windows and BSD. See [doc/COMPILER_SUPPORT.md](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/COMPILER_SUPPORT.md) for details on which compilers we support. And you can always dig for more information in [doc/](https://github.com/CleverRaven/Cataclysm-DDA/tree/master/doc).
Please read [COMPILING.md](doc/COMPILING/COMPILING.md) - it covers general information and more specific recipes for Linux, OS X, Windows and BSD. See [COMPILER_SUPPORT.md](doc/COMPILING/COMPILER_SUPPORT.md) for details on which compilers we support. And you can always dig for more information in [doc/](https://github.com/CleverRaven/Cataclysm-DDA/tree/master/doc).

We also have the following build guides:
* Building on Windows with `MSYS2` at [COMPILING-MSYS.md](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/COMPILING-MSYS.md)
* Building on Windows with `vcpkg` at [COMPILING-VS-VCPKG.md](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/COMPILING-VS-VCPKG.md)
* Building with `cmake` at [COMPILING-CMAKE.md](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/COMPILING-CMAKE.md) (*unofficial guide*)
* Building on Windows with `MSYS2` at [COMPILING-MSYS.md](doc/COMPILING/COMPILING-MSYS.md)
* Building on Windows with `vcpkg` at [COMPILING-VS-VCPKG.md](doc/COMPILING/COMPILING-VS-VCPKG.md)
* Building with `cmake` at [COMPILING-CMAKE.md](doc/COMPILING/COMPILING-CMAKE.md) (*unofficial guide*)

## Contribute

Expand Down
21 changes: 12 additions & 9 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
!config/
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.cxx
.DS_Store
/build
/captures
.externalNativeBuild
!config/
/app/jni/libintl-lite
/app/jni/mpg-123
.gradle
/.idea/libraries
/.idea/workspace.xml
/app/jni/SDL2
/app/jni/SDL2_image
/app/jni/SDL2_mixer
/app/jni/SDL2_ttf
/app/jni/libintl-lite
/app/jni/lua
/app/jni/mpg-123
/app/build
/build
/captures
/local.properties
43 changes: 29 additions & 14 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import org.gradle.internal.os.OperatingSystem;

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
//options.compilerArgs << "-Xlint:deprecation"
}

def buildAsLibrary = project.hasProperty('BUILD_AS_LIBRARY');
def buildAsApplication = !buildAsLibrary
if (buildAsApplication) {
Expand Down Expand Up @@ -48,9 +53,7 @@ switch(OperatingSystem.current()) {
}

android {
compileSdkVersion 26
buildToolsVersion "28.0.1"

compileSdkVersion 28

if(OperatingSystem.current().isLinux()) {
exec {
Expand All @@ -66,21 +69,33 @@ android {
}

defaultConfig {
minSdkVersion 14
targetSdkVersion 26
minSdkVersion 21
targetSdkVersion 28
versionCode Integer.valueOf(System.env.UPSTREAM_BUILD_NUMBER ?: 1 )
versionName new File('app/jni/src/version.h').text.split("\"")[1]
if (buildAsApplication) {
applicationId "com.cleverraven.cataclysmdda"
setProperty("archivesBaseName", "cataclysmdda-" + versionName)
}
ndk {
abiFilters "armeabi-v7a"
//abiFilters "x86" // use this for testing on emulators
}

splits {
// Configures multiple APKs based on ABI.
abi {
// Enables building multiple APKs per ABI.
enable true
// 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.
include "armeabi-v7a"
include "arm64-v8a"
// 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=android-21", "-j$njobs"
}
}
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -112,11 +127,11 @@ android {
}
}
}

debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

externalNativeBuild {
ndkBuild {

Expand All @@ -133,12 +148,12 @@ android {
path 'jni/Android.mk'
}
}

}
lintOptions {
abortOnError false
}

if (buildAsLibrary) {
libraryVariants.all { variant ->
variant.outputs.each { output ->
Expand Down
Binary file modified android/app/deps.zip
Binary file not shown.
7 changes: 2 additions & 5 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
android:versionName="1.0"
android:installLocation="auto">

<!-- Android 4.0.1 -->
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="24" />

<!-- OpenGL ES 2.0 -->
<uses-feature android:glEsVersion="0x00020000" />

Expand All @@ -24,7 +21,7 @@

<!-- Create a Java class extending SDLActivity and place it in a
directory under app/src/main/java matching the package, e.g. app/src/main/java/com/gamemaker/game/MyGame.java
then replace "SDLActivity" with the name of your class (e.g. "MyGame")
in the XML below.
Expand All @@ -40,7 +37,7 @@
<!-- Example of setting SDL hints from AndroidManifest.xml:
<meta-data android:name="SDL_ENV.SDL_ACCELEROMETER_AS_JOYSTICK" android:value="0"/>
-->

<activity android:name="SplashScreen"
android:label="@string/app_name"
android:launchMode="singleInstance"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected void onCreate(Bundle savedInstanceState) {
startGameActivity(false);
}
else {
new InstallProgramTask().execute();
new InstallProgramTask().execute();
}
}

Expand Down Expand Up @@ -114,14 +114,14 @@ private class InstallProgramTask extends AsyncTask<Void, Integer, Boolean> {
@Override
protected void onPreExecute() {
installationAlert = new AlertDialog.Builder(SplashScreen.this)
.setTitle("Installation Failed")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
SplashScreen.this.finish();
return;
}
}).create();
.setTitle("Installation Failed")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
SplashScreen.this.finish();
return;
}
}).create();
AssetManager assetManager = getAssets();
try {
totalFiles = countTotalAssets(assetManager, "data") +
Expand Down Expand Up @@ -162,22 +162,22 @@ protected Boolean doInBackground(Void... params) {
AssetManager assetManager = getAssets();
String externalFilesDir = getExternalFilesDir(null).getPath();

try {
// Clear out the old data if it exists (but preserve custom folders + files)
deleteRecursive(assetManager, externalFilesDir, new File(externalFilesDir + "/data"));
deleteRecursive(assetManager, externalFilesDir, new File(externalFilesDir + "/gfx"));
deleteRecursive(assetManager, externalFilesDir, new File(externalFilesDir + "/lang"));

// Install the new data over the top
copyAssetFolder(assetManager, "data", externalFilesDir + "/data");
copyAssetFolder(assetManager, "gfx", externalFilesDir + "/gfx");
copyAssetFolder(assetManager, "lang", externalFilesDir + "/lang");
try {
// Clear out the old data if it exists (but preserve custom folders + files)
deleteRecursive(assetManager, externalFilesDir, new File(externalFilesDir + "/data"));
deleteRecursive(assetManager, externalFilesDir, new File(externalFilesDir + "/gfx"));
deleteRecursive(assetManager, externalFilesDir, new File(externalFilesDir + "/lang"));

// Install the new data over the top
copyAssetFolder(assetManager, "data", externalFilesDir + "/data");
copyAssetFolder(assetManager, "gfx", externalFilesDir + "/gfx");
copyAssetFolder(assetManager, "lang", externalFilesDir + "/lang");
} catch(Exception e) {
installationAlert.setMessage(e.getMessage());
return false;
installationAlert.setMessage(e.getMessage());
return false;
}

// Remember which version the installed data is
// Remember which version the installed data is
PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putString("installed", getVersionName()).commit();

publishProgress(++installedFiles);
Expand Down Expand Up @@ -212,14 +212,14 @@ void deleteRecursive(AssetManager assetManager, String externalFilesDir, File fi
// Returns true if an asset exists in the APK (either a directory or a file)
// eg. assetExists("data/sound") or assetExists("data/font", "unifont.ttf") would both return true
private boolean assetExists(AssetManager assetManager, String assetPath) {
return assetExists(assetManager, assetPath, "");
return assetExists(assetManager, assetPath, "");
}

private boolean assetExists(AssetManager assetManager, String assetPath, String assetName) {
try {
String[] files = assetManager.list(assetPath);
if (assetName.isEmpty())
return files.length > 0; // folder exists
return files.length > 0; // folder exists
for (String file : files) {
if (file.equalsIgnoreCase(assetName))
return true; // file exists
Expand Down Expand Up @@ -312,11 +312,11 @@ protected void onProgressUpdate(Integer... values) {
@Override
protected void onPostExecute(Boolean result) {
removeDialog(INSTALL_DIALOG_ID);
if(result) {
if(result) {
settingsAlert.show();
} else {
installationAlert.show();
}
} else {
installationAlert.show();
}
}
}
}
Loading

0 comments on commit 846a688

Please sign in to comment.