summaryrefslogtreecommitdiff
path: root/cli/build.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'cli/build.gradle')
-rwxr-xr-xcli/build.gradle105
1 files changed, 0 insertions, 105 deletions
diff --git a/cli/build.gradle b/cli/build.gradle
deleted file mode 100755
index 1450615..0000000
--- a/cli/build.gradle
+++ /dev/null
@@ -1,105 +0,0 @@
-buildscript {
- dependencies { classpath 'net.saliman:gradle-cobertura-plugin:2.2.2' }
- repositories { mavenCentral() }
-}
-
-evaluationDependsOn(':stringmetric-core')
-
-apply from: '../deploy.gradle'
-apply plugin: 'cobertura'
-apply plugin: 'scala'
-
-cobertura {
- coverageFormats = ['html', 'xml']
- coverageSourceDirs = sourceSets.main.scala.srcDirs
-}
-
-compileScala { compileScala.scalaCompileOptions.additionalParameters = ['-target:jvm-1.6', '–Xdisable-assertions'] }
-compileTestScala { compileTestScala.scalaCompileOptions.additionalParameters = ['-target:jvm-1.6'] }
-
-dependencies {
- compile project(':stringmetric-core')
- compile'org.scala-lang:scala-compiler:2.10.2'
- compile 'org.scala-lang:scala-library:2.10.2'
-
- testCompile project(':stringmetric-core').sourceSets.test.output
- testCompile 'com.google.caliper:caliper:0.5-rc1'
- testCompile 'junit:junit:4.11'
- testCompile 'org.scalatest:scalatest_2.10:2.0.M5b'
-}
-
-sourceSets {
- main {
- output.resourcesDir "${project.buildDir}/classes/main"
-
- resources { srcDir 'source/main/resource' }
- scala { srcDir 'source/main/scala' }
- }
- test {
- output.resourcesDir "${project.buildDir}/classes/test"
-
- resources { srcDir 'source/test/resource' }
- scala { srcDir 'source/test/scala' }
- }
-}
-
-task tar(description: 'Assembles a compressed tar archive of source files.', dependsOn: [':stringmetric-cli:jar', ':stringmetric-core:jar']) {
- ext.sourcePath = "${project.projectDir}/source/main/scala"
- ext.outputPath = "${project.buildDir}"
- ext.workingPath = "${project.buildDir}/${project.name}"
-
- inputs.dir new File(sourcePath)
- outputs.dir new File(outputPath, 'generated')
- outputs.upToDateWhen { new File(workingPath).isDirectory() }
-
- doLast {
- // Clean up working directory and tar from last execution, should they exist.
- ant.delete(dir: workingPath, failOnError: false)
- ant.delete(file: "${project.buildDir}/${project.name}.tar.gz", failOnError: false)
-
- // Create project working directory.
- ant.mkdir(dir: workingPath)
-
- // Create scala.sh header file.
- ant.echo(file: "${workingPath}/scala.sh", message: '#!/bin/bash\ndir="`dirname \\"$0\\"`"\ndir="`( cd \\"$dir\\" && pwd )`"\ncp=`echo $dir/*.jar|sed \'s/ /:/g\'`\nexec scala -classpath "$cp" -savecompiled "$0" "$@"\n!#\n//')
-
- // Copy source files to working directory.
- ant.copy(toDir: workingPath, force: true, overwrite: true) {
- fileset(dir: sourcePath) {
- exclude(name: '**/cli/*.scala')
- exclude(name: '**/package.scala')
- }
- filterchain {
- concatfilter(prepend: "${workingPath}/scala.sh")
- }
- }
-
- // Delete scala.sh header file.
- ant.delete(file: "${workingPath}/scala.sh")
-
- // Flatten and remove file extension.
- ant.move(toDir: workingPath) {
- fileset(dir: workingPath)
- chainedmapper {
- mapper(type: 'flatten')
- mapper(from: '*.scala', to: '*', type: 'glob')
- }
- }
-
- // Clean up empty folder(s) from flatten.
- ant.delete(dir: "${workingPath}/org", includeEmptyDirs: true)
-
- // Copy project jars into place.
- ant.copy(toDir: workingPath, force: true, overwrite: true) {
- fileset(dir: "${project.buildDir}/libs")
- }
- ant.copy(toDir: workingPath, force: true, overwrite: true) {
- fileset(dir: "${project(':stringmetric-core').buildDir}/libs")
- }
-
- // Assemble compressed tar.
- ant.tar(compression: 'gzip', destFile: "${project.buildDir}/${project.name}.tar.gz") {
- tarfileset(dir: workingPath, fileMode: 755, prefix: project.name)
- }
- }
-}