mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
Fixed javadoc generation to actually download cscore and ntcore and include the source in its output. (#368)
This commit is contained in:
committed by
Peter Johnson
parent
4de70bff5e
commit
4bbb7c0bcc
12
build.gradle
12
build.gradle
@@ -18,6 +18,18 @@ allprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
ext.ntcoreDep = { lang, classifier, extension = null ->
|
||||
return "edu.wpi.first.wpilib.networktables.$lang:NetworkTables:+:$classifier${extension == null ? '' : '@' + extension}"
|
||||
}
|
||||
|
||||
ext.cscoreDep = { lang, classifier, extension = null ->
|
||||
return "edu.wpi.cscore.$lang:cscore:+:$classifier${extension == null ? '' : '@' + extension}"
|
||||
}
|
||||
|
||||
ext.wpiUtilDep = { classifier ->
|
||||
return "edu.wpi.first.wpilib:wpiutil:+:$classifier@zip"
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
|
||||
@@ -2,7 +2,7 @@ apply plugin: 'cpp'
|
||||
|
||||
def jniDir = 'src/athena/cpp'
|
||||
def generatedJNIHeaderLoc = "$buildDir/include"
|
||||
def ntSourceDir = "$buildDir/ntSources"
|
||||
def docSource = "$buildDir/docSource"
|
||||
|
||||
debugStripSetup(project)
|
||||
|
||||
@@ -10,14 +10,18 @@ sourceSets {
|
||||
athena
|
||||
}
|
||||
|
||||
configurations.create('doc')
|
||||
|
||||
dependencies {
|
||||
athenaCompile sourceSets.shared.output
|
||||
athenaCompile 'edu.wpi.first.wpilib.networktables.java:NetworkTables:+:arm'
|
||||
athenaRuntime 'edu.wpi.first.wpilib.networktables.java:NetworkTables:+:arm'
|
||||
athenaCompile 'edu.wpi.cscore.java:cscore:+:arm'
|
||||
athenaRuntime 'edu.wpi.cscore.java:cscore:+:arm'
|
||||
athenaCompile ntcoreDep('java', 'arm')
|
||||
athenaRuntime ntcoreDep('java', 'arm')
|
||||
athenaCompile cscoreDep('java', 'arm')
|
||||
athenaRuntime cscoreDep('java', 'arm')
|
||||
athenaCompile 'org.opencv:opencv-java:+'
|
||||
athenaRuntime 'org.opencv:opencv-java:+'
|
||||
doc ntcoreDep('java', 'sources')
|
||||
doc cscoreDep('java', 'sources')
|
||||
}
|
||||
|
||||
defineWpiUtilProperties()
|
||||
@@ -108,26 +112,16 @@ task wpilibjSources(type: Jar, dependsOn: classes) {
|
||||
from sourceSets.shared.allJava
|
||||
}
|
||||
|
||||
task unzipJavaNtSources(type: Copy) {
|
||||
description = 'Unzips the java networktables sources for doc creation'
|
||||
group = 'WPILib'
|
||||
doFirst {
|
||||
def ntSourcesDependency =
|
||||
project.dependencies.create('edu.wpi.first.wpilib.networktables.java:NetworkTables:+:sources@jar')
|
||||
def ntSourcesConfig = project.configurations.detachedConfiguration(ntSourcesDependency)
|
||||
ntSourcesDependency.setTransitive(false)
|
||||
def ntSources = ntSourcesConfig.singleFile
|
||||
}
|
||||
doLast {
|
||||
from zipTree(ntSources)
|
||||
exclude 'META-INF/*'
|
||||
into ntSourceDir
|
||||
task unzipDocSources(type: Copy) {
|
||||
configurations.doc.files.each {
|
||||
from zipTree(it)
|
||||
}
|
||||
include '**/*.java'
|
||||
into docSource
|
||||
}
|
||||
|
||||
task javadoc(type: Javadoc, overwrite: true) {
|
||||
dependsOn unzipJavaNtSources
|
||||
source sourceSets.athena.allJava, sourceSets.shared.allJava, unzipJavaNtSources.outputs.files
|
||||
source sourceSets.athena.allJava, sourceSets.shared.allJava, unzipDocSources
|
||||
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"
|
||||
@@ -215,5 +209,5 @@ build.dependsOn wpilibjNativeLibraries
|
||||
|
||||
clean {
|
||||
delete generatedJNIHeaderLoc
|
||||
delete ntSourceDir
|
||||
delete docSource
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user