Quick Build with Gradle (BSBM Tools)

Today, I needed to have a JAR of BSBM benchmark tools. Surprisingly, when I downloaded the bundled zip from SourceForge, there was neither JAR nor build file inside (no build.xml, no pom.xml, nothing) - or maybe I'm blind.
Well, Gradle to the rescue. :)

I checked what is the structure of the sources. It looks like this:

.
|-- bin
| `-- benchmark
|-- lib
|-- queries
|-- sqlQueries
|-- src
| `-- benchmark
|-- td_data
`-- virtSQLqueries

I needed only classes (src/benchmark directory), so I could omit all data-generation files that are required if if you use BSBM in "normal way".

I started to hack build.gradle file, and came up with the following solution in no time ...well, I needed to consult the userguide once or twice :)

usePlugin 'java'

version = "0.1"

dependencies {
  compile fileTree(dir: 'lib', includes: ['*.jar'])
}

sourceSets {
  main {
    java {
      srcDir 'src'
    }
  }
}

Nothing to add here - this concise and elegant code speaks for itself.

 
 
 
This used to be my blog. I moved to http://tomek.kaczanowscy.pl long time ago.

 
 
 

Please comment using