build.gradle 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. //apply plugin:'application'
  2. if (!hasProperty('mainClass')) {
  3. ext.mainClass = 'jme3test.TestChooser'
  4. }
  5. task run(dependsOn: 'build', type:JavaExec) {
  6. main = mainClass
  7. classpath = sourceSets.main.runtimeClasspath
  8. if (System.properties['java.util.logging.config.file'] != null) {
  9. systemProperty "java.util.logging.config.file", System.properties['java.util.logging.config.file']
  10. }
  11. if( assertions == "true" ){
  12. enableAssertions = true;
  13. }
  14. }
  15. dependencies {
  16. compile project(':jme3-core')
  17. compile project(':jme3-desktop')
  18. compile project(':jme3-effects')
  19. // EITHER use jme3-bullet + jme3-bullet-native OR ELSE jme3-jbullet
  20. compile project(':jme3-bullet')
  21. compile project(':jme3-bullet-native')
  22. // compile project(':jme3-jbullet')
  23. compile project(':jme3-jogg')
  24. compile project(':jme3-lwjgl')
  25. // compile project(':jme3-lwjgl3')
  26. compile project(':jme3-networking')
  27. compile project(':jme3-niftygui')
  28. compile project(':jme3-plugins')
  29. compile project(':jme3-terrain')
  30. compile project(':jme3-testdata')
  31. }
  32. jar.doFirst{
  33. manifest {
  34. attributes('Manifest-Version' : '1.0',
  35. // 'Created-By' : vendor,
  36. // 'Specification-Title' : appName,
  37. // 'Specification-Version' : jmeVersion,
  38. // 'Specification-Vendor' : "jMonkeyEngine",
  39. // 'Implementation-Title' : appName,
  40. // 'Implementation-Version' : version,
  41. // 'Implementation-Vendor' : vendor,
  42. 'Main-Class' : getProperty('mainClass'),
  43. // Add dependencies to manifest, remove version
  44. 'Class-Path' : configurations.compile.resolvedConfiguration.resolvedArtifacts.collect {
  45. 'lib/' +
  46. it.name +
  47. (it.classifier != null ? '-' + it.classifier : '') +
  48. '.' + it.extension }.join(' ')
  49. )
  50. }
  51. }
  52. task dist (dependsOn: ['build', ':jme3-bullet:jar', ':jme3-android:jar', \
  53. ':jme3-android-native:jar', ':jme3-bullet-native-android:jar', \
  54. ':jme3-bullet-native:jar']) {
  55. doLast {
  56. // Copy all dependencies to ../dist/lib, remove versions from jar files
  57. configurations.compile.resolvedConfiguration.resolvedArtifacts.each { artifact ->
  58. copy {
  59. from artifact.file
  60. into '../dist/lib'
  61. if(artifact.classifier != null){
  62. rename { "${artifact.name}-${artifact.classifier}.${artifact.extension}" }
  63. } else{
  64. rename { "${artifact.name}.${artifact.extension}" }
  65. }
  66. }
  67. }
  68. copy {
  69. from jar.archivePath
  70. into '../dist'
  71. rename { "jMonkeyEngine3.jar" }
  72. }
  73. // Copy bullet packages, remove version
  74. copy {
  75. from project(':jme3-bullet').jar.archivePath
  76. into '../dist/opt/native-bullet'
  77. rename {project(':jme3-bullet').name+".jar"}
  78. }
  79. copy {
  80. from project(':jme3-bullet-native').jar.archivePath
  81. into '../dist/opt/native-bullet'
  82. rename {project(':jme3-bullet-native').name+".jar"}
  83. }
  84. // Copy android packages, remove version
  85. copy {
  86. from project(':jme3-android').jar.archivePath
  87. into '../dist/opt/android'
  88. rename {project(':jme3-android').name+".jar"}
  89. }
  90. copy {
  91. from project(':jme3-android-native').jar.archivePath
  92. into '../dist/opt/android'
  93. rename {project(':jme3-android-native').name+".jar"}
  94. }
  95. copy {
  96. from project(':jme3-bullet-native-android').jar.archivePath
  97. into '../dist/opt/native-bullet'
  98. rename {project(':jme3-bullet-native-android').name+".jar"}
  99. }
  100. }
  101. }