blob: a6558a87be6101fb88cde4c92e115ff61c3a0beb [file] [log] [blame]
John Park7eb90422018-01-27 12:04:57 -08001apply plugin: 'maven-publish'
2apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
3
4if (!hasProperty('releaseType')) {
5 WPILibVersion {
6 releaseType = 'dev'
7 }
8}
9
10def pubVersion
11if (project.hasProperty("publishVersion")) {
12 pubVersion = project.publishVersion
13} else {
14 pubVersion = WPILibVersion.version
15}
16
17def baseExamplesArtifactId = 'examples'
18def baseTemplatesArtifactId = 'templates'
19def artifactGroupId = 'edu.wpi.first.wpilibc'
20
21def outputsFolder = file("$project.buildDir/outputs")
22
23task cppExamplesZip(type: Zip) {
24 destinationDir = outputsFolder
25 baseName = 'wpilibc-examples'
26
27 from(licenseFile) {
28 into '/'
29 }
30
31 from('src/main/cpp/examples') {
32 into 'examples'
33 }
34
35 from ('examples.xml') {
36 into 'examples'
37 }
38}
39
40task cppTemplatesZip(type: Zip) {
41 destinationDir = outputsFolder
42 baseName = 'wpilibc-templates'
43
44 from(licenseFile) {
45 into '/'
46 }
47
48 from('src/main/cpp/templates') {
49 into 'templates'
50 }
51}
52
53build.dependsOn cppTemplatesZip
54build.dependsOn cppExamplesZip
55
56publishing {
57 publications {
58 examples(MavenPublication) {
59 artifact cppExamplesZip
60
61 artifactId = baseExamplesArtifactId
62 groupId artifactGroupId
63 version pubVersion
64 }
65
66 templates(MavenPublication) {
67 artifact cppTemplatesZip
68
69 artifactId = baseTemplatesArtifactId
70 groupId artifactGroupId
71 version pubVersion
72 }
73 }
74}