common.gradle 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. options.addStringOption('Xdoclint:none', '-quiet')
  33. }
  34. task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') {
  35. classifier = 'sources'
  36. from sourceSets*.allSource
  37. }
  38. task javadocJar(type: Jar, dependsOn: javadoc, description: 'Creates a jar from the javadoc files.') {
  39. classifier = 'javadoc'
  40. from javadoc.destinationDir
  41. }
  42. artifacts {
  43. archives jar
  44. archives sourcesJar
  45. if(buildJavaDoc == "true"){
  46. archives javadocJar
  47. }
  48. }
  49. configure(install.repositories.mavenInstaller) {
  50. pom.project {
  51. groupId = mavenGroupId
  52. artifactId = mavenArtifactId
  53. version = mavenVersion
  54. }
  55. }
  56. task createFolders(description: 'Creates the source folders if they do not exist.') doLast {
  57. // sourceSets*.allSource*.srcDirs*.each { File srcDir ->
  58. // if (!srcDir.isDirectory()) {
  59. // println "Creating source folder: ${srcDir}"
  60. // srcDir.mkdirs()
  61. // }
  62. // }
  63. }