common.gradle 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. //
  2. // This file is to be applied to every subproject.
  3. //
  4. apply plugin: 'java'
  5. apply plugin: 'maven'
  6. group = 'com.jme3'
  7. version = jmePomVersion
  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. configurations {
  17. deployerJars
  18. }
  19. dependencies {
  20. // Adding dependencies here will add the dependencies to each subproject.
  21. testCompile group: 'junit', name: 'junit', version: '4.10'
  22. deployerJars "org.apache.maven.wagon:wagon-ssh:2.9"
  23. }
  24. jar {
  25. manifest {
  26. attributes 'Implementation-Title': 'jMonkeyEngine',
  27. 'Implementation-Version': jmeFullVersion
  28. }
  29. }
  30. javadoc {
  31. failOnError = false
  32. options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
  33. options.docTitle = "jMonkeyEngine ${jmeMainVersion} ${project.name} Javadoc"
  34. options.windowTitle = "jMonkeyEngine ${jmeMainVersion} ${project.name} Javadoc"
  35. options.header = "<b>jMonkeyEngine ${jmeMainVersion} ${project.name}</b>"
  36. options.author = "true"
  37. options.use = "true"
  38. //disable doclint for JDK8, more quiet output
  39. if (JavaVersion.current().isJava8Compatible()){
  40. options.addStringOption('Xdoclint:none', '-quiet')
  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. if(buildJavaDoc == "true"){
  55. archives javadocJar
  56. }
  57. }
  58. uploadArchives {
  59. repositories.mavenDeployer {
  60. configuration = configurations.deployerJars
  61. // disable this otherwise it will fill up the server with stale jars
  62. uniqueVersion = false
  63. repository(url: "scp://updates.jmonkeyengine.org/var/www/updates/maven") {
  64. authentication(userName: "www-updater", privateKey: "private/www-updater.key")
  65. }
  66. pom.project {
  67. name POM_NAME
  68. description POM_DESCRIPTION
  69. url POM_URL
  70. scm {
  71. url POM_SCM_URL
  72. connection POM_SCM_CONNECTION
  73. developerConnection POM_SCM_DEVELOPER_CONNECTION
  74. }
  75. licenses {
  76. license {
  77. name POM_LICENSE_NAME
  78. url POM_LICENSE_URL
  79. distribution POM_LICENSE_DISTRIBUTION
  80. }
  81. }
  82. }
  83. }
  84. }
  85. task createFolders(description: 'Creates the source folders if they do not exist.') doLast {
  86. // sourceSets*.allSource*.srcDirs*.each { File srcDir ->
  87. // if (!srcDir.isDirectory()) {
  88. // println "Creating source folder: ${srcDir}"
  89. // srcDir.mkdirs()
  90. // }
  91. // }
  92. }