mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Add documentation building to repo (#1238)
Running build will now build docs. If you just want to build docs, run :documentation:build
This commit is contained in:
committed by
Peter Johnson
parent
186e1dc54b
commit
75a67202e5
147
docs/build.gradle
Normal file
147
docs/build.gradle
Normal file
@@ -0,0 +1,147 @@
|
||||
plugins {
|
||||
id 'org.ysb33r.doxygen' version '0.4'
|
||||
id 'java'
|
||||
}
|
||||
|
||||
evaluationDependsOn(':wpiutil')
|
||||
evaluationDependsOn(':ntcore')
|
||||
evaluationDependsOn(':cscore')
|
||||
evaluationDependsOn(':hal')
|
||||
evaluationDependsOn(':cameraserver')
|
||||
evaluationDependsOn(':wpilibc')
|
||||
evaluationDependsOn(':wpilibj')
|
||||
|
||||
def pubVersion = ''
|
||||
if (project.hasProperty("publishVersion")) {
|
||||
pubVersion = project.publishVersion
|
||||
} else {
|
||||
pubVersion = WPILibVersion.version
|
||||
}
|
||||
|
||||
def baseArtifactIdCpp = 'documentation'
|
||||
def artifactGroupIdCpp = 'edu.wpi.first.wpilibc'
|
||||
def zipBaseNameCpp = '_GROUP_edu_wpi_first_wpilibc_ID_documentation_CLS'
|
||||
|
||||
def baseArtifactIdJava = 'documentation'
|
||||
def artifactGroupIdJava = 'edu.wpi.first.wpilibj'
|
||||
def zipBaseNameJava = '_GROUP_edu_wpi_first_wpilibj_ID_documentation_CLS'
|
||||
|
||||
def outputsFolder = file("$project.buildDir/outputs")
|
||||
|
||||
def cppProjectZips = []
|
||||
|
||||
cppProjectZips.add(project(':hal').cppHeadersZip)
|
||||
cppProjectZips.add(project(':wpiutil').cppHeadersZip)
|
||||
cppProjectZips.add(project(':ntcore').cppHeadersZip)
|
||||
cppProjectZips.add(project(':cscore').cppHeadersZip)
|
||||
cppProjectZips.add(project(':cameraserver').cppHeadersZip)
|
||||
cppProjectZips.add(project(':wpilibc').cppHeadersZip)
|
||||
|
||||
doxygen {
|
||||
executables {
|
||||
doxygen version : '1.8.8'
|
||||
}
|
||||
}
|
||||
|
||||
doxygen {
|
||||
generate_html true
|
||||
|
||||
cppProjectZips.each {
|
||||
dependsOn it
|
||||
source it.source
|
||||
}
|
||||
|
||||
extension_mapping 'inc=C++'
|
||||
project_name 'WPILibC++'
|
||||
project_number pubVersion
|
||||
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
|
||||
}
|
||||
|
||||
tasks.register("zipCppDocs", Zip) {
|
||||
baseName = zipBaseNameCpp
|
||||
destinationDir = outputsFolder
|
||||
dependsOn doxygen
|
||||
from ("$buildDir/docs/doxygen/html")
|
||||
into '/'
|
||||
}
|
||||
|
||||
|
||||
// Java
|
||||
configurations {
|
||||
javaSource {
|
||||
transitive false
|
||||
}
|
||||
}
|
||||
|
||||
ext {
|
||||
sharedCvConfigs = [:]
|
||||
staticCvConfigs = [:]
|
||||
useJava = true
|
||||
useCpp = false
|
||||
skipDev = true
|
||||
useDocumentation = true
|
||||
}
|
||||
|
||||
apply from: "${rootDir}/shared/opencv.gradle"
|
||||
|
||||
task generateJavaDocs(type: Javadoc) {
|
||||
javadoc.options.links("http://docs.oracle.com/javase/8/docs/api/")
|
||||
options.addStringOption "tag", "pre:a:Pre-Condition"
|
||||
options.addStringOption('Xdoclint:accessibility,syntax,html', '-quiet')
|
||||
dependsOn project(':wpilibj').generateJavaVersion
|
||||
source project(':hal').sourceSets.main.java
|
||||
source project(':wpiutil').sourceSets.main.java
|
||||
source project(':cscore').sourceSets.main.java
|
||||
source project(':ntcore').sourceSets.main.java
|
||||
source project(':wpilibj').sourceSets.main.java
|
||||
source project(':cameraserver').sourceSets.main.java
|
||||
source configurations.javaSource.collect { zipTree(it) }
|
||||
include '**/*.java'
|
||||
failOnError = true
|
||||
}
|
||||
|
||||
tasks.register("zipJavaDocs", Zip) {
|
||||
baseName = zipBaseNameJava
|
||||
destinationDir = outputsFolder
|
||||
dependsOn generateJavaDocs
|
||||
from ("$buildDir/docs/javadoc")
|
||||
into '/'
|
||||
}
|
||||
|
||||
addTaskToCopyAllOutputs(zipCppDocs)
|
||||
addTaskToCopyAllOutputs(zipJavaDocs)
|
||||
|
||||
build.dependsOn zipCppDocs
|
||||
build.dependsOn zipJavaDocs
|
||||
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
java(MavenPublication) {
|
||||
artifact zipJavaDocs
|
||||
|
||||
artifactId = "${baseArtifactIdJava}"
|
||||
groupId artifactGroupIdJava
|
||||
version pubVersion
|
||||
}
|
||||
cpp(MavenPublication) {
|
||||
artifact zipCppDocs
|
||||
|
||||
artifactId = "${baseArtifactIdCpp}"
|
||||
groupId artifactGroupIdCpp
|
||||
version pubVersion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,3 +28,4 @@ include 'simulation:lowfi_simulation'
|
||||
include 'simulation:halsim_ds_socket'
|
||||
include 'cameraserver'
|
||||
include 'myRobot'
|
||||
include 'docs'
|
||||
|
||||
Reference in New Issue
Block a user