選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

build.gradle 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. import org.mdonoughe.JGitDescribeTask
  2. def jgit = new org.mdonoughe.JGitDescribeTask()
  3. jgit.setDir(new File("$projectDir", '.git'))
  4. project.version = jgit.getDescription() + '-SNAPSHOT'
  5. apply plugin: 'java'
  6. apply plugin: 'maven-publish'
  7. group = 'com.dmdirc'
  8. sourceSets {
  9. main {
  10. java.srcDirs = ['src']
  11. resources.srcDirs = ['res']
  12. }
  13. test {
  14. java.srcDirs = ['test']
  15. resources.srcDirs = ['test-res']
  16. }
  17. }
  18. sourceCompatibility = 1.8
  19. targetCompatibility = 1.8
  20. repositories.mavenCentral()
  21. dependencies {
  22. compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.0'
  23. testCompile group: 'junit', name: 'junit', version: '4.12'
  24. testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.17'
  25. testCompile group: 'com.google.jimfs', name: 'jimfs', version: '1.0'
  26. }
  27. // DMDirc uses 18.0, JimFS has a transient dep on 16.0.1 - force the newer version
  28. configurations.all {
  29. resolutionStrategy.force('com.google.guava:guava:18.0')
  30. }
  31. publishing {
  32. publications {
  33. mavenJava(MavenPublication) {
  34. from components.java
  35. }
  36. }
  37. repositories {
  38. maven {
  39. name 'snapshots'
  40. url 'http://artifactory.dmdirc.com/artifactory/repo'
  41. }
  42. }
  43. }
  44. task wrapper(type: Wrapper) {
  45. gradleVersion = '2.2.1'
  46. }
  47. task getCredentials << {
  48. def target = file('nexus-teamcity.gradle')
  49. if (!target.exists()) {
  50. new URL('http://www.dmdirc.com/private/nexus-teamcity.gradle').withInputStream{
  51. i -> target.withOutputStream { it << i }
  52. }
  53. }
  54. apply from: 'nexus-teamcity.gradle'
  55. project.publishing.repositories[0].credentials {
  56. username "$nexusUser"
  57. password "$nexusPass"
  58. }
  59. }
  60. task publishSnapshot(dependsOn: ['getCredentials', 'publishMavenJavaPublicationToSnapshotsRepository']) << {
  61. }
  62. buildscript {
  63. repositories {
  64. mavenCentral()
  65. maven {
  66. url 'http://artifactory.dmdirc.com/artifactory/repo'
  67. }
  68. }
  69. dependencies {
  70. classpath group: 'com.github.shanemcc', name: 'jgit-describe', version: '0.5'
  71. classpath group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '2.3.1.+'
  72. }
  73. }