1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- import org.mdonoughe.JGitDescribeTask
-
- def jgit = new org.mdonoughe.JGitDescribeTask()
- jgit.setDir(new File("$projectDir", '.git'))
- project.version = jgit.getDescription() + '-SNAPSHOT'
-
- apply plugin: 'java'
- apply plugin: 'maven-publish'
-
- group = 'com.dmdirc'
-
- sourceSets {
- main {
- java.srcDirs = ['src']
- resources.srcDirs = ['res']
- }
- test {
- java.srcDirs = ['test']
- resources.srcDirs = ['test-res']
- }
- }
-
- sourceCompatibility = 1.8
- targetCompatibility = 1.8
-
- repositories.mavenCentral()
-
- dependencies {
- compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.0'
-
- testCompile group: 'junit', name: 'junit', version: '4.12'
- testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.17'
- testCompile group: 'com.google.jimfs', name: 'jimfs', version: '1.0'
- }
-
- // DMDirc uses 18.0, JimFS has a transient dep on 16.0.1 - force the newer version
- configurations.all {
- resolutionStrategy.force('com.google.guava:guava:18.0')
- }
-
- publishing {
- publications {
- mavenJava(MavenPublication) {
- from components.java
- }
- }
- repositories {
- maven {
- name 'snapshots'
- url 'http://artifactory.dmdirc.com/artifactory/repo'
- }
- }
- }
-
- task wrapper(type: Wrapper) {
- gradleVersion = '2.2.1'
- }
-
- task getCredentials << {
- def target = file('nexus-teamcity.gradle')
- if (!target.exists()) {
- new URL('http://www.dmdirc.com/private/nexus-teamcity.gradle').withInputStream{
- i -> target.withOutputStream { it << i }
- }
- }
-
- apply from: 'nexus-teamcity.gradle'
- project.publishing.repositories[0].credentials {
- username "$nexusUser"
- password "$nexusPass"
- }
- }
-
- task publishSnapshot(dependsOn: ['getCredentials', 'publishMavenJavaPublicationToSnapshotsRepository']) << {
- }
-
- buildscript {
- repositories {
- mavenCentral()
- maven {
- url 'http://artifactory.dmdirc.com/artifactory/repo'
- }
- }
-
- dependencies {
- classpath group: 'com.github.shanemcc', name: 'jgit-describe', version: '0.5'
- classpath group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '2.3.1.+'
- }
- }
|