common.gradle 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. //
  2. // This file is to be applied to every subproject.
  3. //
  4. apply plugin: 'java'
  5. apply plugin: 'maven'
  6. group = 'org.jmonkeyengine'
  7. version = jmePomVersion
  8. sourceCompatibility = '1.7'
  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.12'
  19. testCompile group: 'org.mockito', name: 'mockito-core', version: '2.0.28-beta'
  20. testCompile group: 'org.easytesting', name: 'fest-assert-core', version: '2.0M10'
  21. }
  22. jar {
  23. manifest {
  24. attributes 'Implementation-Title': 'jMonkeyEngine',
  25. 'Implementation-Version': jmeFullVersion
  26. }
  27. }
  28. javadoc {
  29. failOnError = false
  30. options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
  31. options.docTitle = "jMonkeyEngine ${jmeMainVersion} ${project.name} Javadoc"
  32. options.windowTitle = "jMonkeyEngine ${jmeMainVersion} ${project.name} Javadoc"
  33. options.header = "<b>jMonkeyEngine ${jmeMainVersion} ${project.name}</b>"
  34. options.author = "true"
  35. options.use = "true"
  36. //disable doclint for JDK8, more quiet output
  37. if (JavaVersion.current().isJava8Compatible()){
  38. options.addStringOption('Xdoclint:none', '-quiet')
  39. }
  40. }
  41. test {
  42. testLogging {
  43. exceptionFormat = 'full'
  44. }
  45. }
  46. task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') {
  47. classifier = 'sources'
  48. from sourceSets*.allSource
  49. }
  50. task javadocJar(type: Jar, dependsOn: javadoc, description: 'Creates a jar from the javadoc files.') {
  51. classifier = 'javadoc'
  52. from javadoc.destinationDir
  53. }
  54. ext.pomConfig = {
  55. name POM_NAME
  56. description POM_DESCRIPTION
  57. url POM_URL
  58. inceptionYear POM_INCEPTION_YEAR
  59. scm {
  60. url POM_SCM_URL
  61. connection POM_SCM_CONNECTION
  62. developerConnection POM_SCM_DEVELOPER_CONNECTION
  63. }
  64. licenses {
  65. license {
  66. name POM_LICENSE_NAME
  67. url POM_LICENSE_URL
  68. distribution POM_LICENSE_DISTRIBUTION
  69. }
  70. }
  71. developers {
  72. developer {
  73. name 'jMonkeyEngine Team'
  74. id 'jMonkeyEngine'
  75. }
  76. }
  77. }
  78. // workaround to be able to use same custom pom with 'maven' and 'bintray' plugin
  79. task writeFullPom {
  80. ext.pomFile = "$mavenPomDir/${project.name}-${project.version}.pom"
  81. outputs.file pomFile
  82. doLast {
  83. pom {
  84. project pomConfig
  85. }.writeTo(pomFile)
  86. }
  87. }
  88. assemble.dependsOn(writeFullPom)
  89. install.dependsOn(writeFullPom)
  90. uploadArchives.dependsOn(writeFullPom)
  91. artifacts {
  92. archives jar
  93. archives sourcesJar
  94. if (buildJavaDoc == "true") {
  95. archives javadocJar
  96. }
  97. archives writeFullPom.outputs.files[0]
  98. }