Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
234 lines (198 sloc) 8.39 KB
apply plugin: 'com.google.osdetector'
apply plugin: 'de.undercouch.download'
import de.undercouch.gradle.tasks.download.Download
project.ext.jomlVersion = "1.9.2"
project.ext.joglVersion = "2.3.2"
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2"
}
}
dependencies {
classpath "gradle.plugin.com.google.gradle:osdetector-gradle-plugin:1.4.0"
classpath 'gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:0.8.0'
classpath 'de.undercouch:gradle-download-task:3.1.2'
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0-M4'
}
}
apply plugin: 'com.google.protobuf'
apply plugin: 'java'
apply plugin: 'org.junit.platform.gradle.plugin'
repositories {
mavenCentral()
}
junitPlatform {
reportsDir file('build/test-results/junit-platform')
enableStandardTestTask true
selectors {
packages 'org.vitrivr.cineast.tests'
packages 'org.vitrivr.cineast'
}
}
// Important warnings that are currently missing simply because there are too many: "cast", "rawtypes". Ideally, "all" should be used in the future
def enabledWarnings = ["-Xlint:deprecation", "-Xlint:empty", "-Xlint:overrides", "-Xlint:serial", "-Xlint:static", "-Xlint:unchecked", "-Xlint:varargs"]
compileJava {
options.encoding = 'UTF-8'
options.compilerArgs += enabledWarnings
}
compileTestJava.options.compilerArgs += enabledWarnings
protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.1.0'
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.0.1'
}
}
generatedFilesBaseDir = "$projectDir/generated/"
generateProtoTasks {
all()*.plugins {
grpc {}
}
}
}
configurations {
all*.exclude group: 'org.bytedeco', module: 'javacpp-presets'
}
def osclassifier = osdetector.classifier
if(osdetector.arch.equals('x86_32')){
osclassifier = osdetector.os + '-x86'
}
dependencies {
compile group: 'org.boofcv', name: 'all', version: '0.26'
compile group: 'org.jcodec', name: 'jcodec-javase', version: '0.1.9'
compile group: 'net.coobird', name: 'thumbnailator', version: '0.4.8'
compile group: 'net.sf.trove4j', name: 'trove4j', version: '3.0.3'
compile group: 'com.google.guava', name: 'guava', version: '19.0'
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.7'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.7'
compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.7'
compile group: 'commons-codec', name: 'commons-codec', version: '1.10'
compile group: 'commons-cli', name: 'commons-cli', version: '1.3.1'
compile group: 'com.google.protobuf', name: 'protobuf-java', version: '3.1.0'
compile group: 'io.grpc', name: 'grpc-netty', version: '1.0.2'
compile group: 'io.grpc', name: 'grpc-protobuf', version: '1.0.2'
compile group: 'io.grpc', name: 'grpc-stub', version: '1.0.2'
compile group: 'org.bytedeco', name: 'javacpp', version: '1.3.1'
compile group: 'org.jgrapht', name: 'jgrapht-core', version: '1.0.1'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.8'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.8'
compile group: 'com.sparkjava', name: 'spark-core', version: '2.5.5'
/**
* Apache Commons Libraries
*/
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.5'
compile group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1'
compile group: 'de.svenkubiak', name: 'jBCrypt', version: '0.4'
/**
* TwelveMonkey's ImageIO library + Metadata Extractor for advanced image support .
*/
compile group: 'com.twelvemonkeys.imageio', name: 'imageio-jpeg', version: '3.3.2'
compile group: 'com.twelvemonkeys.imageio', name: 'imageio-tiff', version: '3.3.2'
compile group: 'com.drewnoakes', name: 'metadata-extractor', version: '2.10.1'
/**
* JOGL un JOML dependencies for 3D model support.
*/
compile "org.joml:joml:${jomlVersion}"
compile "org.jogamp.gluegen:gluegen-rt:${joglVersion}"
compile "org.jogamp.jogl:jogl-all:${joglVersion}"
/**
* Test dependencies (JUnit 5)
*/
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.0.0-M5'
testCompile group: 'org.junit.platform', name: 'junit-platform-launcher', version:'1.0.0-M5'
testRuntime group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.0.0-M5'
/**
* Manual Fixes for the javacpp-devs because of naming conventions & versions. Each os is handled independently
*/
if(osdetector.os.equals('windows')){
compile group: 'org.bytedeco.javacpp-presets', name: 'tensorflow', version: '0.11.0-1.3'
compile group: 'org.bytedeco.javacpp-presets', name: 'tensorflow', version: '0.11.0-1.3', classifier: osclassifier
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.2.1-1.3'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.2.1-1.3', classifier: osclassifier
compile "org.jogamp.gluegen:gluegen-rt:${joglVersion}:natives-windows-amd64"
compile "org.jogamp.gluegen:gluegen-rt:${joglVersion}:natives-windows-i586"
compile "org.jogamp.jogl:jogl-all:${joglVersion}:natives-windows-amd64"
compile "org.jogamp.jogl:jogl-all:${joglVersion}:natives-windows-i586"
}
if(osdetector.os.contains('linux')){
compile group: 'org.bytedeco.javacpp-presets', name: 'tensorflow', version: '0.11.0-1.3'
compile group: 'org.bytedeco.javacpp-presets', name: 'tensorflow', version: '0.11.0-1.3', classifier: osclassifier
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.2.1-1.3'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.2.1-1.3', classifier: osclassifier
compile "org.jogamp.gluegen:gluegen-rt:${joglVersion}:natives-linux-amd64"
compile "org.jogamp.gluegen:gluegen-rt:${joglVersion}:natives-linux-armv6"
compile "org.jogamp.gluegen:gluegen-rt:${joglVersion}:natives-linux-armv6hf"
compile "org.jogamp.gluegen:gluegen-rt:${joglVersion}:natives-linux-i586"
compile "org.jogamp.jogl:jogl-all:${joglVersion}:natives-linux-amd64"
compile "org.jogamp.jogl:jogl-all:${joglVersion}:natives-linux-armv6"
compile "org.jogamp.jogl:jogl-all:${joglVersion}:natives-linux-armv6hf"
compile "org.jogamp.jogl:jogl-all:${joglVersion}:natives-linux-i586"
}
if(osdetector.os.equals('osx')){
compile group: 'org.bytedeco.javacpp-presets', name: 'tensorflow', version: '0.11.0-1.3'
compile group: 'org.bytedeco.javacpp-presets', name: 'tensorflow', version: '0.11.0-1.3', classifier: 'mac' + osclassifier
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.2.1-1.3'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.2.1-1.3', classifier: 'mac' + osclassifier
compile "org.jogamp.gluegen:gluegen-rt:${joglVersion}:natives-macosx-universal"
compile "org.jogamp.jogl:jogl-all:${joglVersion}:natives-macosx-universal"
}
}
sourceSets {
main {
java {
srcDir 'src'
srcDir 'generated/main/java'
srcDir 'generated/main/grpc'
}
resources {
srcDir 'config'
}
proto {
srcDir 'adampro-grpc/src/main/protobuf'
}
}
test {
java {
srcDir 'src'
srcDir 'tests'
}
}
}
jar {
manifest {
attributes 'Main-Class': 'org.vitrivr.cineast.api.API'
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
archiveName = 'cineast.jar'
}
task doc(type: Javadoc){
source = sourceSets.main.allJava
classpath += sourceSets.main.compileClasspath
options.linkSource true
failOnError false
}
task downloadExternalFiles(type: Download){
src 'http://download.vitrivr.org/vgg16.tfmodel'
dest 'resources/vgg16'
}
task copyResources() << {
copy {
from "cineast.json"
into "$buildDir/libs/"
}
copy {
from "mime.types"
into "$buildDir/libs/"
}
copy {
from "resources"
into "$buildDir/libs/resources/"
}
}
task deploy(dependsOn: [build, jar, copyResources])