Source

vimclojure / build.gradle

The default branch has multiple heads

Full commit
buildscript {
    repositories {
        flatDir name: 'gradleHome',
                dirs: new File(System.getenv('GRADLE_HOME') + '/lib/plugins')
    }
    dependencies {
        classpath 'clojuresque:clojuresque:1.4.0-SNAPSHOT'
    }
}

apply plugin: 'clojure'

group = 'vimclojure'
version = '2.2.0-SNAPSHOT'

aotCompile = false

repositories {
    gradleHomeRepo()
    mavenCentral()
}

configurations {
    clojure {
        visible = false
        description = 'Compile only configuration for clojure'
    }
}

dependencies {
    clojure 'org.clojure:clojure:1.1.0'
}

sourceSets.main.compileClasspath = configurations.clojure

compileClojure.dependsOn compileJava

defaultTasks 'build'

configureClojarsDeploy(uploadArchives)

task vimZip(type: Zip) {
    from('.') {
        include 'autoload/**/*'
        include 'bin/**/*'
        exclude 'bin/kickoff.sh'
        include 'doc/**/*'
        include 'ftdetect/**/*'
        include 'ftplugin/**/*'
        include 'indent/**/*'
        include 'plugin/**/*'
        include 'syntax/**/*'
        include 'LICENSE.txt'
        include 'README.txt'
    }
}

task nailgunClientZip(type: Zip) {
    archiveName = "vimclojure-nailgun-client.zip"
    into("vimclojure-nailgun-client") {
        from('.') {
            include "ngclient/**/*"
            include "Makefile"
            include "ng.exe"
        }
    }
}

// Install the Vim part of the plugin
void installFiles(File directory, String pattern, File destination) {
    destination.mkdirs()
    ant.copy(todir: destination) {
        fileset dir: directory, includes: pattern
    }
}

task installVim << {
    File installDir

    if (project.hasProperty('vimdir')) {
        installDir = new File(project.vimdir)
    } else if (System.getProperty('os.name').toLowerCase().startsWith("win")) {
        installDir = new File(System.getProperty('user.home') + "/vimfiles")
    } else {
        installDir = new File(System.getProperty('user.home') + "/.vim")
    }

    // The Vim files:
    [ 'autoload', 'indent', 'syntax', 'ftdetect', 'ftplugin', 'plugin' ].each {
        File subDir = new File(installDir, it)
        installFiles file(it), '**/*.vim', subDir
    }

    // The Docs and other text files:
    [ 'doc', 'ftplugin/clojure' ].each {
        File subDir = new File(installDir, it)
        installFiles file(it), '**/*.txt', subDir
    }
}

task runNailgun(type: JavaExec.class, dependsOn: classes) {
    classpath = project.files([
        sourceSets.main.clojure.srcDirs,
        sourceSets.main.classesDir.path,
        configurations.clojure
    ])
    main = 'com.martiansoftware.nailgun.NGServer'
    args = [ '127.0.0.1' ]
}