Skip to content

Instantly share code, notes, and snippets.

@rgozim
Created May 1, 2019 12:58
Show Gist options
  • Save rgozim/020f2a8ddd97a71bfd2ee34a965e4b43 to your computer and use it in GitHub Desktop.
Save rgozim/020f2a8ddd97a71bfd2ee34a965e4b43 to your computer and use it in GitHub Desktop.
build.gradle with bom
plugins {
id "java-library"
id "maven-publish"
id "org.openmicroscopy.project" version "5.5.0-SNAPSHOT"
id "org.openmicroscopy.dsl" version "5.5.0-SNAPSHOT"
id "io.spring.dependency-management" version "1.0.6.RELEASE"
}
group = "org.openmicroscopy"
version = "5.5.0-SNAPSHOT"
ext {
databaseType = "psql"
}
repositories {
mavenLocal()
jcenter()
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
ext {
formatsGplVersion = "5.9.2"
}
dependencies {
testImplementation("junit:junit:4.12")
testImplementation("org.testng:testng:6.14.2")
// Needs updating to later versions
api("org.springframework:spring-orm:4.3.14.RELEASE")
api("org.springframework:spring-context:4.3.14.RELEASE")
api("org.springframework:spring-context-support:4.3.22.RELEASE")
api("org.hibernate:hibernate-core:3.6.10.Final")
api("org.hibernate:hibernate-search:3.4.2.Final")
// Our libraries
api("ome:formats-gpl:${formatsGplVersion}") {
exclude group: "org.perf4j", module: "perf4j"
}
// Necessary since formats-bsd has version 0.9.13. This should be removed
// when fixed in B-F
api("org.perf4j:perf4j:0.9.16")
// Unidata
api("edu.ucar:bufr:3.0")
api("edu.ucar:udunits:4.5.5")
}
dependencyManagement {
applyMavenExclusions = false
dependencies {
dependency ("ome:formats-gpl:${formatsGplVersion}") {
exclude "org.perf4j:perf4j"
}
}
}
test {
// enable TestNG support (default is JUnit)
useTestNG() {
suites "src/test/resources/unit.testng.xml"
}
}
dsl {
database databaseType
multiFile {
java {
template "object.vm"
outputDir "java"
formatOutput = { st ->
"${st.getPackage()}/${st.getShortname()}.java"
}
}
}
singleFile {
hibernate {
template "cfg.vm"
outputFile "resources/hibernate.cfg.xml"
}
sql {
template "views.vm"
outputFile "resources/views.sql"
}
enums {
template "enums.vm"
outputFile "resources/enums.properties"
}
}
}
clean {
delete dsl.outputDir
}
processResources {
with copySpec {
from 'src/main/resources'
// Set db profile
filter { String line ->
line.startsWith('omero.db.profile') ? 'omero.db.profile='+databaseType : line
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment