forked from wpilibsuite/allwpilib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish.gradle
87 lines (67 loc) · 2.05 KB
/
publish.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
apply plugin: 'maven-publish'
def baseExamplesArtifactId = 'examples'
def baseTemplatesArtifactId = 'templates'
def baseCommandsArtifactId = 'commands'
def artifactGroupId = 'edu.wpi.first.wpilibc'
def examplesZipBaseName = '_GROUP_edu_wpi_first_wpilibc_ID_examples_CLS'
def templatesZipBaseName = '_GROUP_edu_wpi_first_wpilibc_ID_templates_CLS'
def commandsZipBaseName = '_GROUP_edu_wpi_first_wpilibc_ID_commands_CLS'
def outputsFolder = file("$project.buildDir/outputs")
task cppExamplesZip(type: Zip) {
destinationDirectory = outputsFolder
archiveBaseName = examplesZipBaseName
from(licenseFile) {
into '/'
}
from('src/main/cpp/examples') {
into 'examples'
}
}
task cppTemplatesZip(type: Zip) {
destinationDirectory = outputsFolder
archiveBaseName = templatesZipBaseName
from(licenseFile) {
into '/'
}
from('src/main/cpp/templates') {
into 'templates'
}
}
task cppCommandsZip(type: Zip) {
destinationDirectory = outputsFolder
archiveBaseName = commandsZipBaseName
from(licenseFile) {
into '/'
}
from('src/main/cpp/commands') {
into 'commands'
}
}
build.dependsOn cppTemplatesZip
build.dependsOn cppExamplesZip
build.dependsOn cppCommandsZip
addTaskToCopyAllOutputs(cppTemplatesZip)
addTaskToCopyAllOutputs(cppExamplesZip)
addTaskToCopyAllOutputs(cppCommandsZip)
publishing {
publications {
examples(MavenPublication) {
artifact cppExamplesZip
artifactId = baseExamplesArtifactId
groupId artifactGroupId
version wpilibVersioning.version.get()
}
templates(MavenPublication) {
artifact cppTemplatesZip
artifactId = baseTemplatesArtifactId
groupId artifactGroupId
version wpilibVersioning.version.get()
}
commands(MavenPublication) {
artifact cppCommandsZip
artifactId = baseCommandsArtifactId
groupId artifactGroupId
version wpilibVersioning.version.get()
}
}
}