This commit adds documentation generation,

including grabbing ntcore sources, for both
Java and C++. This will need changes made in
the wpilib promotion tasks to copy the generatd
documentation to the correct places.

Change-Id: I64590b5eda001da2cc8ae498b2b1c0fd298da284
This commit is contained in:
Fredric Silberberg
2015-12-22 14:16:15 -05:00
parent 20749ed6e9
commit 729545809e
4 changed files with 95 additions and 5 deletions

3
.gitignore vendored
View File

@@ -175,3 +175,6 @@ __pycache__
#catkin stuff
package.xml
# Doxygen stuff
NO

View File

@@ -1,5 +1,7 @@
defineNetworkTablesProperties()
def ntSourceDir = "$buildDir/ntSources"
model {
components {
wpilib_nonshared(NativeLibrarySpec) {
@@ -93,7 +95,6 @@ tasks.whenTaskAdded { task ->
}
}
// Add the hal static and shared libraries as a dependency
project(':hal').tasks.whenTaskAdded { task ->
if (task.name == 'hALAthenaStaticLibrary' || task.name == 'hALAthenaSharedLibrary') {
@@ -101,10 +102,72 @@ project(':hal').tasks.whenTaskAdded { 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 'pcre.h'
exclude 'nivision.h'
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'
@@ -113,3 +176,7 @@ publishing {
setupWpilibRepo(it)
}
clean {
ntSourceDir
}

View File

@@ -1,5 +1,8 @@
apply plugin: 'cpp'
apply plugin: 'maven-publish'
plugins {
id 'org.ysb33r.doxygen' version '0.2'
id 'cpp'
id 'maven-publish'
}
evaluationDependsOn(':hal')
@@ -9,7 +12,7 @@ ext.simulation = 'simluation'
// Attempts to execute the doxygen command. If there is no exception, doxygen exists, so return true. If there's
// an IOException, it doesn't exist, so return false
boolean checkDoxygen() {
ext.checkDoxygen = {
try {
'doxygen'.execute()
true

View File

@@ -2,6 +2,7 @@ apply plugin: 'cpp'
def jniDir = 'src/athena/cpp'
def generatedJNIHeaderLoc = "$buildDir/include"
def ntSourceDir = "$buildDir/ntSources"
sourceSets {
athena
@@ -103,8 +104,23 @@ task wpilibjSources(type: Jar, dependsOn: classes) {
from sourceSets.shared.allJava
}
def ntSourcesDependency =
project.dependencies.create('edu.wpi.first.wpilib.networktables.java:NetworkTables:3.0.0-SNAPSHOT:sources@jar')
def ntSourcesConfig = project.configurations.detachedConfiguration(ntSourcesDependency)
ntSourcesDependency.setTransitive(false)
def ntSources = ntSourcesConfig.singleFile
task unzipJavaNtSources(type: Copy) {
description = 'Unzips the java networktables sources for doc creation'
group = 'WPILib'
from zipTree(ntSources)
exclude 'META-INF/*'
into ntSourceDir
}
task javadoc(type: Javadoc, overwrite: true) {
source sourceSets.athena.allJava, sourceSets.shared.allJava
dependsOn unzipJavaNtSources
source sourceSets.athena.allJava, sourceSets.shared.allJava, unzipJavaNtSources.outputs.files
classpath = files([sourceSets.athena.compileClasspath, sourceSets.shared.compileClasspath])
javadoc.options.links("http://docs.oracle.com/javase/8/docs/api/")
options.addStringOption "tag", "pre:a:Pre-Condition"
@@ -158,4 +174,5 @@ task jniHeaders {
clean {
delete generatedJNIHeaderLoc
delete ntSourceDir
}