1 apply plugin: 'com.android.application'
4 buildToolsVersion '29.0.3'
5 ndkVersion '21.0.6113669'
7 applicationId 'net.minetest.minetest'
9 //noinspection OldTargetApi
10 targetSdkVersion 28 // Workaround for using `/sdcard` instead of the `data` patch for assets
11 versionName "${versionMajor}.${versionMinor}.${versionPatch}"
12 versionCode project.versionCode
15 Properties props = new Properties()
16 props.load(new FileInputStream(file('../local.properties')))
18 if (props.getProperty('keystore') != null) {
21 storeFile file(props['keystore'])
22 storePassword props['keystore.password']
24 keyPassword props['key.password']
31 signingConfig signingConfigs.release
41 include 'armeabi-v7a', 'arm64-v8a'
46 sourceCompatibility JavaVersion.VERSION_1_8
47 targetCompatibility JavaVersion.VERSION_1_8
51 task prepareAssets() {
52 def assetsFolder = "build/assets"
53 def projRoot = "../../.."
54 def gameToCopy = "minetest_game"
57 from "${projRoot}/minetest.conf.example", "${projRoot}/README.md" into assetsFolder
60 from "${projRoot}/doc/lgpl-2.1.txt" into "${assetsFolder}"
61 rename("lgpl-2.1.txt", "LICENSE.txt")
64 from "${projRoot}/builtin" into "${assetsFolder}/builtin"
67 from "${projRoot}/client/shaders" into "${assetsFolder}/client/shaders"
70 from "${projRoot}/fonts" include "*.ttf" into "${assetsFolder}/fonts"
73 from "${projRoot}/games/${gameToCopy}" into "${assetsFolder}/games/${gameToCopy}"
76 // locales broken right now
78 from "${projRoot}/po" into "${assetsFolder}/po"
81 from "${projRoot}/textures" into "${assetsFolder}/textures"
84 task zipAssets(type: Zip) {
85 archiveName "Minetest.zip"
86 from "${assetsFolder}"
87 destinationDir file("src/main/assets")
91 preBuild.dependsOn zipAssets
93 // Map for the version code that gives each ABI a value.
94 import com.android.build.OutputFile
96 def abiCodes = ['armeabi-v7a': 0, 'arm64-v8a': 1]
97 android.applicationVariants.all { variant ->
98 variant.outputs.each {
100 def abiName = output.getFilter(OutputFile.ABI)
101 output.versionCodeOverride = abiCodes.get(abiName, 0) + variant.versionCode
106 implementation project(':native')
107 implementation 'androidx.appcompat:appcompat:1.1.0'