2
0

common.gradle 3.3 KB

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