126 lines
4.7 KiB
Groovy
126 lines
4.7 KiB
Groovy
plugins {
|
|
id 'java-library'
|
|
id 'maven-publish'
|
|
id 'com.github.johnrengelman.shadow' version '7.1.2'
|
|
}
|
|
|
|
apply from: rootProject.projectDir.path+"/chooseBackend.gradle"
|
|
|
|
dependencies {
|
|
afterEvaluate {
|
|
//Todo clean this
|
|
api platform(project(":cavis-common-platform"))
|
|
//api "org.bytedeco:javacpp:1.5.7" //for some reason we needed to apply version numbers here, they do not end up in POM otherwise
|
|
//api "com.fasterxml.jackson.datatype:jackson-datatype-joda:2.10.5"
|
|
//api 'org.slf4j:slf4j-simple:2.0.3'
|
|
//api 'org.slf4j:slf4j-api:2.0.3'
|
|
//TODO for the two below.. either platform specific uber jars or a single big one with all platforms
|
|
//api group: "org.bytedeco", name: "javacpp", version: "1.5.7", classifier: "linux-x86_64"
|
|
|
|
rootProject.getAllprojects().each { Project sproj ->
|
|
if (!sproj.name.equals(name) && !sproj.name.equals("cavis-common-platform")
|
|
&& !sproj.name.equals("Cavis")
|
|
&& !sproj.name.equals("cavis-datavec")
|
|
&& !sproj.name.equals("cavis-dnn")
|
|
&& !sproj.name.equals("cavis-native") && !sproj.name.equals("cavis-native-lib")
|
|
&& !sproj.name.equals("cavis-nd4j")
|
|
&& !sproj.name.equals("cavis-ui")
|
|
&& !sproj.name.equals("cavis-zoo")) {
|
|
api project(path: sproj.path, configuration: 'runtimeElements')
|
|
}
|
|
}
|
|
// if(withCpu) api project(path: ":cavis-native:cavis-native-lib", configuration: "cpuSupportApiElements")
|
|
// if(withCuda) api project(path: ":cavis-native:cavis-native-lib", configuration: "cudaSupportApiElements")
|
|
|
|
api(projects.cavisNative.cavisNativeLib) {
|
|
capabilities {
|
|
//if(withCuda()) it.requireCapability(group: "net.brutex.cavis.cavis-native", name: "cavis-native-lib-cuda-support", version: project.version)
|
|
if (withCpu()) it.requireCapability(group: "net.brutex.cavis.cavis-native", name: "cavis-native-lib-cpu-support", version: project.version)
|
|
}
|
|
}
|
|
api(projects.cavisNative.cavisNativeLib) {
|
|
capabilities {
|
|
if (withCuda()) it.requireCapability(group: "net.brutex.cavis.cavis-native", name: "cavis-native-lib-cuda-support", version: project.version)
|
|
//if(withCpu()) it.requireCapability(group: "net.brutex.cavis.cavis-native", name: "cavis-native-lib-cpu-support", version: project.version)
|
|
}
|
|
}
|
|
|
|
//if(withCpu()) api project(path: ":cavis-native:cavis-native-lib", configuration: "cpuSupportImplementation")
|
|
//if(withCuda()) api project(path: ":cavis-native:cavis-native-lib", configuration: "cudaSupportImplementation")
|
|
//if(withCuda()) api project(path: ":cavis-native:cavis-native-lib", configuration: "cudaSupportCompileClasspath")
|
|
|
|
/*
|
|
api (project(':cavis-native:cavis-native-lib')) {
|
|
capabilities {
|
|
if(withCpu()) requireCapability("net.brutex.cavis.cavis-native:cavis-native-lib-cpu-support")
|
|
//if(withCuda()) requireCapability("net.brutex.cavis.cavis-native:cavis-native-lib-cuda-support")
|
|
}
|
|
}
|
|
*/
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
tasks.getByName("jar") {
|
|
|
|
manifest {
|
|
attributes 'Main-Class': 'net.brutex.ai.Dummy'
|
|
}
|
|
zip64=true
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
from {
|
|
configurations.compileClasspath.collect { File f ->
|
|
if (f.exists()) {
|
|
f.isDirectory() ? f : zipTree(f)
|
|
}
|
|
}
|
|
|
|
configurations.runtimeClasspath.collect { File f ->
|
|
if (f.exists()) {
|
|
f.isDirectory() ? f : zipTree(f)
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
*/
|
|
|
|
|
|
artifacts {
|
|
archives shadowJar
|
|
}
|
|
|
|
shadowJar {
|
|
enabled true;
|
|
zip64 true //need this to support jars with more than 65535 entries
|
|
archiveClassifier.set('')
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
/*mavenJava(MavenPublication) {
|
|
//artifact customFatJar
|
|
// from components.java
|
|
/* pom.withXml {
|
|
def dependenciesNode = asNode().dependencies
|
|
def dependencyNode = dependenciesNode.appendNode()
|
|
|
|
dependencyNode.appendNode('groupId', 'net.brutex.cavis')
|
|
dependencyNode.appendNode('artifactId', 'cavis-native-lib')
|
|
dependencyNode.appendNode('version', '1.0.0-SNAPSHOT')
|
|
//dependencyNode.appendNode('classifier', 'linux-x86_64-avx2-cpu')
|
|
//dependencyNode.appendNode('scope', 'compile')
|
|
}
|
|
|
|
}
|
|
*/
|
|
shadow(MavenPublication) { publication ->
|
|
project.shadow.component(publication)
|
|
}
|
|
}
|
|
}
|
|
|
|
|