build.gradle 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. apply plugin: 'com.android.application'
  2. /*import org.apache.tools.ant.taskdefs.condition.Os*/
  3. android {
  4. compileSdkVersion 23
  5. buildToolsVersion "23.0.3"
  6. externalNativeBuild{
  7. ndkBuild{
  8. path './src/main/jni/Android.mk'
  9. }
  10. }
  11. defaultConfig {
  12. applicationId "com.garagegames.torque2d"
  13. minSdkVersion 16
  14. targetSdkVersion 23
  15. sourceSets.main {
  16. assets.srcDirs=[
  17. 'src/main/assets',
  18. 'src/main/game'
  19. ]
  20. // jni.srcDirs = ['../../../source/']
  21. // jniLibs.srcDir 'src/main/libs'
  22. }
  23. /* task buildNative(type: Exec, description: 'Compile JNI source via NDK') {
  24. def ndkDir = plugins.getPlugin('com.android.application').sdkHandler.getNdkFolder()
  25. def extension = (Os.isFamily(Os.FAMILY_WINDOWS))? '.cmd' : ''
  26. commandLine "$ndkDir/ndk-build" + extension,
  27. '-C', file('src/main/jni').absolutePath,
  28. '-j', Runtime.runtime.availableProcessors(),
  29. 'all',
  30. 'NDK_DEBUG=1'
  31. }*/
  32. /* task cleanNative(type: Exec, description: 'Clean JNI object files') {
  33. def ndkDir = plugins.getPlugin('com.android.application').sdkHandler.getNdkFolder()
  34. def extension = (Os.isFamily(Os.FAMILY_WINDOWS))? '.cmd' : ''
  35. commandLine "$ndkDir/ndk-build" + extension,
  36. '-C', file('src/main/jni').absolutePath,
  37. 'clean'
  38. }*/
  39. task copyGame(type: Copy, description: 'Copy torque scripts and modules'){
  40. from('../../../../'){
  41. include '**'
  42. exclude 'engine/**'
  43. exclude 'tools/**'
  44. exclude 'tutorials/**'
  45. exclude '.**'
  46. exclude '*.dll'
  47. exclude 'preferences.cs'
  48. exclude '*.md'
  49. exclude '*.app'
  50. exclude '*.bat'
  51. exclude '*.log'
  52. exclude '*.torsion'
  53. }
  54. into 'src/main/game'
  55. includeEmptyDirs = false
  56. }
  57. task wipeGame(type: Delete, description: 'Wipe android-specific copy of torque scripts and modules'){
  58. delete 'src/main/game/'
  59. }
  60. /*clean.dependsOn 'cleanNative'*/
  61. clean.dependsOn 'wipeGame'
  62. tasks.withType(JavaCompile) {
  63. compileTask -> compileTask.dependsOn copyGame
  64. }
  65. /*tasks.withType(JavaCompile) {
  66. compileTask -> compileTask.dependsOn buildNative
  67. }*/
  68. /*tasks.withType(com.android.build.gradle.tasks.NdkCompile){task->
  69. task.enabled = false
  70. }*/
  71. }
  72. buildTypes {
  73. release {
  74. minifyEnabled false
  75. }
  76. }
  77. }