Adds header task to print out all headers (#704)

Will be used to create a generator for IDE's to get include paths.
This commit is contained in:
Thad House
2017-11-03 22:50:06 -07:00
committed by Peter Johnson
parent 45d48d6b5a
commit bee9f1cb17
3 changed files with 82 additions and 0 deletions

View File

@@ -202,6 +202,32 @@ model {
}
}
}
getHeaders(Task) {
def list = []
$.components.each {
if (it in NativeLibrarySpec && (it.name == 'halAthena' || it.name == 'halSim')) {
it.sources.each {
it.exportedHeaders.srcDirs.each {
list.add(it)
}
}
it.binaries.each {
it.libs.each {
it.includeRoots.each {
list.add(it)
}
}
}
}
}
list = list.unique(false)
doLast {
list.each {
print "WPIHEADER: "
println it
}
}
}
}
}

View File

@@ -202,6 +202,32 @@ model {
}
}
}
getHeaders(Task) {
def list = []
$.components.each {
if (it in NativeLibrarySpec && it.name == 'wpilibc') {
it.sources.each {
it.exportedHeaders.srcDirs.each {
list.add(it)
}
}
it.binaries.each {
it.libs.each {
it.includeRoots.each {
list.add(it)
}
}
}
}
}
list = list.unique(false)
doLast {
list.each {
print "WPIHEADER: "
println it
}
}
}
}
}

View File

@@ -273,6 +273,36 @@ model {
it.buildable = false
}
}
tasks {
getHeaders(Task) {
def list = []
$.components.each {
if (it in NativeLibrarySpec && it.name == 'wpilibJNIStatic') {
it.sources.each {
it.exportedHeaders.srcDirs.each {
list.add(it)
}
}
it.binaries.each {
it.libs.each {
it.includeRoots.each {
list.add(it)
}
}
}
}
}
// use file to normalize this dir
list.add(file("$buildDir/wpilibJNIStatic/jniinclude"))
list = list.unique(false)
doLast {
list.each {
print "WPIHEADER: "
println it
}
}
}
}
}
apply from: 'publish.gradle'