common.gradle 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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.12'
  22. testCompile group: 'org.mockito', name: 'mockito-core', version: '2.0.28-beta'
  23. testCompile group: 'org.easytesting', name: 'fest-assert-core', version: '2.0M10'
  24. deployerJars "org.apache.maven.wagon:wagon-ssh:2.9"
  25. }
  26. jar {
  27. manifest {
  28. attributes 'Implementation-Title': 'jMonkeyEngine',
  29. 'Implementation-Version': jmeFullVersion
  30. }
  31. }
  32. javadoc {
  33. failOnError = false
  34. options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
  35. options.docTitle = "jMonkeyEngine ${jmeMainVersion} ${project.name} Javadoc"
  36. options.windowTitle = "jMonkeyEngine ${jmeMainVersion} ${project.name} Javadoc"
  37. options.header = "<b>jMonkeyEngine ${jmeMainVersion} ${project.name}</b>"
  38. options.author = "true"
  39. options.use = "true"
  40. //disable doclint for JDK8, more quiet output
  41. if (JavaVersion.current().isJava8Compatible()){
  42. options.addStringOption('Xdoclint:none', '-quiet')
  43. }
  44. }
  45. task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') {
  46. classifier = 'sources'
  47. from sourceSets*.allSource
  48. }
  49. task javadocJar(type: Jar, dependsOn: javadoc, description: 'Creates a jar from the javadoc files.') {
  50. classifier = 'javadoc'
  51. from javadoc.destinationDir
  52. }
  53. artifacts {
  54. archives jar
  55. archives sourcesJar
  56. if(buildJavaDoc == "true"){
  57. archives javadocJar
  58. }
  59. }
  60. uploadArchives {
  61. repositories.mavenDeployer {
  62. configuration = configurations.deployerJars
  63. // disable this otherwise it will fill up the server with stale jars
  64. uniqueVersion = false
  65. repository(url: "scp://updates.jmonkeyengine.org/var/www/updates/maven") {
  66. authentication(userName: "www-updater", privateKey: "private/www-updater.key")
  67. }
  68. pom.project {
  69. name POM_NAME
  70. description POM_DESCRIPTION
  71. url POM_URL
  72. scm {
  73. url POM_SCM_URL
  74. connection POM_SCM_CONNECTION
  75. developerConnection POM_SCM_DEVELOPER_CONNECTION
  76. }
  77. licenses {
  78. license {
  79. name POM_LICENSE_NAME
  80. url POM_LICENSE_URL
  81. distribution POM_LICENSE_DISTRIBUTION
  82. }
  83. }
  84. }
  85. }
  86. }
  87. task createFolders(description: 'Creates the source folders if they do not exist.') doLast {
  88. // sourceSets*.allSource*.srcDirs*.each { File srcDir ->
  89. // if (!srcDir.isDirectory()) {
  90. // println "Creating source folder: ${srcDir}"
  91. // srcDir.mkdirs()
  92. // }
  93. // }
  94. }