build.gradle 4.4 KB

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