mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
Fixes HALSim_Print build to be the standardized pattern (#721)
Now publishes in zips, and with proper artifacts. The code files just moved, and no changes.
This commit is contained in:
committed by
Peter Johnson
parent
42096fac3f
commit
c885251367
@@ -11,7 +11,19 @@ if (!project.hasProperty('onlyAthena')) {
|
||||
|
||||
model {
|
||||
components {
|
||||
halsim_print(NativeLibrarySpec)
|
||||
halsim_print(NativeLibrarySpec) {
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDirs = [ 'src/main/native/cpp' ]
|
||||
includes = ["**/*.cpp"]
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs = ["src/main/native/include"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
binaries {
|
||||
|
||||
@@ -17,23 +17,71 @@ if (project.hasProperty("publishVersion")) {
|
||||
def baseArtifactId = 'halsim-print'
|
||||
def artifactGroupId = 'edu.wpi.first.halsim'
|
||||
|
||||
def outputsFolder = file("$project.buildDir/outputs")
|
||||
|
||||
task cppSourcesZip(type: Zip) {
|
||||
destinationDir = outputsFolder
|
||||
baseName = 'halsim-print'
|
||||
classifier = "sources"
|
||||
|
||||
from(licenseFile) {
|
||||
into '/'
|
||||
}
|
||||
|
||||
from('src/main/native/cpp') {
|
||||
into '/'
|
||||
}
|
||||
}
|
||||
|
||||
task cppHeadersZip(type: Zip) {
|
||||
destinationDir = outputsFolder
|
||||
baseName = 'halsim-print'
|
||||
classifier = "headers"
|
||||
|
||||
from(licenseFile) {
|
||||
into '/'
|
||||
}
|
||||
|
||||
from('src/main/native/include') {
|
||||
into '/'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
model {
|
||||
publishing {
|
||||
def libSpec
|
||||
$.components.each {
|
||||
if (it in NativeLibrarySpec) {
|
||||
$.binaries.each {
|
||||
if (it in SharedLibraryBinarySpec) {
|
||||
libSpec = it.sharedLibraryFile
|
||||
def pluginTaskList = createComponentZipTasks($.components, 'halsim_print', 'zipcpp', Zip, project, { task, value->
|
||||
value.each { binary->
|
||||
if (binary.buildable) {
|
||||
if (binary instanceof SharedLibraryBinarySpec) {
|
||||
task.dependsOn binary.buildTask
|
||||
task.from (binary.sharedLibraryFile) {
|
||||
into getPlatformPath(binary) + '/shared'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
def allTask
|
||||
if (!project.hasProperty('jenkinsBuild')) {
|
||||
allTask = createAllCombined(pluginTaskList, 'halsim_print', 'zipcpp', Zip, project)
|
||||
}
|
||||
|
||||
publications {
|
||||
cpp(MavenPublication) {
|
||||
artifact libSpec
|
||||
pluginTaskList.each {
|
||||
artifact it
|
||||
}
|
||||
|
||||
if (!project.hasProperty('jenkinsBuild')) {
|
||||
artifact allTask
|
||||
}
|
||||
|
||||
artifact cppHeadersZip
|
||||
artifact cppSourcesZip
|
||||
|
||||
|
||||
artifactId = baseArtifactId
|
||||
groupId artifactGroupId
|
||||
version pubVersion
|
||||
|
||||
Reference in New Issue
Block a user