Rename our allwpilib (which is now 2020) to not have 2019 in the name
Change-Id: I3c07f85ed32ab8b97db765a9b43f2a6ce7da964a
diff --git a/wpilibc/publish.gradle b/wpilibc/publish.gradle
new file mode 100644
index 0000000..025c09d
--- /dev/null
+++ b/wpilibc/publish.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'maven-publish'
+
+def baseArtifactId = 'wpilibc-cpp'
+def artifactGroupId = 'edu.wpi.first.wpilibc'
+def zipBaseName = '_GROUP_edu_wpi_first_wpilibc_ID_wpilibc-cpp_CLS'
+
+def outputsFolder = file("$project.buildDir/outputs")
+
+task cppSourcesZip(type: Zip) {
+ destinationDirectory = outputsFolder
+ archiveBaseName = zipBaseName
+ classifier = "sources"
+
+ from(licenseFile) {
+ into '/'
+ }
+
+ from('src/main/native/cpp') {
+ into '/'
+ }
+ from("$buildDir/generated/cpp") {
+ into '/'
+ }
+}
+
+cppSourcesZip.dependsOn generateCppVersion
+
+task cppHeadersZip(type: Zip) {
+ destinationDirectory = outputsFolder
+ archiveBaseName = zipBaseName
+ classifier = "headers"
+
+ from(licenseFile) {
+ into '/'
+ }
+
+ from('src/main/native/include') {
+ into '/'
+ }
+}
+
+build.dependsOn cppHeadersZip
+build.dependsOn cppSourcesZip
+
+addTaskToCopyAllOutputs(cppHeadersZip)
+addTaskToCopyAllOutputs(cppSourcesZip)
+
+model {
+ publishing {
+ def wpilibCTaskList = createComponentZipTasks($.components, ['wpilibc'], zipBaseName, Zip, project, includeStandardZipFormat)
+
+ publications {
+ cpp(MavenPublication) {
+ wpilibCTaskList.each {
+ artifact it
+ }
+
+ artifact cppHeadersZip
+ artifact cppSourcesZip
+
+ artifactId = baseArtifactId
+ groupId artifactGroupId
+ version wpilibVersioning.version.get()
+ }
+ }
+ }
+}