Skip to content

Instantly share code, notes, and snippets.

@chris-allan
Created May 21, 2014 20:37
Show Gist options
  • Save chris-allan/70ec70646b978f756a21 to your computer and use it in GitHub Desktop.
Save chris-allan/70ec70646b978f756a21 to your computer and use it in GitHub Desktop.
dev_4_4: Example Gradle build file for OMERO.importer on the CLI
apply plugin: 'application'
apply plugin: 'java'
apply plugin: 'eclipse'
mainClassName = 'ome.formats.importer.cli.CommandLineImporter'
def javaOpts = [
'-Dlog4j.configuration=log4j-cli.properties',
'-Xmx512M'
]
version '0.1'
repositories {
mavenCentral()
maven {
url 'http://artifacts.openmicroscopy.org/artifactory/ome.releases/'
}
maven {
url 'http://artifacts.openmicroscopy.org/artifactory/ome.snapshots/'
}
maven {
url 'http://artifacts.openmicroscopy.org/artifactory/ome.external/'
}
maven {
url 'http://artifacts.openmicroscopy.org/artifactory/ome.manual/'
}
maven {
url 'http://repository.springsource.com/maven/bundles/release/'
}
maven {
url 'http://repository.springsource.com/maven/bundles/external/'
}
maven {
url 'http://artifacts.unidata.ucar.edu/content/repositories/unidata-releases/'
}
maven {
url 'http://maven.imagej.net/content/repositories/releases'
}
maven {
url '/Users/callan/code/ome.git/target/repository/'
}
}
dependencies {
compile group: 'loci', name: 'bio-formats', version: '4.4.11'
compile group: 'org.springframework.ldap', name: 'spring-ldap', version: '1.3.0.RELEASE', classifier: 'all'
compile(group: 'omero', name: 'OmeroImporter', version: '4.4.10-SNAPSHOT') {
exclude group: 'hsqldb', module: 'hsqldb'
}
}
configurations {
testCompile.exclude group: 'hsqldb', module: 'hsqldb'
runtime.exclude group: 'hsqldb', module: 'hsqldb'
runtime.exclude group: 'org.testng', module: 'testng'
}
startScripts {
doLast {
def script = new File(getOutputDir(), applicationName)
String content = script.text
script.text = content.replaceFirst(
'DEFAULT_JVM_OPTS=""',
"DEFAULT_JVM_OPTS=\"${javaOpts.join(' ')}\"")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment