Updated the definitions file to add overloaded functions, added

no-unused-private-field for Mac builds. Gradle also now works
with the classifier-based dependency system, rather than having
separate repos for every level.

Change-Id: I2eb87391181e91b5675e3e982e4d915be83e14ea
This commit is contained in:
Fredric Silberberg
2015-11-21 11:13:37 -05:00
parent c76e60324b
commit 26c27756af
6 changed files with 42 additions and 40 deletions

View File

@@ -13,6 +13,12 @@ allprojects {
}
}
if (!project.hasProperty('repo')) {
ext.repo = 'development'
}
ext.useExtension = repo != 'release'
ext.getPlatformPath = { binary ->
if (binary.targetPlatform.architecture.arm) {
return 'Linux/arm'
@@ -134,6 +140,7 @@ task ntcoreZip(type: Zip) {
group = 'WPILib'
destinationDir = project.buildDir
baseName = 'ntcore'
classifier = "$buildPlatform${useExtension ? '-' + repo : ''}"
from(file('include')) {
into 'include'
@@ -165,7 +172,7 @@ task ntcoreSourceZip(type: Zip) {
group = 'WPILib'
destinationDir = project.buildDir
baseName = 'ntcore'
classifier = 'sources'
classifier = "sources${useExtension ? '-' + repo : ''}"
from ('src') {
into 'src'
@@ -188,6 +195,8 @@ task ntcoreSourceZip(type: Zip) {
}
}
build.dependsOn ntcoreSourceZip
releaseSetup(ntcoreZip)
if (!hasProperty('skipJava')) {

View File

@@ -45,8 +45,7 @@ model {
if (toolChain in VisualCpp) {
cppCompiler.args '-D_UNICODE', '-DUNICODE', '-DWIN32', '-D_WIN32', '-DSTRICT', '-DWIN32_LEAN_AND_MEAN', '-D_HAS_EXCEPTIONS=1'
} else {
cppCompiler.args '-Wall', '-Wshadow', '-fexceptions', '-Wextra', '-Wno-unused-parameter', '-Wno-missing-field-initializers', '-fPIC'
linker.args '-pthread'
cppCompiler.args '-Wall', '-Wshadow', '-fexceptions', '-Wextra', '-Wno-unused-parameter', '-Wno-missing-field-initializers', '-pthread', '-fPIC'
}
}
}

View File

@@ -15,6 +15,7 @@ sourceSets {
jar {
description = 'Generates NetworkTables jar, with the JNI shared libraries embedded'
baseName = 'ntcore'
classifier = "$buildPlatform${useExtension ? '-' + repo : ''}"
if (buildPlatform == 'arm') {
dependsOn { ntcoreSharedLibrary }
@@ -34,17 +35,22 @@ jar {
task networktablesJavaSource(type: Jar, dependsOn: classes) {
description = 'Generates the source jar for NetworkTables java'
group = 'WPILib'
classifier = 'source'
baseName = 'ntcore'
classifier = "sources${useExtension ? '-' + repo : ''}"
from sourceSets.main.allJava
}
task networktablesJavadoc(type: Jar, dependsOn: javadoc) {
description = 'Generates the javadoc jar for NetworkTables java'
group = 'WPILib'
classifier = 'javadoc'
baseName = 'ntcore'
classifier = "javadoc${useExtension ? '-' + repo : ''}"
from javadoc.destinationDir
}
build.dependsOn networktablesJavaSource
build.dependsOn networktablesJavadoc
/**
* Generates the JNI headers
*/
@@ -96,7 +102,9 @@ ext.setupJniIncludes = { binaries ->
def jdkLocation = org.gradle.internal.jvm.Jvm.current().javaHome
platformSpecificIncludeFlag("${jdkLocation}/include", cppCompiler)
if (targetPlatform.operatingSystem.linux) {
if (targetPlatform.operatingSystem.macOsX) {
platformSpecificIncludeFlag("${jdkLocation}/include/darwin", cppCompiler)
} else if (targetPlatform.operatingSystem.linux) {
platformSpecificIncludeFlag("${jdkLocation}/include/linux", cppCompiler)
} else if (targetPlatform.operatingSystem.windows) {
platformSpecificIncludeFlag("${jdkLocation}/include/win32", cppCompiler)

View File

@@ -85,14 +85,16 @@ Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_getType
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_putBoolean
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_putDouble
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_putString
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_putRaw
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_putRaw__Ljava_lang_String_2_3B
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_putRaw__Ljava_lang_String_2Ljava_nio_ByteBuffer_2I
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_putBooleanArray
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_putDoubleArray
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_putStringArray
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_forcePutBoolean
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_forcePutDouble
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_forcePutString
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_forcePutRaw
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_forcePutRaw__Ljava_lang_String_2_3B
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_forcePutRaw__Ljava_lang_String_2Ljava_nio_ByteBuffer_2I
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_forcePutBooleanArray
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_forcePutDoubleArray
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_forcePutStringArray
@@ -124,7 +126,8 @@ Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_addConnectionListener
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_removeConnectionListener
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_getRpc__Ljava_lang_String_2
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_getRpc__Ljava_lang_String_2_3B
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_callRpc
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_callRpc__Ljava_lang_String_2_3B
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_callRpc__Ljava_lang_String_2Ljava_nio_ByteBuffer_2I
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_setNetworkIdentity
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_startServer
Java_edu_wpi_first_wpilibj_networktables_NetworkTablesJNI_stopServer

View File

@@ -2,21 +2,15 @@ import org.gradle.internal.os.OperatingSystem
apply plugin: 'maven-publish'
// We classify the different artifacts by whether they are sources, and what development
// stage they are in. Release gets no classifier; stable, beta, and development get classifiers.
publishing {
publications {
if (!project.hasProperty('skipJava')) {
java(MavenPublication) {
artifact jar {
// If we're building the regular ntcore for arm, it has no classifier. Otherwise, classify
// the platform this jar is built for.
classifier = buildPlatform
}
artifact (networktablesJavaSource) {
classifier = 'sources'
}
artifact(networktablesJavadoc) {
classifier = 'javadoc'
}
artifact jar
artifact networktablesJavaSource
artifact networktablesJavadoc
groupId 'edu.wpi.first.wpilib.networktables.java'
artifactId 'NetworkTables'
@@ -24,13 +18,8 @@ publishing {
}
}
cpp(MavenPublication) {
artifact ntcoreZip {
classifier = buildPlatform
}
artifact ntcoreSourceZip {
classifier = 'sources'
}
artifact ntcoreZip
artifact ntcoreSourceZip
groupId 'edu.wpi.first.wpilib.networktables.cpp'
artifactId 'NetworkTables'
@@ -38,17 +27,9 @@ publishing {
}
}
// If we want to publish to a specific repository on Jenkins, we specify it on the command line. The valid
// repository names are:
// release
// stable
// beta
// development
if (project.hasProperty('repo')) {
repositories {
maven {
url "${System.getProperty('user.home')}/releases/maven/$repo"
}
repositories {
maven {
url "${System.getProperty('user.home')}/releases/maven/"
}
}
}

View File

@@ -4,7 +4,8 @@ model {
target('x86') {
cppCompiler.withArguments { args ->
args << '-std=c++11' << '-Wall' << '-Wextra' << '-Werror' << '-pedantic-errors'
args << '-Wno-unused-parameter' << '-fPIC' << '-m32' << '-Wno-missing-field-initializers'
args << '-fPIC' << '-m32'
args << '-Wno-unused-parameter' << '-Wno-missing-field-initializers' << '-Wno-unused-private-field'
}
linker.withArguments { args ->
args << '-m32'
@@ -13,7 +14,8 @@ model {
target('x64') {
cppCompiler.withArguments { args ->
args << '-std=c++11' << '-Wall' << '-Wextra' << '-Werror' << '-pedantic-errors'
args << '-Wno-unused-parameter' << '-fPIC' << '-Wno-missing-field-initializers'
args << '-fPIC'
args << '-Wno-missing-field-initializers' << '-Wno-unused-private-field' << '-Wno-unused-parameter'
}
}
}