From 80aad3087ab3db63ece530a67e5bc5af34e9b4c7 Mon Sep 17 00:00:00 2001 From: brian Date: Thu, 27 Oct 2022 18:34:57 +0200 Subject: [PATCH] Add jenkinsfile for pipeline build and dockerfile for build Signed-off-by: brian --- build.gradle | 11 +++++++---- cavis-full/build.gradle | 22 ++++++++++++++++------ chooseBackend.gradle | 2 +- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index 479821e9d..20e45b528 100644 --- a/build.gradle +++ b/build.gradle @@ -108,14 +108,17 @@ allprojects { Project proj -> } plugins.withType(MavenPublishPlugin) { + publishing { publications { - mavenJava(MavenPublication) { - /* Need to verify the property exists, as some + if(! proj.name.contains("cavis-full")) { + mavenJava(MavenPublication) { + /* Need to verify the property exists, as some modules may not declare it (i.e. the java-platform plugin) */ - if (components.hasProperty("java") ) { - from components.java + if (components.hasProperty("java")) { + from components.java + } } } } diff --git a/cavis-full/build.gradle b/cavis-full/build.gradle index 292def927..0d8bfbdc7 100644 --- a/cavis-full/build.gradle +++ b/cavis-full/build.gradle @@ -28,16 +28,22 @@ dependencies { api sproj } } - if(withCpu) api project(path: ":cavis-native:cavis-native-lib", configuration: "cpuSupportRuntimeElements") - if(withCuda) api project(path: ":cavis-native:cavis-native-lib", configuration: "cudaSupportRuntimeElements") -/* + // 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(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") @@ -87,12 +93,13 @@ artifacts { shadowJar { enabled true; zip64 true //need this to support jars with more than 65535 entries + archiveClassifier.set('') } publishing { publications { mavenJava(MavenPublication) { - // artifact customFatJar + //artifact customFatJar // from components.java /* pom.withXml { def dependenciesNode = asNode().dependencies @@ -106,6 +113,9 @@ publishing { } */ } + shadow(MavenPublication) { publication -> + project.shadow.component(publication) + } } } diff --git a/chooseBackend.gradle b/chooseBackend.gradle index 9a25c6caf..7a3159f59 100644 --- a/chooseBackend.gradle +++ b/chooseBackend.gradle @@ -21,7 +21,7 @@ ext { chip = (properties.CAVIS_CHIP ?: "cuda,cpu").toLowerCase() //the default is to build for CPU and CUDA testChip = (properties.CAVIS_TEST_CHIP ?: " ").toLowerCase() //the default is without specific backend - logger.quiet("Building for chips ${chip} and running tests with backends for ${testChip}") + logger.debug("Building for chips ${chip} and running tests with backends for ${testChip}") chipList = chip.split(",") testChipList = testChip.split(",")