build.gradle 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. ext.mainClassName = 'jme3test.TestChooser'
  2. task run(dependsOn: 'build', type:JavaExec) {
  3. mainClass = mainClassName
  4. classpath = sourceSets.main.runtimeClasspath
  5. if (System.properties['java.util.logging.config.file'] != null) {
  6. systemProperty "java.util.logging.config.file", System.properties['java.util.logging.config.file']
  7. }
  8. if( assertions == "true" ){
  9. enableAssertions = true;
  10. }
  11. }
  12. dependencies {
  13. implementation project(':jme3-core')
  14. implementation project(':jme3-desktop')
  15. implementation project(':jme3-effects')
  16. implementation project(':jme3-jbullet')
  17. implementation project(':jme3-jogg')
  18. implementation project(':jme3-lwjgl')
  19. // implementation project(':jme3-lwjgl3')
  20. implementation project(':jme3-networking')
  21. implementation project(':jme3-niftygui')
  22. implementation project(':jme3-plugins')
  23. implementation project(':jme3-terrain')
  24. implementation 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('mainClassName'),
  37. // Add dependencies to manifest, remove version
  38. 'Class-Path' : configurations.compileClasspath.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-android:jar', ':jme3-android-native:jar']) {
  47. doLast {
  48. // Copy all dependencies to ../dist/lib, remove versions from jar files
  49. configurations.compileClasspath.resolvedConfiguration.resolvedArtifacts.each { artifact ->
  50. copy {
  51. from artifact.file
  52. into '../dist/lib'
  53. if(artifact.classifier != null){
  54. rename { "${artifact.name}-${artifact.classifier}.${artifact.extension}" }
  55. } else{
  56. rename { "${artifact.name}.${artifact.extension}" }
  57. }
  58. }
  59. }
  60. copy {
  61. from jar.archivePath
  62. into '../dist'
  63. rename { "jMonkeyEngine3.jar" }
  64. }
  65. // Copy android packages, remove version
  66. copy {
  67. from project(':jme3-android').jar.archivePath
  68. into '../dist/opt/android'
  69. rename {project(':jme3-android').name+".jar"}
  70. }
  71. copy {
  72. from project(':jme3-android-native').jar.archivePath
  73. into '../dist/opt/android'
  74. rename {project(':jme3-android-native').name+".jar"}
  75. }
  76. }
  77. }