Adds an UberZip that preincludes the opencv libraries

Helps eclipse a lot
This commit is contained in:
Thad House
2016-11-05 12:01:16 -07:00
parent 38a3eda6a7
commit e07a40a16d
2 changed files with 65 additions and 1 deletions

View File

@@ -175,6 +175,63 @@ def cameraserverZipTask = { project ->
}
}
def cameraserverUberZipTask = { project ->
if (project.isArm) {
project.ext.cameraserverUberZip = project.tasks.create("armCameraserverUberZip", Zip) {
description = 'Create platform-specific zip of cameraserver libraries including opencv'
group = 'WPILib'
destinationDir = project.buildDir
baseName = 'cameraserver'
classifier= "uber${project.buildPlatform}"
duplicatesStrategy = 'exclude'
from(file('include')) {
into 'include'
}
if (!project.hasProperty('skipJava')) {
project.jniHeadersCameraServer.outputs.each {
from(it) {
into 'include'
}
}
}
project.model {
def openCvPlatform = project.getOpenCvPlatformPackage(targetPlatform)
from(file("${project.openCv}/${openCvPlatform}")) {
exclude 'META-INF'
into 'lib'
}
binaries {
withType(StaticLibraryBinarySpec) { binary ->
from(binary.staticLibraryFile) {
into 'lib'
}
}
withType(SharedLibraryBinarySpec) { binary ->
from(binary.sharedLibraryFile) {
into 'lib'
}
from (new File(binary.sharedLibraryFile.absolutePath + ".debug")) {
into 'lib'
}
}
}
}
}
project.build.dependsOn project.cameraserverUberZip
project.tasks.whenTaskAdded { task ->
def name = task.name.toLowerCase()
if (name.contains("cameraserversharedlibrary") || name.contains("cameraserverstaticlibrary") || name.contains("cameraservertest")) {
project.cameraserverUberZip.dependsOn task
}
}
}
}
if (buildArm) {
project(':arm') {
apply plugin: 'cpp'
@@ -189,6 +246,7 @@ if (buildArm) {
cameraserverZipTask(project)
useWpiUtil(project)
useOpenCv(project)
cameraserverUberZipTask(project)
}
}

View File

@@ -50,7 +50,10 @@ publishing {
// If the library is not embedded include it in the repo
if (!project.hasProperty('compilerPrefix')) {
artifact camArm.cameraserverZip
}
}
artifact camArm.armCameraserverUberZip {
classifier = 'uberzip'
}
}
if (!OperatingSystem.current().isWindows()) {
if (project.hasProperty('makeDesktop')) {
@@ -72,6 +75,9 @@ publishing {
artifact cameraserverSourceZip
if (project.buildArm) {
artifact project(':arm').cameraserverZip
artifact project(':arm').armCameraserverUberZip {
classifier = 'uberzip'
}
}
if (!OperatingSystem.current().isWindows()) {
if (project.hasProperty('makeDesktop')) {