1 apply plugin: 'com.android.application'
5 buildToolsVersion '33.0.2'
6 ndkVersion "$ndk_version"
8 applicationId 'net.minetest.minetest'
11 versionName "${versionMajor}.${versionMinor}.${versionPatch}"
12 versionCode project.versionCode
16 Properties props = new Properties()
17 def propfile = file('../local.properties')
18 if (propfile.exists())
19 props.load(new FileInputStream(propfile))
21 if (props.getProperty('keystore') != null) {
24 storeFile file(props['keystore'])
25 storePassword props['keystore.password']
27 keyPassword props['key.password']
34 signingConfig signingConfigs.release
44 include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
49 sourceCompatibility JavaVersion.VERSION_1_8
50 targetCompatibility JavaVersion.VERSION_1_8
54 task prepareAssets() {
55 def assetsFolder = "build/assets"
56 def projRoot = "../.."
57 def gameToCopy = "minetest_game"
60 from "${projRoot}/minetest.conf.example", "${projRoot}/README.md" into assetsFolder
63 from "${projRoot}/doc/lgpl-2.1.txt" into "${assetsFolder}"
66 from "${projRoot}/builtin" into "${assetsFolder}/builtin"
69 from "${projRoot}/client/shaders" into "${assetsFolder}/client/shaders"
72 from "../native/deps/armeabi-v7a/Irrlicht/Shaders" into "${assetsFolder}/client/shaders/Irrlicht"
75 from "${projRoot}/fonts" include "*.ttf" into "${assetsFolder}/fonts"
78 from "${projRoot}/games/${gameToCopy}" into "${assetsFolder}/games/${gameToCopy}"
80 fileTree("${projRoot}/po").include("**/*.po").forEach { poFile ->
81 def moPath = "${assetsFolder}/locale/${poFile.parentFile.name}/LC_MESSAGES/"
84 commandLine 'msgfmt', '-o', "${moPath}/minetest.mo", poFile
88 from "${projRoot}/textures" into "${assetsFolder}/textures"
91 file("${assetsFolder}/.nomedia").text = ""
93 task zipAssets(type: Zip) {
94 archiveFileName = "Minetest.zip"
95 from "${assetsFolder}"
96 destinationDirectory = file("src/main/assets")
100 preBuild.dependsOn zipAssets
102 // Map for the version code that gives each ABI a value.
103 import com.android.build.OutputFile
105 def abiCodes = ['armeabi-v7a': 0, 'arm64-v8a': 1]
106 android.applicationVariants.all { variant ->
107 variant.outputs.each {
109 def abiName = output.getFilter(OutputFile.ABI)
110 output.versionCodeOverride = abiCodes.get(abiName, 0) + variant.versionCode
115 implementation project(':native')
116 implementation 'androidx.appcompat:appcompat:1.6.1'