Files
allwpilib/wpilibc/publish.gradle
Thad House e1195e8b9d Update to 2018_v4 image and new build system. (#598)
* Revert "Force OpenCV to 3.1.0 (#602)"

This reverts commit 50ed55e8e2.

* Removes Simulation

* Removes old build system

* Removes old gtest

* Adds new gmock and gtest

* Updates to new ni-libraries

* removes MyRobot (to be replaced)

* moves files to new location

* Adds new sim backend and new test executables

* updates .styleguide and .gitignore

* Changes cpp WPILibVersion to a function

MSVC throws an AV with the old version.

* Disables USBCamera on all systems except for linux

* 2018 NI Libraries

* New build system
2017-08-18 21:35:53 -07:00

141 lines
3.9 KiB
Groovy

apply plugin: 'maven-publish'
apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
if (!hasProperty('releaseType')) {
WPILibVersion {
releaseType = 'dev'
}
}
def pubVersion = ''
if (project.hasProperty("publishVersion")) {
pubVersion = project.publishVersion
} else {
pubVersion = WPILibVersion.version
}
def baseArtifactId = 'wpilibc'
def artifactGroupId = 'edu.wpi.first.wpilibc'
task cppSourcesZip(type: Zip) {
destinationDir = project.buildDir
classifier = "sources"
from(licenseFile) {
into '/'
}
from('src/main/native/cpp') {
into '/'
}
}
task cppHeadersZip(type: Zip) {
destinationDir = project.buildDir
classifier = "headers"
from(licenseFile) {
into '/'
}
from('src/main/native/include') {
into '/'
}
}
def linkFile = project.file("${buildDir}/libwpi.so")
task linkScriptZip(type: Zip) {
destinationDir = project.buildDir
baseName = 'zipwpiliblinkscript'
classifier = "linuxathena"
from(licenseFile) {
into '/'
}
from (linkFile) {
into '/linux/athena/'
}
}
model {
publishing {
def wpilibCTaskList = createComponentZipTasks($.components, 'wpilibc', 'zipcpp', Zip, project, includeStandardZipFormat)
def allTask
if (!project.hasProperty('jenkinsBuild')) {
allTask = createAllCombined(wpilibCTaskList, 'wpilibc', 'zipcpp', Zip, project)
}
$.components.each {
if (it in NativeLibrarySpec && it.name == 'wpilibc') {
def libSpec = it
tasks.create('generateWpilibLinkScript', Task) {
build.dependsOn it
linkScriptZip.dependsOn it
libSpec.binaries.each {
if (getClassifier(it) == 'linuxathena' && it in SharedLibraryBinarySpec) {
dependsOn it.buildTask
}
}
outputs.file linkFile
outputs.upToDateWhen { false }
doLast {
def libs = []
libSpec.binaries.each {
if (getClassifier(it) == 'linuxathena' && it in SharedLibraryBinarySpec) {
it.libs.each {
it.linkFiles.each {
libs.add it.name
}
}
libs.add it.sharedLibraryFile.name
}
}
linkFile.withWriter { out ->
out.println '/* GNU ld script */'
out.println 'OUTPUT_FORMAT(elf32-littlearm)'
out.print 'GROUP ( AS_NEEDED ( '
libs.each {
out.print '-l'
out.print it
out.print ' '
}
out.println ') )'
}
}
}
}
}
publications {
cpp(MavenPublication) {
wpilibCTaskList.each {
artifact it
}
if (!project.hasProperty('jenkinsBuild')) {
artifact allTask
}
artifact cppHeadersZip
artifact cppSourcesZip
artifactId = baseArtifactId
groupId artifactGroupId
version pubVersion
}
linkscripts(MavenPublication) {
artifact linkScriptZip
artifactId = 'linkscripts'
groupId artifactGroupId
version pubVersion
}
}
}
}