build.gradle 5.0 KB

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