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:
Thad House
2017-11-10 19:26:33 -08:00
committed by Peter Johnson
parent 42096fac3f
commit c885251367
6 changed files with 68 additions and 8 deletions

View File

@@ -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 {

View File

@@ -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