2
0

build.gradle 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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-core')
  17. compile project(':jme3-desktop')
  18. compile project(':jme3-effects')
  19. compile project(':jme3-jbullet')
  20. compile project(':jme3-jogg')
  21. compile project(':jme3-lwjgl')
  22. // compile project(':jme3-lwjgl3')
  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-android:jar', ':jme3-android-native:jar']) {
  50. doLast {
  51. // Copy all dependencies to ../dist/lib, remove versions from jar files
  52. configurations.compile.resolvedConfiguration.resolvedArtifacts.each { artifact ->
  53. copy {
  54. from artifact.file
  55. into '../dist/lib'
  56. if(artifact.classifier != null){
  57. rename { "${artifact.name}-${artifact.classifier}.${artifact.extension}" }
  58. } else{
  59. rename { "${artifact.name}.${artifact.extension}" }
  60. }
  61. }
  62. }
  63. copy {
  64. from jar.archivePath
  65. into '../dist'
  66. rename { "jMonkeyEngine3.jar" }
  67. }
  68. // Copy android packages, remove version
  69. copy {
  70. from project(':jme3-android').jar.archivePath
  71. into '../dist/opt/android'
  72. rename {project(':jme3-android').name+".jar"}
  73. }
  74. copy {
  75. from project(':jme3-android-native').jar.archivePath
  76. into '../dist/opt/android'
  77. rename {project(':jme3-android-native').name+".jar"}
  78. }
  79. }
  80. }