Files
allwpilib/wpilibc/athena.gradle
Tyler Veness 083362bd86 Removed {@inheritDoc} from C++ sources and readded .inc files to Doxygen extension mapping
{@inheritDoc} doesn't exist in Doxygen, so I removed instances of it from the C++ source. It isn't needed anyway because Doxygen automatically fills in base class documentation for member functions in derived classes if no documentation is given. The extension mapping for .inc files was accidentally removed during the build system changes so this commit adds it back in.

Change-Id: I599e3bdafd76ee7d78a66090d81707cda5a399d7
2016-05-11 02:11:00 -07:00

183 lines
5.4 KiB
Groovy

defineNetworkTablesProperties()
def ntSourceDir = "$buildDir/ntSources"
model {
components {
wpilib_nonshared(NativeLibrarySpec) {
targetPlatform 'arm'
binaries.all {
tasks.withType(CppCompile) {
dependsOn addNiLibraryLinks
dependsOn addNetworkTablesLibraryLinks
}
}
sources {
cpp {
source {
srcDirs = ["${project.shared}/src", "${project.athena}/src"]
includes = ['**/*.cpp']
}
exportedHeaders {
srcDirs = ["${project.shared}/include", "${project.athena}/include", netTablesInclude]
includes = ['**/*.h']
}
lib project: ':hal', library: 'HALAthena', linkage: 'static'
}
}
}
}
}
task wpilibcZip(type: Zip) {
description = 'Zips all of the libraries for wpilibc'
group = 'WPILib'
baseName = 'wpilibc'
destinationDir = project.buildDir
// Include the static library file and header files from this project
binaries.withType(StaticLibraryBinarySpec) { spec ->
spec.headerDirs.each {
from(it) {
into 'include'
}
}
from(spec.staticLibraryFile) {
into 'lib'
}
}
// Include the static library file and shared library object from hal project
def hal = project(':hal')
hal.binaries.withType(StaticLibraryBinarySpec) { spec ->
spec.headerDirs.each {
from(it) {
into 'include'
// We don't want to include any of the .cpp files that are in some of the header directories
exclude '**/*.cpp'
}
}
from(spec.staticLibraryFile) {
into 'lib'
}
}
hal.binaries.withType(SharedLibraryBinarySpec) { spec ->
from(spec.sharedLibraryFile) {
into 'lib'
}
}
// Include the ntcore static and shared libraries
from(netSharedLib) {
into 'lib'
}
from(netStaticLib) {
into 'lib'
}
// We rename the libHALAthena.so object to libHALAthena_shared.so, and the same for libntcore.so
rename('(libHALAthena)(.so)', '$1_shared$2')
rename('(libntcore)(.so)', '$1_shared$2')
// Finally, include all of the shared library objects from the ni directory
from(project.file('../ni-libraries')) {
into 'lib'
exclude 'genlinks'
}
}
// Add the dependency on the wpilib_nonsharedStaticLibrary task to the wpilibc task. Because of the gradle lifecycle,
// this cannot be done purely with dependsOn in the task, as the static library task doesn't exist yet. Same goes for
// the networkTablesStaticLibrary task and the two HAL tasks below
tasks.whenTaskAdded { task ->
if (task.name == 'wpilib_nonsharedStaticLibrary') {
wpilibcZip.dependsOn task
}
}
// Add the hal static and shared libraries as a dependency
project(':hal').tasks.whenTaskAdded { task ->
if (task.name == 'hALAthenaStaticLibrary' || task.name == 'hALAthenaSharedLibrary') {
wpilibcZip.dependsOn task
}
}
if (checkDoxygen()) {
def ntSourcesDependency = project.dependencies.create('edu.wpi.first.wpilib.networktables.cpp:NetworkTables:3.0.0-SNAPSHOT:sources@zip')
def ntSourcesConfig = project.configurations.detachedConfiguration(ntSourcesDependency)
ntSourcesDependency.setTransitive(false)
def ntSources = ntSourcesConfig.singleFile
task unzipCppNtSources(type: Copy) {
description = 'Unzips the C++ networktables sources for doc creation'
group = 'WPILib'
from zipTree(ntSources)
exclude 'META-INF/*'
into ntSourceDir
}
doxygen {
def halLocation = '../hal'
source file("${project.shared}/src")
source file("${project.shared}/include")
source file("${project.athena}/src")
source file("${project.athena}/include")
source file("$ntSourceDir/src")
source file("$ntSourceDir/include")
source file("$halLocation/shared")
source file("$halLocation/Athena")
source file("$halLocation/include")
// template file('cpp.doxy')
exclude 'nivision.h'
extension_mapping 'inc=C++'
project_name 'WPILibC++'
javadoc_autobrief true
recursive true
quiet true
warnings false
warn_if_doc_error false
warn_no_paramdoc false
warn_format false
warn_logfile false
warn_if_undocumented false
generate_latex false
html_timestamp true
generate_treeview true
outputDir file("$buildDir/docs")
}
doxygen.dependsOn unzipCppNtSources
task doxygenZip(type: Zip) {
description = 'Generates doxygen zip file for publishing'
group = 'WPILib'
dependsOn doxygen
from doxygen.outputDir
}
}
publishing {
publications {
wpilibc(MavenPublication) {
artifact wpilibcZip
if (checkDoxygen()) {
artifact (doxygenZip) {
classifier = 'doxygen'
}
}
groupId 'edu.wpi.first.wpilib.cmake'
artifactId 'cpp-root'
version '1.0.0'
}
}
setupWpilibRepo(it)
}
clean {
ntSourceDir
}