You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.gradle 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. // DMDirc plugins build script
  2. //
  3. // Run with -PdmdircOutput=/path/to/DMDirc/classes/
  4. import org.mdonoughe.JGitDescribeTask
  5. subprojects {
  6. apply plugin: 'java'
  7. configurations {
  8. bundle
  9. compile {
  10. extendsFrom bundle
  11. }
  12. }
  13. sourceSets {
  14. main {
  15. java {
  16. srcDir 'src'
  17. }
  18. resources {
  19. srcDir 'res'
  20. }
  21. }
  22. test {
  23. java {
  24. srcDir 'test'
  25. }
  26. }
  27. }
  28. sourceCompatibility = 1.7
  29. targetCompatibility = 1.7
  30. repositories {
  31. mavenCentral()
  32. maven {
  33. url 'http://nexus.dmdirc.com/nexus/content/repositories/thirdparty/'
  34. }
  35. }
  36. dependencies {
  37. compile files("$dmdircOutput")
  38. compile fileTree(dir: '../../../lib/bundled/', include: '*.jar')
  39. compile group: 'com.google.code.findbugs', name: 'jsr305', version: '2.+'
  40. compile group: 'com.squareup.dagger', name: 'dagger-compiler', version: '1.2.1'
  41. testCompile group: 'junit', name: 'junit', version: '4.+'
  42. testCompile group: 'org.mockito', name: 'mockito-all', version: '1.+'
  43. }
  44. task copyPluginConfig(type: Copy) {
  45. from 'plugin.config'
  46. into "$buildDir"
  47. }
  48. task updatePluginConfig(dependsOn: copyPluginConfig) << {
  49. def jgit = new org.mdonoughe.JGitDescribeTask()
  50. jgit.setDir(new File("$rootDir", '.git'))
  51. jgit.setSubDir("$projectDir")
  52. ext.version = jgit.getDescription()
  53. def targetFile = new File("$buildDir", 'plugin.config')
  54. targetFile << "\n\nversion:\n number=${version}\n"
  55. }
  56. jar {
  57. from("$buildDir/plugin.config") {
  58. into 'META-INF'
  59. }
  60. from { configurations.bundle.collect { it.isDirectory() ? it : zipTree(it) } } {
  61. exclude 'META-INF/**'
  62. }
  63. }
  64. jar.dependsOn updatePluginConfig
  65. }
  66. buildscript {
  67. repositories {
  68. mavenCentral()
  69. maven {
  70. url 'http://nexus.dmdirc.com/nexus/content/repositories/thirdparty/'
  71. }
  72. }
  73. dependencies {
  74. classpath group: 'com.github.shanemcc', name: 'jgit-describe', version: '0.5'
  75. classpath group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '2.3.1.+'
  76. }
  77. }
  78. task wrapper(type: Wrapper) {
  79. gradleVersion = '2.0'
  80. }