build.gradle 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. buildscript {
  2. repositories {
  3. google()
  4. jcenter()
  5. }
  6. dependencies {
  7. classpath 'com.android.tools.build:gradle:3.5.1'
  8. }
  9. }
  10. allprojects {
  11. repositories {
  12. google()
  13. jcenter()
  14. }
  15. }
  16. def curl_version = "7.60.0"
  17. def irrlicht_revision = "5150"
  18. def openal_version = "1.18.2"
  19. def openssl_version = "1.0.2n"
  20. def sqlite3_version = "3240000"
  21. apply plugin: "com.android.application"
  22. android {
  23. compileSdkVersion 29
  24. buildToolsVersion '29.0.2'
  25. defaultConfig {
  26. versionCode 25
  27. versionName "${System.env.VERSION_STR}.${versionCode}"
  28. minSdkVersion 14
  29. targetSdkVersion 29
  30. applicationId "net.minetest.minetest"
  31. manifestPlaceholders = [package: "net.minetest.minetest", project: project.name]
  32. ndk {
  33. // Specifies the ABI configurations of your native
  34. // libraries Gradle should build and package with your APK.
  35. // abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
  36. abiFilters 'armeabi-v7a', 'x86', 'arm64-v8a'
  37. }
  38. }
  39. compileOptions {
  40. sourceCompatibility JavaVersion.VERSION_1_8
  41. targetCompatibility JavaVersion.VERSION_1_8
  42. }
  43. lintOptions {
  44. disable "OldTargetApi", "GoogleAppIndexingWarning"
  45. }
  46. Properties props = new Properties()
  47. props.load(new FileInputStream(file("local.properties")))
  48. if (props.getProperty("keystore") != null) {
  49. signingConfigs {
  50. release {
  51. storeFile file(props["keystore"])
  52. storePassword props["keystore.password"]
  53. keyAlias props["key"]
  54. keyPassword props["key.password"]
  55. }
  56. }
  57. buildTypes {
  58. release {
  59. signingConfig signingConfigs.release
  60. }
  61. }
  62. }
  63. }
  64. task cleanAssets(type: Delete) {
  65. delete 'src/main/assets'
  66. }
  67. task copyAssets {
  68. dependsOn 'cleanAssets'
  69. mkdir "src/main/assets"
  70. def mtAssetsFolder = "src/main/assets/Minetest"
  71. def projRoot = "../.."
  72. def gameToCopy = "minetest_game"
  73. doLast {
  74. mkdir "${mtAssetsFolder}"
  75. mkdir "${mtAssetsFolder}/client"
  76. mkdir "${mtAssetsFolder}/fonts"
  77. mkdir "${mtAssetsFolder}/games"
  78. mkdir "${mtAssetsFolder}/media"
  79. copy {
  80. from "${projRoot}/minetest.conf.example", "${projRoot}/README.md" into mtAssetsFolder
  81. }
  82. copy {
  83. from "${projRoot}/doc/lgpl-2.1.txt" into "${mtAssetsFolder}/LICENSE.txt"
  84. }
  85. copy {
  86. from "${projRoot}/builtin" into "${mtAssetsFolder}/builtin"
  87. }
  88. copy {
  89. from "${projRoot}/client/shaders" into "${mtAssetsFolder}/client/shaders"
  90. }
  91. copy {
  92. from "${projRoot}/fonts" include "*.ttf" into "${mtAssetsFolder}/fonts"
  93. }
  94. copy {
  95. from "${projRoot}/games/${gameToCopy}" into "${mtAssetsFolder}/games/${gameToCopy}"
  96. }
  97. copy {
  98. from "${projRoot}/po" into "${mtAssetsFolder}/po"
  99. }
  100. copy {
  101. from "${projRoot}/textures" into "${mtAssetsFolder}/textures"
  102. }
  103. }
  104. }
  105. task cleanIconv(type: Delete) {
  106. delete 'deps/libiconv'
  107. }
  108. task cleanIrrlicht(type: Delete) {
  109. delete 'deps/irrlicht'
  110. }
  111. task cleanLevelDB(type: Delete) {
  112. delete 'deps/leveldb'
  113. }
  114. task cleanCURL(type: Delete) {
  115. delete 'deps/curl'
  116. delete 'deps/curl-' + curl_version
  117. }
  118. task cleanOpenSSL(type: Delete) {
  119. delete 'deps/openssl'
  120. delete 'deps/openssl-' + openssl_version
  121. delete 'deps/openssl-' + openssl_version + '.tar.gz'
  122. }
  123. task cleanOpenAL(type: Delete) {
  124. delete 'deps/openal-soft'
  125. }
  126. task cleanFreetype(type: Delete) {
  127. delete 'deps/freetype2-android'
  128. }
  129. task cleanOgg(type: Delete) {
  130. delete 'deps/libvorbis-libogg-android'
  131. }
  132. task cleanSQLite3(type: Delete) {
  133. delete 'deps/sqlite-amalgamation-' + sqlite3_version
  134. delete 'deps/sqlite-amalgamation-' + sqlite3_version + '.zip'
  135. }
  136. task cleanAll(type: Delete, dependsOn: [clean, cleanAssets, cleanIconv,
  137. cleanFreetype, cleanIrrlicht, cleanLevelDB, cleanSQLite3, cleanCURL,
  138. cleanOpenSSL, cleanOpenAL, cleanOgg]) {
  139. delete 'deps'
  140. delete 'gen'
  141. delete 'libs'
  142. delete 'obj'
  143. delete 'bin'
  144. delete 'Debug'
  145. delete 'and_env'
  146. }
  147. dependencies {
  148. implementation 'androidx.core:core:1.1.0'
  149. }