build.gradle 4.8 KB

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