blob: 81863c27ab3872639a2d1baec7bc136f067401be [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.wpilibj'
20
21def outputsFolder = file("$project.buildDir/outputs")
22
23task javaExamplesZip(type: Zip) {
24 destinationDir = outputsFolder
25 baseName = 'wpilibj-examples'
26
27 from(licenseFile) {
28 into '/'
29 }
30
31 from('src/main/java/edu/wpi/first/wpilibj/examples') {
32 into 'examples'
33 }
34
35 from ('examples.xml') {
36 into 'examples'
37 }
38}
39
40task javaTemplatesZip(type: Zip) {
41 destinationDir = outputsFolder
42 baseName = 'wpilibj-templates'
43
44 from(licenseFile) {
45 into '/'
46 }
47
48 from('src/main/java/edu/wpi/first/wpilibj/templates') {
49 into 'templates'
50 }
51}
52
53build.dependsOn javaTemplatesZip
54build.dependsOn javaExamplesZip
55
56publishing {
57 publications {
58 examples(MavenPublication) {
59 artifact javaExamplesZip
60
61 artifactId = baseExamplesArtifactId
62 groupId artifactGroupId
63 version pubVersion
64 }
65
66 templates(MavenPublication) {
67 artifact javaTemplatesZip
68
69 artifactId = baseTemplatesArtifactId
70 groupId artifactGroupId
71 version pubVersion
72 }
73 }
74}