1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73</* Minetest Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifthapply plugin: 'com.android.application' android { compileSdkVersion 29 buildToolsVersion '29.0.3' ndkVersion '21.1.6352462' defaultConfig { applicationId 'net.minetest.minetest' minSdkVersion 16 targetSdkVersion 29 versionName "${versionMajor}.${versionMinor}.${versionPatch}" versionCode project.versionCode } Properties props = new Properties() props.load(new FileInputStream(file('../local.properties'))) if (props.getProperty('keystore') != null) { signingConfigs { release { storeFile file(props['keystore']) storePassword props['keystore.password'] keyAlias props['key'] keyPassword props['key.password'] } } buildTypes { release { minifyEnabled true signingConfig signingConfigs.release } } } // for multiple APKs splits { abi { enable true reset() include 'armeabi-v7a', 'arm64-v8a' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } task prepareAssets() { def assetsFolder = "build/assets" def projRoot = "../../.." def gameToCopy = "minetest_game" copy { from "${projRoot}/minetest.conf.example", "${projRoot}/README.md" into assetsFolder } copy { from "${projRoot}/doc/lgpl-2.1.txt" into "${assetsFolder}" rename("lgpl-2.1.txt", "LICENSE.txt") } copy { from "${projRoot}/builtin" into "${assetsFolder}/builtin" } /*copy { // ToDo: fix Minetest shaders that currently don't work with OpenGL ES from "${projRoot}/client/shaders" into "${assetsFolder}/client/shaders" }*/ copy { from "../native/deps/Android/Irrlicht/shaders" into "${assetsFolder}/client/shaders/Irrlicht" } copy { from "${projRoot}/fonts" include "*.ttf" into "${assetsFolder}/fonts" } copy { from "${projRoot}/games/${gameToCopy}" into "${assetsFolder}/games/${gameToCopy}" } /*copy { // ToDo: fix broken locales from "${projRoot}/po" into "${assetsFolder}/po" }*/ copy { from "${projRoot}/textures" into "${assetsFolder}/textures" } task zipAssets(type: Zip) { archiveName "Minetest.zip" from "${assetsFolder}" destinationDir file("src/main/assets") } } preBuild.dependsOn zipAssets // 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.1.0' }