// DMDirc plugins build script // // Run with -PdmdircOutput=/path/to/DMDirc/classes/ 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' } } } sourceCompatibility = 1.7 targetCompatibility = 1.7 repositories { mavenCentral() maven { url 'http://nexus.dmdirc.com/nexus/content/repositories/thirdparty/' } } dependencies { compile files("$dmdircOutput") compile fileTree(dir: '../../../lib/bundled/', include: '*.jar') compile group: 'com.google.code.findbugs', name: 'jsr305', version: '2.+' compile group: 'com.squareup.dagger', name: 'dagger-compiler', version: '1.2.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.+' } }