123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- // DMDirc plugins build script
-
- import org.mdonoughe.JGitDescribeTask
-
- subprojects {
- apply plugin: 'java'
-
- configurations {
- bundle
-
- compile {
- extendsFrom bundle
- }
- }
-
- sourceSets {
- main {
- java {
- srcDir 'src'
- }
- resources {
- srcDir 'res'
- }
- }
- test {
- java {
- srcDir 'test'
- }
- resources {
- srcDir 'test-res'
- }
- }
- }
-
- sourceCompatibility = 1.7
- targetCompatibility = 1.7
-
- repositories {
- mavenCentral()
- maven {
- url 'http://nexus.dmdirc.com/nexus/content/repositories/thirdparty/'
- }
- maven {
- url 'http://nexus.dmdirc.com/nexus/content/repositories/snapshots/'
- }
- maven {
- url 'http://nexus.dmdirc.com/nexus/content/repositories/releases/'
- }
- }
-
- dependencies {
- compile group: 'com.dmdirc', name: 'client', version: '+', changing: true
-
- compile group: 'com.google.code.findbugs', name: 'jsr305', version: '2.+'
- compile group: 'com.squareup.dagger', name: 'dagger-compiler', version: '1.2.1'
-
- testCompile group: 'junit', name: 'junit', version: '4.+'
- testCompile group: 'org.mockito', name: 'mockito-all', version: '1.+'
- }
-
- task copyPluginConfig(type: Copy) {
- from 'plugin.config'
- into "$buildDir"
- }
-
- task updatePluginConfig(dependsOn: copyPluginConfig) << {
- def jgit = new org.mdonoughe.JGitDescribeTask()
- jgit.setDir(new File("$rootDir", '.git'))
- jgit.setSubDir("$projectDir")
-
- ext.version = jgit.getDescription()
- def targetFile = new File("$buildDir", 'plugin.config')
- targetFile << "\n\nversion:\n number=${version}\n"
- }
-
- jar {
- from("$buildDir/plugin.config") {
- into 'META-INF'
- }
-
- from { configurations.bundle.collect { it.isDirectory() ? it : zipTree(it) } } {
- exclude 'META-INF/**'
- }
- }
-
- jar.dependsOn updatePluginConfig
- }
-
-
- buildscript {
- repositories {
- mavenCentral()
- maven {
- url 'http://nexus.dmdirc.com/nexus/content/repositories/thirdparty/'
- }
- }
-
- 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.+'
- }
- }
-
- task wrapper(type: Wrapper) {
- gradleVersion = '2.1'
- }
|