diff --git a/build.gradle b/build.gradle index 201451b1fb..9d1591a199 100644 --- a/build.gradle +++ b/build.gradle @@ -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')) { diff --git a/gmock/build.gradle b/gmock/build.gradle index 65364868b1..36ccde3f74 100644 --- a/gmock/build.gradle +++ b/gmock/build.gradle @@ -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' } } } diff --git a/java/java.gradle b/java/java.gradle index 34bf610ca3..5f55750f90 100644 --- a/java/java.gradle +++ b/java/java.gradle @@ -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) diff --git a/ntcore.def b/ntcore.def index a0b8ffe087..d731352a2f 100644 --- a/ntcore.def +++ b/ntcore.def @@ -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 diff --git a/publish.gradle b/publish.gradle index b7e620af9d..d403a01f0e 100644 --- a/publish.gradle +++ b/publish.gradle @@ -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/" } } } diff --git a/toolchains/mac.gradle b/toolchains/mac.gradle index ae1c822ff0..9c6f410964 100644 --- a/toolchains/mac.gradle +++ b/toolchains/mac.gradle @@ -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' } } }