Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/minetest/minetest into Fi…
Browse files Browse the repository at this point in the history
…x_hovering_missing_bug_master
  • Loading branch information
Mahoyomu committed Oct 7, 2024
2 parents f3a32c2 + 1037ee2 commit 4f462c5
Show file tree
Hide file tree
Showing 594 changed files with 16,565 additions and 17,519 deletions.
9 changes: 8 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
[*]
end_of_line = lf

[*.{cpp,h,lua,txt,glsl,md,c,cmake,java,gradle}]
[*.{cpp,h,lua,txt,glsl,c,cmake,java,gradle}]
charset = utf-8
indent_size = 4
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
charset = utf-8
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
7 changes: 6 additions & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ jobs:
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gettext openjdk-17-jdk-headless
sudo apt-get install -y --no-install-recommends gettext
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Build AAB with Gradle
# We build an AAB as well for uploading to the the Play Store.
run: cd android; ./gradlew bundlerelease
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps clang-7 llvm
install_linux_deps clang-7 llvm-7
- name: Build
run: |
Expand All @@ -102,6 +102,11 @@ jobs:
run: |
./bin/minetest --run-unittests
# Do this here because we have ASan and error paths are sensitive to dangling pointers
- name: Test error cases
run: |
./util/test_error_cases.sh
# Current clang version
clang_18:
runs-on: ubuntu-24.04
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lua.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: Integration test + devtest
run: |
./util/test_multiplayer.sh
serverconf="profiler.load=true" ./util/test_multiplayer.sh
luacheck:
name: "Builtin Luacheck and Unit Tests"
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- 'irr/**.mm' # Objective-C(++)
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- '.github/workflows/macos.yml'
Expand All @@ -28,7 +29,8 @@ on:

jobs:
build:
runs-on: macos-latest
# use lowest possible macOS running on x86_64 supported by brew to support more users
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Install deps
Expand Down Expand Up @@ -58,6 +60,7 @@ jobs:
- name: CPack
run: |
cd build
rm -rf macos
cmake .. -DINSTALL_DEVTEST=FALSE
cpack -G ZIP -B macos
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/whitespace_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: whitespace_checks

# Check whitespaces of the following file types
# Not checked: .lua, .yml, .properties, .conf, .java, .py, .svg, .gradle, .xml, ...
# (luacheck already checks .lua files)
on:
push:
paths:
- '**.txt'
- '**.md'
- '**.[ch]'
- '**.cpp'
- '**.hpp'
- '**.sh'
- '**.cmake'
- '**.glsl'
pull_request:
paths:
- '**.txt'
- '**.md'
- '**.[ch]'
- '**.cpp'
- '**.hpp'
- '**.sh'
- '**.cmake'
- '**.glsl'

jobs:
trailing_whitespaces:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Line endings are already ensured by .gitattributes
- name: Check trailing whitespaces
run: if git ls-files | grep -E '\.txt$|\.md$|\.[ch]$|\.cpp$|\.hpp$|\.sh$|\.cmake$|\.glsl$' | xargs grep -n '\s$'; then echo -e "\033[0;31mFound trailing whitespace"; (exit 1); else (exit 0); fi

tabs_lua_api_files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Some files should not contain tabs
- name: Check tabs in Lua API files
run: if grep -n $'\t' doc/lua_api.md doc/client_lua_api.md; then echo -e "\033[0;31mFound tab in markdown file"; (exit 1); else (exit 0); fi


7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ tags
!tags/
gtags.files
.idea
.qtcreator/
# Codelite
*.project
# Visual Studio Code & plugins
Expand All @@ -43,6 +44,10 @@ build/.cmake/
*.zsync
appimage-build
AppDir
# Direnv
.direnv/
# Nix
/result

## Files related to Minetest development cycle
/*.patch
Expand Down Expand Up @@ -105,6 +110,8 @@ src/cmake_config_githash.h
*.layout
*.o
*.a
*.dump
*.dmp
*.ninja
.ninja*
*.gch
Expand Down
10 changes: 8 additions & 2 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ read_globals = {
"PerlinNoise", "PerlinNoiseMap",

string = {fields = {"split", "trim"}},
table = {fields = {"copy", "getn", "indexof", "insert_all"}},
table = {fields = {"copy", "getn", "indexof", "keyof", "insert_all"}},
math = {fields = {"hypot", "round"}},
}

Expand All @@ -37,6 +37,12 @@ files["builtin/client/register.lua"] = {
}
}

files["builtin/common/math.lua"] = {
globals = {
"math",
},
}

files["builtin/common/misc_helpers.lua"] = {
globals = {
"dump", "dump2", "table", "math", "string",
Expand All @@ -46,7 +52,7 @@ files["builtin/common/misc_helpers.lua"] = {
}

files["builtin/common/vector.lua"] = {
globals = { "vector" },
globals = { "vector", "math" },
}

files["builtin/game/voxelarea.lua"] = {
Expand Down
25 changes: 24 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set(CLANG_MINIMUM_VERSION "7.0.1")

# You should not need to edit these manually, use util/bump_version.sh
set(VERSION_MAJOR 5)
set(VERSION_MINOR 9)
set(VERSION_MINOR 10)
set(VERSION_PATCH 0)
set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")

Expand Down Expand Up @@ -56,6 +56,11 @@ if((WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR APPLE)
endif()
set(ENABLE_LTO ${DEFAULT_ENABLE_LTO} CACHE BOOL "Use Link Time Optimization")

set(BUILD_WITH_TRACY FALSE CACHE BOOL
"Fetch and build with the Tracy profiler client")
set(FETCH_TRACY_GIT_TAG "master" CACHE STRING
"Git tag for fetching Tracy client. Match with your server (gui) version")

set(DEFAULT_RUN_IN_PLACE FALSE)
if(WIN32)
set(DEFAULT_RUN_IN_PLACE TRUE)
Expand Down Expand Up @@ -283,6 +288,8 @@ if(BUILD_UNITTESTS OR BUILD_BENCHMARKS)
add_subdirectory(lib/catch2)
endif()

add_subdirectory(lib/tiniergltf)

# Subdirectories
# Be sure to add all relevant definitions above this
add_subdirectory(src)
Expand Down Expand Up @@ -368,3 +375,19 @@ if(BUILD_DOCUMENTATION)
)
endif()
endif()

# Fetch Tracy
if(BUILD_WITH_TRACY)
include(FetchContent)

message(STATUS "Fetching Tracy (${FETCH_TRACY_GIT_TAG})...")
FetchContent_Declare(
tracy
GIT_REPOSITORY https://github.com/wolfpld/tracy.git
GIT_TAG ${FETCH_TRACY_GIT_TAG}
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable(tracy)
message(STATUS "Fetching Tracy - done")
endif()
3 changes: 0 additions & 3 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,10 @@ srifqi:
textures/base/pack/minimap_btn.png

Zughy:
textures/base/pack/cdb_add.png
textures/base/pack/cdb_downloading.png
textures/base/pack/cdb_queued.png
textures/base/pack/cdb_update.png
textures/base/pack/cdb_update_cropped.png
textures/base/pack/cdb_viewonline.png
textures/base/pack/settings_btn.png
textures/base/pack/settings_info.png
textures/base/pack/settings_reset.png
Expand All @@ -79,7 +77,6 @@ kilbith:
textures/base/pack/progress_bar_bg.png

SmallJoker:
textures/base/pack/cdb_clear.png
textures/base/pack/server_favorite_delete.png (based on server_favorite.png)

DS:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ Command-line options
Compiling
---------

- [Compiling - common information](doc/compiling/README.md)
- [Compiling on GNU/Linux](doc/compiling/linux.md)
- [Compiling on Windows](doc/compiling/windows.md)
- [Compiling on MacOS](doc/compiling/macos.md)
Expand Down
24 changes: 8 additions & 16 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 33
buildToolsVersion '33.0.2'
ndkVersion "$ndk_version"
defaultConfig {
applicationId 'net.minetest.minetest'
minSdkVersion 21
targetSdkVersion 33
compileSdk 34
targetSdkVersion 34
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
versionCode project.versionCode
versionCode versionMajor * 1000000 + versionMinor * 10000 + versionPatch * 100 + versionBuild
}

buildFeatures {
buildConfig true
}

// load properties
Expand Down Expand Up @@ -49,6 +52,7 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
namespace 'net.minetest.minetest'
}

task prepareAssets() {
Expand Down Expand Up @@ -112,18 +116,6 @@ clean {
delete new File("src/main/assets", "Minetest.zip")
}

// Map for the version code that gives each ABI a value.
import com.android.build.OutputFile

def abiCodes = ['armeabi-v7a': 0, 'arm64-v8a': 1]
android.applicationVariants.all { variant ->
variant.outputs.each {
output ->
def abiName = output.getFilter(OutputFile.ABI)
output.versionCodeOverride = abiCodes.get(abiName, 0) + variant.versionCode
}
}

dependencies {
implementation project(':native')
implementation 'androidx.appcompat:appcompat:1.6.1'
Expand Down
3 changes: 1 addition & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="net.minetest.minetest"
android:installLocation="auto">
android:installLocation="auto">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

package net.minetest.minetest;

import android.annotation.SuppressLint;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
Expand Down Expand Up @@ -83,13 +84,18 @@ public void onReceive(Context context, Intent intent) {
}
};

@SuppressLint("UnspecifiedRegisterReceiverFlag")
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

IntentFilter filter = new IntentFilter(ACTION_UPDATE);
registerReceiver(myReceiver, filter);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
registerReceiver(myReceiver, filter, RECEIVER_NOT_EXPORTED);
} else {
registerReceiver(myReceiver, filter);
}

mProgressBar = findViewById(R.id.progressBar);
mTextView = findViewById(R.id.textView);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ boolean recursivelyDeleteDirectory(@NonNull File loc) {

private void publishProgress(@Nullable Notification.Builder notificationBuilder, @StringRes int message, int progress) {
Intent intentUpdate = new Intent(ACTION_UPDATE);
intentUpdate.setPackage(getPackageName());
intentUpdate.putExtra(ACTION_PROGRESS, progress);
intentUpdate.putExtra(ACTION_PROGRESS_MESSAGE, message);
if (!isSuccess)
Expand Down
11 changes: 5 additions & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

project.ext.set("versionMajor", 5) // Version Major
project.ext.set("versionMinor", 9) // Version Minor
project.ext.set("versionMinor", 10) // Version Minor
project.ext.set("versionPatch", 0) // Version Patch
// ^ keep in sync with cmake
project.ext.set("versionCode", 46) // Android Version Code
// NOTE: +2 after each release!
// +1 for ARM and +1 for ARM64 APK's, because
// each APK must have a larger `versionCode` than the previous

project.ext.set("versionBuild", 0) // Version Build
// ^ fourth version number to allow releasing Android-only fixes and beta versions

buildscript {
ext.ndk_version = '26.2.11394342'
Expand All @@ -16,7 +15,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.1'
classpath 'com.android.tools.build:gradle:8.5.1'
classpath 'de.undercouch:gradle-download-task:4.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
Loading

0 comments on commit 4f462c5

Please sign in to comment.