blob: 4143cd2b978e874ee8706df98d4374a2a73bb6d9 [file] [log] [blame]
Brian Silverman41cdd3e2019-01-19 19:48:58 -08001apply plugin: 'maven-publish'
2
3def pubVersion = ''
4if (project.hasProperty("publishVersion")) {
5 pubVersion = project.publishVersion
6} else {
7 pubVersion = WPILibVersion.version
8}
9
10def baseArtifactId = nativeName
11def artifactGroupId = 'edu.wpi.first.halsim'
12def zipBaseName = "_GROUP_edu_wpi_first_halsim_ID_${nativeName}_CLS"
13
14def outputsFolder = file("$project.buildDir/outputs")
15
16task cppSourcesZip(type: Zip) {
17 destinationDir = outputsFolder
18 baseName = zipBaseName
19 classifier = "sources"
20
21 from(licenseFile) {
22 into '/'
23 }
24
25 from('src/main/native/cpp') {
26 into '/'
27 }
28}
29
30task cppHeadersZip(type: Zip) {
31 destinationDir = outputsFolder
32 baseName = zipBaseName
33 classifier = "headers"
34
35 from(licenseFile) {
36 into '/'
37 }
38
39 from('src/main/native/include') {
40 into '/'
41 }
42}
43
44build.dependsOn cppSourcesZip
45build.dependsOn cppHeadersZip
46
47addTaskToCopyAllOutputs(cppSourcesZip)
48addTaskToCopyAllOutputs(cppHeadersZip)
49
50
51model {
52 publishing {
53 def lowfiSimTaskList = createComponentZipTasks($.components, [nativeName], zipBaseName, Zip, project, includeStandardZipFormat)
54
55 publications {
56 cpp(MavenPublication) {
57 lowfiSimTaskList.each {
58 artifact it
59 }
60
61 artifact cppHeadersZip
62 artifact cppSourcesZip
63
64
65 artifactId = baseArtifactId
66 groupId artifactGroupId
67 version pubVersion
68 }
69 }
70 }
71}