mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 08:03:45 +01:00
Update Android to new dependency repo (#11690)
This commit is contained in:
parent
cef016d393
commit
4114e3047b
10
.github/workflows/android.yml
vendored
10
.github/workflows/android.yml
vendored
@ -21,15 +21,13 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Set up JDK 1.8
|
|
||||||
uses: actions/setup-java@v1
|
|
||||||
with:
|
|
||||||
java-version: 1.8
|
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
run: sudo apt-get update; sudo apt-get install -y --no-install-recommends gettext
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y --no-install-recommends gettext openjdk-11-jdk-headless
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
run: cd android; ./gradlew assemblerelease
|
run: cd android; ./gradlew assemblerelease
|
||||||
- name: Save armeabi artifact
|
- name: Save armeabi artifact
|
||||||
|
@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
|
|||||||
android {
|
android {
|
||||||
compileSdkVersion 29
|
compileSdkVersion 29
|
||||||
buildToolsVersion '30.0.3'
|
buildToolsVersion '30.0.3'
|
||||||
ndkVersion '22.0.7026061'
|
ndkVersion "$ndk_version"
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId 'net.minetest.minetest'
|
applicationId 'net.minetest.minetest'
|
||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
@ -68,7 +68,7 @@ task prepareAssets() {
|
|||||||
from "${projRoot}/client/shaders" into "${assetsFolder}/client/shaders"
|
from "${projRoot}/client/shaders" into "${assetsFolder}/client/shaders"
|
||||||
}
|
}
|
||||||
copy {
|
copy {
|
||||||
from "../native/deps/Android/Irrlicht/shaders" into "${assetsFolder}/client/shaders/Irrlicht"
|
from "../native/deps/armeabi-v7a/Irrlicht/Shaders" into "${assetsFolder}/client/shaders/Irrlicht"
|
||||||
}
|
}
|
||||||
copy {
|
copy {
|
||||||
from "${projRoot}/fonts" include "*.ttf" into "${assetsFolder}/fonts"
|
from "${projRoot}/fonts" include "*.ttf" into "${assetsFolder}/fonts"
|
||||||
@ -112,5 +112,5 @@ android.applicationVariants.all { variant ->
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation project(':native')
|
implementation project(':native')
|
||||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
implementation 'androidx.appcompat:appcompat:1.3.1'
|
||||||
}
|
}
|
||||||
|
@ -10,12 +10,13 @@ project.ext.set("versionCode", 32) // Android Version Code
|
|||||||
// each APK must have a larger `versionCode` than the previous
|
// each APK must have a larger `versionCode` than the previous
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
|
ext.ndk_version = '23.0.7599858'
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:4.1.1'
|
classpath 'com.android.tools.build:gradle:7.0.3'
|
||||||
classpath 'de.undercouch:gradle-download-task:4.1.1'
|
classpath 'de.undercouch:gradle-download-task:4.1.1'
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#Fri Jan 08 17:52:00 UTC 2020
|
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
|
||||||
|
@ -4,7 +4,7 @@ apply plugin: 'de.undercouch.download'
|
|||||||
android {
|
android {
|
||||||
compileSdkVersion 29
|
compileSdkVersion 29
|
||||||
buildToolsVersion '30.0.3'
|
buildToolsVersion '30.0.3'
|
||||||
ndkVersion '22.0.7026061'
|
ndkVersion "$ndk_version"
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
@ -50,53 +50,19 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get precompiled deps
|
// get precompiled deps
|
||||||
def folder = 'minetest_android_deps_binaries'
|
|
||||||
|
|
||||||
task downloadDeps(type: Download) {
|
task downloadDeps(type: Download) {
|
||||||
src 'https://github.com/minetest/' + folder + '/archive/master.zip'
|
src 'https://github.com/minetest/minetest_android_deps/releases/download/latest/deps.zip'
|
||||||
dest new File(buildDir, 'deps.zip')
|
dest new File(buildDir, 'deps.zip')
|
||||||
overwrite false
|
overwrite false
|
||||||
}
|
}
|
||||||
|
|
||||||
task getDeps(dependsOn: downloadDeps, type: Copy) {
|
task getDeps(dependsOn: downloadDeps, type: Copy) {
|
||||||
def deps = file('deps')
|
def deps = new File(buildDir.parent, 'deps')
|
||||||
def f = file("$buildDir/" + folder + "-master")
|
if (!deps.exists()) {
|
||||||
|
deps.mkdir()
|
||||||
if (!deps.exists() && !f.exists()) {
|
|
||||||
from zipTree(downloadDeps.dest)
|
from zipTree(downloadDeps.dest)
|
||||||
into buildDir
|
into deps
|
||||||
}
|
|
||||||
|
|
||||||
doLast {
|
|
||||||
if (!deps.exists()) {
|
|
||||||
file(f).renameTo(file(deps))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// get sqlite
|
|
||||||
def sqlite_ver = '3340000'
|
|
||||||
task downloadSqlite(dependsOn: getDeps, type: Download) {
|
|
||||||
src 'https://www.sqlite.org/2020/sqlite-amalgamation-' + sqlite_ver + '.zip'
|
|
||||||
dest new File(buildDir, 'sqlite.zip')
|
|
||||||
overwrite false
|
|
||||||
}
|
|
||||||
|
|
||||||
task getSqlite(dependsOn: downloadSqlite, type: Copy) {
|
|
||||||
def sqlite = file('deps/Android/sqlite')
|
|
||||||
def f = file("$buildDir/sqlite-amalgamation-" + sqlite_ver)
|
|
||||||
|
|
||||||
if (!sqlite.exists() && !f.exists()) {
|
|
||||||
from zipTree(downloadSqlite.dest)
|
|
||||||
into buildDir
|
|
||||||
}
|
|
||||||
|
|
||||||
doLast {
|
|
||||||
if (!sqlite.exists()) {
|
|
||||||
file(f).renameTo(file(sqlite))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
preBuild.dependsOn getDeps
|
preBuild.dependsOn getDeps
|
||||||
preBuild.dependsOn getSqlite
|
|
||||||
|
@ -4,62 +4,82 @@ LOCAL_PATH := $(call my-dir)/..
|
|||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := Curl
|
LOCAL_MODULE := Curl
|
||||||
LOCAL_SRC_FILES := deps/Android/Curl/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libcurl.a
|
LOCAL_SRC_FILES := deps/$(APP_ABI)/Curl/libcurl.a
|
||||||
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := libmbedcrypto
|
||||||
|
LOCAL_SRC_FILES := deps/$(APP_ABI)/Curl/libmbedcrypto.a
|
||||||
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := libmbedtls
|
||||||
|
LOCAL_SRC_FILES := deps/$(APP_ABI)/Curl/libmbedtls.a
|
||||||
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := libmbedx509
|
||||||
|
LOCAL_SRC_FILES := deps/$(APP_ABI)/Curl/libmbedx509.a
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := Freetype
|
LOCAL_MODULE := Freetype
|
||||||
LOCAL_SRC_FILES := deps/Android/Freetype/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libfreetype.a
|
LOCAL_SRC_FILES := deps/$(APP_ABI)/Freetype/libfreetype.a
|
||||||
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := Iconv
|
||||||
|
LOCAL_SRC_FILES := deps/$(APP_ABI)/Iconv/libiconv.a
|
||||||
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := libcharset
|
||||||
|
LOCAL_SRC_FILES := deps/$(APP_ABI)/Iconv/libcharset.a
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := Irrlicht
|
LOCAL_MODULE := Irrlicht
|
||||||
LOCAL_SRC_FILES := deps/Android/Irrlicht/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libIrrlichtMt.a
|
LOCAL_SRC_FILES := deps/$(APP_ABI)/Irrlicht/libIrrlichtMt.a
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
#include $(CLEAR_VARS)
|
|
||||||
#LOCAL_MODULE := LevelDB
|
|
||||||
#LOCAL_SRC_FILES := deps/Android/LevelDB/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libleveldb.a
|
|
||||||
#include $(PREBUILT_STATIC_LIBRARY)
|
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := LuaJIT
|
LOCAL_MODULE := LuaJIT
|
||||||
LOCAL_SRC_FILES := deps/Android/LuaJIT/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libluajit.a
|
LOCAL_SRC_FILES := deps/$(APP_ABI)/LuaJIT/libluajit.a
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
LOCAL_MODULE := mbedTLS
|
|
||||||
LOCAL_SRC_FILES := deps/Android/mbedTLS/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libmbedtls.a
|
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
LOCAL_MODULE := mbedx509
|
|
||||||
LOCAL_SRC_FILES := deps/Android/mbedTLS/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libmbedx509.a
|
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
LOCAL_MODULE := mbedcrypto
|
|
||||||
LOCAL_SRC_FILES := deps/Android/mbedTLS/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libmbedcrypto.a
|
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := OpenAL
|
LOCAL_MODULE := OpenAL
|
||||||
LOCAL_SRC_FILES := deps/Android/OpenAL-Soft/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libopenal.a
|
LOCAL_SRC_FILES := deps/$(APP_ABI)/OpenAL-Soft/libopenal.a
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := GetText
|
LOCAL_MODULE := Gettext
|
||||||
LOCAL_SRC_FILES := deps/Android/GetText/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libintl.a
|
LOCAL_SRC_FILES := deps/$(APP_ABI)/Gettext/libintl.a
|
||||||
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := SQLite3
|
||||||
|
LOCAL_SRC_FILES := deps/$(APP_ABI)/SQLite/libsqlite3.a
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := Vorbis
|
LOCAL_MODULE := Vorbis
|
||||||
LOCAL_SRC_FILES := deps/Android/Vorbis/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libvorbis.a
|
LOCAL_SRC_FILES := deps/$(APP_ABI)/Vorbis/libvorbis.a
|
||||||
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := libvorbisfile
|
||||||
|
LOCAL_SRC_FILES := deps/$(APP_ABI)/Vorbis/libvorbisfile.a
|
||||||
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := libogg
|
||||||
|
LOCAL_SRC_FILES := deps/$(APP_ABI)/Vorbis/libogg.a
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := Zstd
|
LOCAL_MODULE := Zstd
|
||||||
LOCAL_SRC_FILES := deps/Android/Zstd/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libzstd.a
|
LOCAL_SRC_FILES := deps/$(APP_ABI)/Zstd/libzstd.a
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
@ -96,18 +116,16 @@ LOCAL_C_INCLUDES := \
|
|||||||
../../src/script \
|
../../src/script \
|
||||||
../../lib/gmp \
|
../../lib/gmp \
|
||||||
../../lib/jsoncpp \
|
../../lib/jsoncpp \
|
||||||
deps/Android/Curl/include \
|
deps/$(APP_ABI)/Curl/include \
|
||||||
deps/Android/Freetype/include \
|
deps/$(APP_ABI)/Freetype/include/freetype2 \
|
||||||
deps/Android/Irrlicht/include \
|
deps/$(APP_ABI)/Irrlicht/include \
|
||||||
deps/Android/LevelDB/include \
|
deps/$(APP_ABI)/Gettext/include \
|
||||||
deps/Android/GetText/include \
|
deps/$(APP_ABI)/Iconv/include \
|
||||||
deps/Android/libiconv/include \
|
deps/$(APP_ABI)/LuaJIT/include \
|
||||||
deps/Android/libiconv/libcharset/include \
|
deps/$(APP_ABI)/OpenAL-Soft/include \
|
||||||
deps/Android/LuaJIT/src \
|
deps/$(APP_ABI)/SQLite/include \
|
||||||
deps/Android/OpenAL-Soft/include \
|
deps/$(APP_ABI)/Vorbis/include \
|
||||||
deps/Android/sqlite \
|
deps/$(APP_ABI)/Zstd/include
|
||||||
deps/Android/Vorbis/include \
|
|
||||||
deps/Android/Zstd/include
|
|
||||||
|
|
||||||
LOCAL_SRC_FILES := \
|
LOCAL_SRC_FILES := \
|
||||||
$(wildcard ../../src/client/*.cpp) \
|
$(wildcard ../../src/client/*.cpp) \
|
||||||
@ -190,24 +208,24 @@ LOCAL_SRC_FILES := \
|
|||||||
../../src/voxel.cpp \
|
../../src/voxel.cpp \
|
||||||
../../src/voxelalgorithms.cpp
|
../../src/voxelalgorithms.cpp
|
||||||
|
|
||||||
# LevelDB backend is disabled
|
|
||||||
# ../../src/database/database-leveldb.cpp
|
|
||||||
|
|
||||||
# GMP
|
# GMP
|
||||||
LOCAL_SRC_FILES += ../../lib/gmp/mini-gmp.c
|
LOCAL_SRC_FILES += ../../lib/gmp/mini-gmp.c
|
||||||
|
|
||||||
# JSONCPP
|
# JSONCPP
|
||||||
LOCAL_SRC_FILES += ../../lib/jsoncpp/jsoncpp.cpp
|
LOCAL_SRC_FILES += ../../lib/jsoncpp/jsoncpp.cpp
|
||||||
|
|
||||||
# iconv
|
LOCAL_STATIC_LIBRARIES += \
|
||||||
LOCAL_SRC_FILES += \
|
Curl libmbedcrypto libmbedtls libmbedx509 \
|
||||||
deps/Android/libiconv/lib/iconv.c \
|
Freetype \
|
||||||
deps/Android/libiconv/libcharset/lib/localcharset.c
|
Iconv libcharset \
|
||||||
|
Irrlicht \
|
||||||
# SQLite3
|
LuaJIT \
|
||||||
LOCAL_SRC_FILES += deps/Android/sqlite/sqlite3.c
|
OpenAL \
|
||||||
|
Gettext \
|
||||||
LOCAL_STATIC_LIBRARIES += Curl Freetype Irrlicht OpenAL mbedTLS mbedx509 mbedcrypto Vorbis LuaJIT GetText Zstd android_native_app_glue $(PROFILER_LIBS) #LevelDB
|
SQLite3 \
|
||||||
|
Vorbis libvorbisfile libogg \
|
||||||
|
Zstd
|
||||||
|
LOCAL_STATIC_LIBRARIES += android_native_app_glue $(PROFILER_LIBS)
|
||||||
|
|
||||||
LOCAL_LDLIBS := -lEGL -lGLESv1_CM -lGLESv2 -landroid -lOpenSLES
|
LOCAL_LDLIBS := -lEGL -lGLESv1_CM -lGLESv2 -landroid -lOpenSLES
|
||||||
|
|
||||||
|
@ -5,22 +5,22 @@ NDK_TOOLCHAIN_VERSION := clang
|
|||||||
APP_SHORT_COMMANDS := true
|
APP_SHORT_COMMANDS := true
|
||||||
APP_MODULES := Minetest
|
APP_MODULES := Minetest
|
||||||
|
|
||||||
APP_CPPFLAGS := -Ofast -fvisibility=hidden -fexceptions -Wno-deprecated-declarations -Wno-extra-tokens
|
APP_CPPFLAGS := -O2 -fvisibility=hidden
|
||||||
|
|
||||||
ifeq ($(APP_ABI),armeabi-v7a)
|
ifeq ($(APP_ABI),armeabi-v7a)
|
||||||
APP_CPPFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb
|
APP_CPPFLAGS += -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#ifeq ($(APP_ABI),x86)
|
ifeq ($(APP_ABI),x86)
|
||||||
#APP_CPPFLAGS += -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32 -funroll-loops
|
APP_CPPFLAGS += -mssse3 -mfpmath=sse -funroll-loops
|
||||||
#endif
|
endif
|
||||||
|
|
||||||
ifndef NDEBUG
|
ifndef NDEBUG
|
||||||
APP_CPPFLAGS := -g -D_DEBUG -O0 -fno-omit-frame-pointer -fexceptions
|
APP_CPPFLAGS := -g -Og -fno-omit-frame-pointer
|
||||||
endif
|
endif
|
||||||
|
|
||||||
APP_CFLAGS := $(APP_CPPFLAGS) -Wno-parentheses-equality #-Werror=shorten-64-to-32
|
APP_CFLAGS := $(APP_CPPFLAGS) -Wno-inconsistent-missing-override -Wno-parentheses-equality
|
||||||
APP_CXXFLAGS := $(APP_CPPFLAGS) -frtti -std=gnu++17
|
APP_CXXFLAGS := $(APP_CPPFLAGS) -fexceptions -frtti -std=gnu++17
|
||||||
APP_LDFLAGS := -Wl,--no-warn-mismatch,--gc-sections,--icf=safe
|
APP_LDFLAGS := -Wl,--no-warn-mismatch,--gc-sections,--icf=safe
|
||||||
|
|
||||||
ifeq ($(APP_ABI),arm64-v8a)
|
ifeq ($(APP_ABI),arm64-v8a)
|
||||||
|
Loading…
Reference in New Issue
Block a user