1 apply plugin: 'com.android.application'
4 buildToolsVersion '29.0.3'
5 ndkVersion '21.2.6472646'
7 applicationId 'net.minetest.minetest'
10 versionName "${versionMajor}.${versionMinor}.${versionPatch}"
11 versionCode project.versionCode
14 Properties props = new Properties()
15 props.load(new FileInputStream(file('../local.properties')))
17 if (props.getProperty('keystore') != null) {
20 storeFile file(props['keystore'])
21 storePassword props['keystore.password']
23 keyPassword props['key.password']
30 signingConfig signingConfigs.release
40 include 'armeabi-v7a', 'arm64-v8a'
45 sourceCompatibility JavaVersion.VERSION_1_8
46 targetCompatibility JavaVersion.VERSION_1_8
50 task prepareAssets() {
51 def assetsFolder = "build/assets"
52 def projRoot = "../../.."
53 def gameToCopy = "minetest_game"
56 from "${projRoot}/minetest.conf.example", "${projRoot}/README.md" into assetsFolder
59 from "${projRoot}/doc/lgpl-2.1.txt" into "${assetsFolder}"
62 from "${projRoot}/builtin" into "${assetsFolder}/builtin"
65 // ToDo: fix Minetest shaders that currently don't work with OpenGL ES
66 from "${projRoot}/client/shaders" into "${assetsFolder}/client/shaders"
69 from "../native/deps/Android/Irrlicht/shaders" into "${assetsFolder}/client/shaders/Irrlicht"
72 from "${projRoot}/fonts" include "*.ttf" into "${assetsFolder}/fonts"
75 from "${projRoot}/games/${gameToCopy}" into "${assetsFolder}/games/${gameToCopy}"
78 // ToDo: fix broken locales
79 from "${projRoot}/po" into "${assetsFolder}/po"
82 from "${projRoot}/textures" into "${assetsFolder}/textures"
85 file("${assetsFolder}/.nomedia").text = "";
87 task zipAssets(type: Zip) {
88 archiveName "Minetest.zip"
89 from "${assetsFolder}"
90 destinationDir file("src/main/assets")
94 preBuild.dependsOn zipAssets
96 // Map for the version code that gives each ABI a value.
97 import com.android.build.OutputFile
99 def abiCodes = ['armeabi-v7a': 0, 'arm64-v8a': 1]
100 android.applicationVariants.all { variant ->
101 variant.outputs.each {
103 def abiName = output.getFilter(OutputFile.ABI)
104 output.versionCodeOverride = abiCodes.get(abiName, 0) + variant.versionCode
109 implementation project(':native')
110 implementation 'androidx.appcompat:appcompat:1.1.0'