From ccfeab5ac9edca83b09f9b9c5f21aa46abd36869 Mon Sep 17 00:00:00 2001 From: Thad House Date: Mon, 7 Aug 2017 17:42:58 -0700 Subject: [PATCH] Adds an all artifact to the published libraries (#217) Better then the old desktop zips because it will include all artifacts built, not just specifically the desktop ones. Also, the individual artifacts are published as well so users can decide which artifacts they specifically want, and can help decrease download sizes. The cpp plugin will continue using the individual artifacts. --- publish.gradle | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/publish.gradle b/publish.gradle index 5ebd510..6b1b231 100644 --- a/publish.gradle +++ b/publish.gradle @@ -182,6 +182,44 @@ model { } }) + def allJniTask + if (!project.hasProperty('jenkinsBuild')) { + allJniTask = project.tasks.create("ntcoreJNIAllJar", Jar) { + description = 'Creates a jar with all JNI artifacts' + classifier = 'all' + baseName = 'jnijnintcorentcoreJNI' + destinationDir = outputsFolder + duplicatesStrategy = 'exclude' + + ntcoreJNITaskList.each { + it.outputs.files.each { + from project.zipTree(it) + } + dependsOn it + } + } + project.build.dependsOn allJniTask + } + + def allCppTask + if (!project.hasProperty('jenkinsBuild')) { + allCppTask = project.tasks.create("ntcoreAllZip", Zip) { + description = 'Creates a zip with all Cpp artifacts' + classifier = 'all' + baseName = 'zipcppntcorentcore' + destinationDir = outputsFolder + duplicatesStrategy = 'exclude' + + ntcoreTaskList.each { + it.outputs.files.each { + from project.zipTree(it) + } + dependsOn it + } + } + project.build.dependsOn allCppTask + } + publications { cpp(MavenPublication) { ntcoreTaskList.each { @@ -190,6 +228,10 @@ model { artifact cppHeadersZip artifact cppSourcesZip + if (!project.hasProperty('jenkinsBuild')) { + artifact allCppTask + } + artifactId = "${baseArtifactId}-cpp" groupId artifactGroupId version pubVersion @@ -199,6 +241,10 @@ model { artifact it } + if (!project.hasProperty('jenkinsBuild')) { + artifact allJniTask + } + artifactId = "${baseArtifactId}-jni" groupId artifactGroupId version pubVersion