build.gradle 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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-blender')
  17. compile project(':jme3-core')
  18. compile project(':jme3-desktop')
  19. compile project(':jme3-effects')
  20. // EITHER use jme3-bullet + jme3-bullet-native OR ELSE jme3-jbullet
  21. compile project(':jme3-bullet')
  22. compile project(':jme3-bullet-native')
  23. // compile project(':jme3-jbullet')
  24. compile project(':jme3-jogg')
  25. compile project(':jme3-jogl')
  26. compile project(':jme3-lwjgl')
  27. // compile project(':jme3-lwjgl3')
  28. compile project(':jme3-networking')
  29. compile project(':jme3-niftygui')
  30. compile project(':jme3-plugins')
  31. compile project(':jme3-terrain')
  32. compile project(':jme3-testdata')
  33. }
  34. jar.doFirst{
  35. manifest {
  36. attributes('Manifest-Version' : '1.0',
  37. // 'Created-By' : vendor,
  38. // 'Specification-Title' : appName,
  39. // 'Specification-Version' : jmeVersion,
  40. // 'Specification-Vendor' : "jMonkeyEngine",
  41. // 'Implementation-Title' : appName,
  42. // 'Implementation-Version' : version,
  43. // 'Implementation-Vendor' : vendor,
  44. 'Main-Class' : getProperty('mainClass'),
  45. // Add dependencies to manifest, remove version
  46. 'Class-Path' : configurations.compile.resolvedConfiguration.resolvedArtifacts.collect {
  47. 'lib/' +
  48. it.name +
  49. (it.classifier != null ? '-' + it.classifier : '') +
  50. '.' + it.extension }.join(' ')
  51. )
  52. }
  53. }
  54. task dist (dependsOn: ['build', ':jme3-jogl:jar', ':jme3-bullet:jar', ':jme3-android:jar', \
  55. ':jme3-android-native:jar', ':jme3-bullet-native-android:jar', \
  56. ':jme3-bullet-native:jar']) {
  57. doLast {
  58. // Copy all dependencies to ../dist/lib, remove versions from jar files
  59. configurations.compile.resolvedConfiguration.resolvedArtifacts.each { artifact ->
  60. copy {
  61. from artifact.file
  62. into '../dist/lib'
  63. if(artifact.classifier != null){
  64. rename { "${artifact.name}-${artifact.classifier}.${artifact.extension}" }
  65. } else{
  66. rename { "${artifact.name}.${artifact.extension}" }
  67. }
  68. }
  69. }
  70. copy {
  71. from jar.archivePath
  72. into '../dist'
  73. rename { "jMonkeyEngine3.jar" }
  74. }
  75. // Copy JOGL packages, remove version
  76. def config = project(':jme3-jogl').configurations.runtime.copyRecursive({ !(it instanceof ProjectDependency); })
  77. config.resolvedConfiguration.resolvedArtifacts.each {artifact ->
  78. copy{
  79. from artifact.file
  80. into '../dist/opt/jogl/lib'
  81. if(artifact.classifier != null){
  82. rename { "${artifact.name}-${artifact.classifier}.${artifact.extension}" }
  83. } else{
  84. rename { "${artifact.name}.${artifact.extension}" }
  85. }
  86. }
  87. }
  88. copy {
  89. from project(':jme3-jogl').jar.archivePath
  90. into '../dist/opt/jogl'
  91. rename {project(':jme3-jogl').name+".jar"}
  92. }
  93. // Copy bullet packages, remove version
  94. copy {
  95. from project(':jme3-bullet').jar.archivePath
  96. into '../dist/opt/native-bullet'
  97. rename {project(':jme3-bullet').name+".jar"}
  98. }
  99. copy {
  100. from project(':jme3-bullet-native').jar.archivePath
  101. into '../dist/opt/native-bullet'
  102. rename {project(':jme3-bullet-native').name+".jar"}
  103. }
  104. // Copy android packages, remove version
  105. copy {
  106. from project(':jme3-android').jar.archivePath
  107. into '../dist/opt/android'
  108. rename {project(':jme3-android').name+".jar"}
  109. }
  110. copy {
  111. from project(':jme3-android-native').jar.archivePath
  112. into '../dist/opt/android'
  113. rename {project(':jme3-android-native').name+".jar"}
  114. }
  115. copy {
  116. from project(':jme3-bullet-native-android').jar.archivePath
  117. into '../dist/opt/native-bullet'
  118. rename {project(':jme3-bullet-native-android').name+".jar"}
  119. }
  120. }
  121. }