build.gradle 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. // Copy all dependencies to ../dist/lib, remove versions from jar files
  51. configurations.compile.resolvedConfiguration.resolvedArtifacts.each { artifact ->
  52. copy {
  53. from artifact.file
  54. into '../dist/lib'
  55. if(artifact.classifier != null){
  56. rename { "${artifact.name}-${artifact.classifier}.${artifact.extension}" }
  57. } else{
  58. rename { "${artifact.name}.${artifact.extension}" }
  59. }
  60. }
  61. }
  62. copy {
  63. from jar.archivePath
  64. into '../dist'
  65. rename { "jMonkeyEngine3.jar" }
  66. }
  67. // Copy JOGL packages, remove version
  68. def config = project(':jme3-jogl').configurations.runtime.copyRecursive({ !(it instanceof ProjectDependency); })
  69. config.resolvedConfiguration.resolvedArtifacts.each {artifact ->
  70. copy{
  71. from artifact.file
  72. into '../dist/opt/jogl/lib'
  73. if(artifact.classifier != null){
  74. rename { "${artifact.name}-${artifact.classifier}.${artifact.extension}" }
  75. } else{
  76. rename { "${artifact.name}.${artifact.extension}" }
  77. }
  78. }
  79. }
  80. copy {
  81. from project(':jme3-jogl').jar.archivePath
  82. into '../dist/opt/jogl'
  83. rename {project(':jme3-jogl').name+".jar"}
  84. }
  85. // Copy bullet packages, remove version
  86. copy {
  87. from project(':jme3-bullet').jar.archivePath
  88. into '../dist/opt/native-bullet'
  89. rename {project(':jme3-bullet').name+".jar"}
  90. }
  91. copy {
  92. from project(':jme3-bullet-native').jar.archivePath
  93. into '../dist/opt/native-bullet'
  94. rename {"jme3-bullet-natives.jar"}
  95. }
  96. // Copy android packages, remove version
  97. copy {
  98. from project(':jme3-android').jar.archivePath
  99. into '../dist/opt/android'
  100. rename { project(':jme3-android').name + ".jar" }
  101. }
  102. copy {
  103. from project(':jme3-android-native').jar.archivePath
  104. into '../dist/opt/android'
  105. rename { project(':jme3-android-native').name + ".jar" }
  106. }
  107. copy {
  108. from project(':jme3-bullet-native-android').jar.archivePath
  109. into '../dist/opt/native-bullet'
  110. rename {"jme3-bullet-native-android.jar"}
  111. }
  112. }