2
0

build.gradle 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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-awt-dialogs')
  25. runtimeOnly project(':jme3-testdata')
  26. }
  27. jar.doFirst{
  28. manifest {
  29. attributes('Manifest-Version' : '1.0',
  30. // 'Created-By' : vendor,
  31. // 'Specification-Title' : appName,
  32. // 'Specification-Version' : jmeVersion,
  33. // 'Specification-Vendor' : "jMonkeyEngine",
  34. // 'Implementation-Title' : appName,
  35. // 'Implementation-Version' : version,
  36. // 'Implementation-Vendor' : vendor,
  37. 'Main-Class' : getProperty('mainClassName'),
  38. // Add dependencies to manifest, remove version
  39. 'Class-Path' : configurations.compileClasspath.resolvedConfiguration.resolvedArtifacts.collect {
  40. 'lib/' +
  41. it.name +
  42. (it.classifier != null ? '-' + it.classifier : '') +
  43. '.' + it.extension }.join(' ')
  44. )
  45. }
  46. }
  47. task dist (dependsOn: ['build', ':jme3-android:jar', ':jme3-android-native:jar']) {
  48. doLast {
  49. // Copy all dependencies to ../dist/lib, remove versions from jar files
  50. configurations.compileClasspath.resolvedConfiguration.resolvedArtifacts.each { artifact ->
  51. copy {
  52. from artifact.file
  53. into '../dist/lib'
  54. if(artifact.classifier != null){
  55. rename { "${artifact.name}-${artifact.classifier}.${artifact.extension}" }
  56. } else{
  57. rename { "${artifact.name}.${artifact.extension}" }
  58. }
  59. }
  60. }
  61. copy {
  62. from jar.archivePath
  63. into '../dist'
  64. rename { "jMonkeyEngine3.jar" }
  65. }
  66. // Copy android packages, remove version
  67. copy {
  68. from project(':jme3-android').jar.archivePath
  69. into '../dist/opt/android'
  70. rename {project(':jme3-android').name+".jar"}
  71. }
  72. copy {
  73. from project(':jme3-android-native').jar.archivePath
  74. into '../dist/opt/android'
  75. rename {project(':jme3-android-native').name+".jar"}
  76. }
  77. }
  78. }