build.gradle 4.1 KB

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