build.gradle 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. //apply plugin:'application'
  2. if (!hasProperty('mainClass')) {
  3. ext.mainClass = 'jme3test.TestChooser'
  4. }
  5. //mainClassName = ext.mainClass
  6. dependencies {
  7. compile project(':jme3-blender')
  8. compile project(':jme3-core')
  9. compile project(':jme3-desktop')
  10. compile project(':jme3-effects')
  11. // compile project(':jme3-bullet')
  12. compile project(':jme3-jbullet')
  13. compile project(':jme3-jogg')
  14. // compile project(':jme3-jogl')
  15. compile project(':jme3-lwjgl')
  16. compile project(':jme3-networking')
  17. compile project(':jme3-niftygui')
  18. compile project(':jme3-plugins')
  19. compile project(':jme3-terrain')
  20. compile project(':jme3-testdata')
  21. }
  22. jar.doFirst{
  23. manifest {
  24. attributes('Manifest-Version' : '1.0',
  25. // 'Created-By' : vendor,
  26. // 'Specification-Title' : appName,
  27. // 'Specification-Version' : jmeVersion,
  28. // 'Specification-Vendor' : "jMonkeyEngine",
  29. // 'Implementation-Title' : appName,
  30. // 'Implementation-Version' : version,
  31. // 'Implementation-Vendor' : vendor,
  32. 'Main-Class' : getProperty('mainClass'),
  33. // Add dependencies to manifest, remove version
  34. 'Class-Path' : configurations.compile.resolvedConfiguration.resolvedArtifacts.collect {
  35. 'lib/' +
  36. it.name +
  37. (it.classifier != null ? '-' + it.classifier : '') +
  38. '.' + it.extension }.join(' ')
  39. )
  40. }
  41. }
  42. task dist (dependsOn: ['build', ':jme3-jogl:jar', ':jme3-bullet:jar']) << {
  43. // Copy all dependencies to ../dist/lib, remove versions from jar files
  44. configurations.compile.resolvedConfiguration.resolvedArtifacts.each { artifact ->
  45. copy {
  46. from artifact.file
  47. into '../dist/lib'
  48. if(artifact.classifier != null){
  49. rename { "${artifact.name}-${artifact.classifier}.${artifact.extension}" }
  50. } else{
  51. rename { "${artifact.name}.${artifact.extension}" }
  52. }
  53. }
  54. }
  55. copy {
  56. from jar.archivePath
  57. into '../dist'
  58. rename { "jMonkeyEngine3.jar" }
  59. }
  60. // Copy JOGL packages, remove version
  61. def config = project(':jme3-jogl').configurations.runtime.copyRecursive({ !(it instanceof ProjectDependency); })
  62. config.resolvedConfiguration.resolvedArtifacts.each {artifact ->
  63. copy{
  64. from artifact.file
  65. into '../dist/opt/jogl/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 project(':jme3-jogl').jar.archivePath
  75. into '../dist/opt/jogl'
  76. rename {project(':jme3-jogl').name+".jar"}
  77. }
  78. // Copy bullet packages, remove version
  79. copy {
  80. from project(':jme3-bullet').jar.archivePath
  81. into '../dist/opt/native-bullet'
  82. rename {project(':jme3-bullet').name+".jar"}
  83. }
  84. if(buildNativeProjects == "true"){
  85. copy {
  86. from project(':jme3-bullet-native').jar.archivePath
  87. into '../dist/opt/native-bullet'
  88. rename {"jme3-bullet-natives.jar"}
  89. }
  90. }
  91. }