common.gradle 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //
  2. // This file is to be applied to every subproject.
  3. //
  4. apply plugin: 'java'
  5. apply plugin: 'maven'
  6. String mavenGroupId = 'com.jme3'
  7. String mavenVersion = jmeVersion + '-' + jmeVersionTag //'-SNAPSHOT'
  8. sourceCompatibility = '1.6'
  9. [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
  10. repositories {
  11. mavenCentral()
  12. maven{
  13. url "http://nifty-gui.sourceforge.net/nifty-maven-repo"
  14. }
  15. }
  16. dependencies {
  17. // Adding dependencies here will add the dependencies to each subproject.
  18. testCompile group: 'junit', name: 'junit', version: '4.10'
  19. }
  20. String mavenArtifactId = name
  21. group = mavenGroupId
  22. version = mavenVersion
  23. javadoc {
  24. failOnError = false
  25. options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
  26. options.docTitle = "jMonkeyEngine ${jmeMainVersion} ${project.name} Javadoc"
  27. options.windowTitle = "jMonkeyEngine ${jmeMainVersion} ${project.name} Javadoc"
  28. options.header = "<b>jMonkeyEngine ${jmeMainVersion} ${project.name}</b>"
  29. options.author = "true"
  30. options.use = "true"
  31. //disable doclint for JDK8, more quiet output
  32. if (JavaVersion.current().isJava8Compatible()){
  33. options.addStringOption('Xdoclint:none', '-quiet')
  34. }
  35. }
  36. task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') {
  37. classifier = 'sources'
  38. from sourceSets*.allSource
  39. }
  40. task javadocJar(type: Jar, dependsOn: javadoc, description: 'Creates a jar from the javadoc files.') {
  41. classifier = 'javadoc'
  42. from javadoc.destinationDir
  43. }
  44. artifacts {
  45. archives jar
  46. archives sourcesJar
  47. if(buildJavaDoc == "true"){
  48. archives javadocJar
  49. }
  50. }
  51. configure(install.repositories.mavenInstaller) {
  52. pom.project {
  53. groupId = mavenGroupId
  54. artifactId = mavenArtifactId
  55. version = mavenVersion
  56. }
  57. }
  58. task createFolders(description: 'Creates the source folders if they do not exist.') doLast {
  59. // sourceSets*.allSource*.srcDirs*.each { File srcDir ->
  60. // if (!srcDir.isDirectory()) {
  61. // println "Creating source folder: ${srcDir}"
  62. // srcDir.mkdirs()
  63. // }
  64. // }
  65. }