common.gradle 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. //
  2. // This file is to be applied to every subproject.
  3. //
  4. apply plugin: 'java'
  5. apply plugin: 'maven'
  6. //String jmeVersion = '3.0.10'
  7. //String jmeVersion = rootProject.version;
  8. String mavenGroupId = 'com.jme3'
  9. String mavenVersion = jmeVersion + '-' + jmeVersionTag //'-SNAPSHOT'
  10. sourceCompatibility = '1.6'
  11. [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
  12. repositories {
  13. mavenCentral()
  14. maven{
  15. url "http://nifty-gui.sourceforge.net/nifty-maven-repo"
  16. }
  17. // You may define additional repositories, or even remove "mavenCentral()".
  18. // Read more about repositories here:
  19. // http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:repositories
  20. }
  21. dependencies {
  22. // Adding dependencies here will add the dependencies to each subproject.
  23. testCompile group: 'junit', name: 'junit', version: '4.10'
  24. }
  25. String mavenArtifactId = name
  26. group = mavenGroupId
  27. version = mavenVersion
  28. //jar.doFirst{
  29. // manifest {
  30. // attributes('Manifest-Version' : '1.0',
  31. // 'Created-By' : vendor,
  32. // 'Specification-Title' : appName,
  33. // 'Specification-Version' : version,
  34. // 'Specification-Vendor' : vendor,
  35. // 'Implementation-Title' : appName,
  36. // 'Implementation-Version' : version,
  37. // 'Implementation-Vendor' : vendor,
  38. // 'Main-Class' : getProperty('mainClass'),
  39. // 'Class-Path' : configurations.compile.collect { 'lib/' + it.getName() }.join(' ')
  40. // )
  41. // }
  42. //}
  43. task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') {
  44. classifier = 'sources'
  45. from sourceSets*.allSource
  46. }
  47. task javadocJar(type: Jar, dependsOn: javadoc, description: 'Creates a jar from the javadoc files.') {
  48. classifier = 'javadoc'
  49. from javadoc.destinationDir
  50. }
  51. artifacts {
  52. archives jar
  53. archives sourcesJar
  54. // archives javadocJar
  55. }
  56. configure(install.repositories.mavenInstaller) {
  57. pom.project {
  58. groupId = mavenGroupId
  59. artifactId = mavenArtifactId
  60. version = mavenVersion
  61. }
  62. }
  63. task createFolders(description: 'Creates the source folders if they do not exist.') doLast {
  64. // sourceSets*.allSource*.srcDirs*.each { File srcDir ->
  65. // if (!srcDir.isDirectory()) {
  66. // println "Creating source folder: ${srcDir}"
  67. // srcDir.mkdirs()
  68. // }
  69. // }
  70. }