common.gradle 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. //
  2. // This file is to be applied to every subproject.
  3. //
  4. apply plugin: 'java'
  5. apply plugin: 'maven'
  6. apply plugin: 'maven-publish'
  7. group = 'com.jme3'
  8. version = jmeVersion + '-' + jmeVersionTag
  9. sourceCompatibility = '1.6'
  10. [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
  11. repositories {
  12. mavenCentral()
  13. maven {
  14. url "http://nifty-gui.sourceforge.net/nifty-maven-repo"
  15. }
  16. }
  17. dependencies {
  18. // Adding dependencies here will add the dependencies to each subproject.
  19. testCompile group: 'junit', name: 'junit', version: '4.10'
  20. }
  21. javadoc {
  22. failOnError = false
  23. options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
  24. options.docTitle = "jMonkeyEngine ${jmeMainVersion} ${project.name} Javadoc"
  25. options.windowTitle = "jMonkeyEngine ${jmeMainVersion} ${project.name} Javadoc"
  26. options.header = "<b>jMonkeyEngine ${jmeMainVersion} ${project.name}</b>"
  27. options.author = "true"
  28. options.use = "true"
  29. //disable doclint for JDK8, more quiet output
  30. if (JavaVersion.current().isJava8Compatible()){
  31. options.addStringOption('Xdoclint:none', '-quiet')
  32. }
  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. publishing {
  50. publications {
  51. maven(MavenPublication) {
  52. from components.java
  53. artifact sourcesJar
  54. artifact javadocJar
  55. pom.withXml {
  56. asNode().children().last() + {
  57. resolveStrategy = Closure.DELEGATE_FIRST
  58. name POM_NAME
  59. description POM_DESCRIPTION
  60. url POM_URL
  61. scm {
  62. url POM_SCM_URL
  63. connection POM_SCM_CONNECTION
  64. developerConnection POM_SCM_DEVELOPER_CONNECTION
  65. }
  66. licenses {
  67. license {
  68. name POM_LICENSE_NAME
  69. url POM_LICENSE_URL
  70. distribution POM_LICENSE_DISTRIBUTION
  71. }
  72. }
  73. }
  74. }
  75. }
  76. }
  77. repositories {
  78. maven {
  79. url "${rootProject.buildDir}/repo" // change to point to your repo, e.g. http://my.org/repo
  80. }
  81. }
  82. }
  83. task createFolders(description: 'Creates the source folders if they do not exist.') doLast {
  84. // sourceSets*.allSource*.srcDirs*.each { File srcDir ->
  85. // if (!srcDir.isDirectory()) {
  86. // println "Creating source folder: ${srcDir}"
  87. // srcDir.mkdirs()
  88. // }
  89. // }
  90. }