mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
[wpinet] Move network portions of wpiutil into new wpinet library (#4077)
This commit is contained in:
2
.github/workflows/sanitizers.yml
vendored
2
.github/workflows/sanitizers.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
- name: asan
|
||||
cmake-flags: "-DCMAKE_BUILD_TYPE=Asan"
|
||||
ctest-env: ""
|
||||
ctest-flags: "-E 'wpiutil|ntcore|wpilibc'"
|
||||
ctest-flags: "-E 'wpinet|wpiutil|ntcore|wpilibc'"
|
||||
- name: tsan
|
||||
cmake-flags: "-DCMAKE_BUILD_TYPE=Tsan"
|
||||
ctest-env: "TSAN_OPTIONS=second_deadlock_stack=1"
|
||||
|
||||
@@ -44,4 +44,5 @@ includeOtherLibs {
|
||||
^wpi/
|
||||
^wpigui
|
||||
^wpimath/
|
||||
^wpinet/
|
||||
}
|
||||
|
||||
@@ -148,6 +148,7 @@ find_package(LIBSSH 0.7.1)
|
||||
|
||||
if (WITH_FLAT_INSTALL)
|
||||
set(WPIUTIL_DEP_REPLACE "include($\{SELF_DIR\}/wpiutil-config.cmake)")
|
||||
set(WPINET_DEP_REPLACE "include($\{SELF_DIR\}/wpinet-config.cmake)")
|
||||
set(NTCORE_DEP_REPLACE "include($\{SELF_DIR\}/ntcore-config.cmake)")
|
||||
set(CSCORE_DEP_REPLACE_IMPL "include(\${SELF_DIR}/cscore-config.cmake)")
|
||||
set(CAMERASERVER_DEP_REPLACE_IMPL "include(\${SELF_DIR}/cameraserver-config.cmake)")
|
||||
@@ -157,6 +158,7 @@ set(WPILIBC_DEP_REPLACE_IMPL "include(\${SELF_DIR}/wpilibc-config.cmake)")
|
||||
set(WPILIBNEWCOMMANDS_DEP_REPLACE "include(\${SELF_DIR}/wpilibNewcommands-config.cmake)")
|
||||
else()
|
||||
set(WPIUTIL_DEP_REPLACE "find_dependency(wpiutil)")
|
||||
set(WPINET_DEP_REPLACE "find_dependency(wpinet)")
|
||||
set(NTCORE_DEP_REPLACE "find_dependency(ntcore)")
|
||||
set(CSCORE_DEP_REPLACE_IMPL "find_dependency(cscore)")
|
||||
set(CAMERASERVER_DEP_REPLACE_IMPL "find_dependency(cameraserver)")
|
||||
@@ -245,6 +247,7 @@ if (WITH_TESTS)
|
||||
endif()
|
||||
|
||||
add_subdirectory(wpiutil)
|
||||
add_subdirectory(wpinet)
|
||||
add_subdirectory(ntcore)
|
||||
|
||||
if (WITH_WPIMATH)
|
||||
|
||||
@@ -24,9 +24,7 @@ LLVM wpiutil/src/main/native/include/wpi/{various files}
|
||||
JSON for Modern C++ wpiutil/src/main/native/include/wpi/json.h
|
||||
wpiutil/src/main/native/cpp/json_*.cpp
|
||||
wpiutil/src/test/native/cpp/json/
|
||||
libuv wpiutil/src/main/native/include/uv.h
|
||||
wpiutil/src/main/native/include/uv/
|
||||
wpiutil/src/main/native/libuv/
|
||||
libuv wpinet/src/main/native/thirdparty/libuv/
|
||||
fmtlib wpiutil/src/main/native/fmtlib/
|
||||
sigslot wpiutil/src/main/native/include/wpi/Signal.h
|
||||
wpiutil/src/test/native/cpp/sigslot/
|
||||
@@ -34,11 +32,11 @@ tcpsockets wpiutil/src/main/native/cpp/TCP{Stream,Connector,Acceptor}
|
||||
wpiutil/src/main/native/include/wpi/TCP*.h
|
||||
MPack wpiutil/src/main/native/include/mpack.h
|
||||
wpiutil/src/main/native/cpp/mpack.cpp
|
||||
Bootstrap wpiutil/src/main/native/resources/bootstrap-*
|
||||
CoreUI wpiutil/src/main/native/resources/coreui-*
|
||||
Feather Icons wpiutil/src/main/native/resources/feather-*
|
||||
jQuery wpiutil/src/main/native/resources/jquery-*
|
||||
popper.js wpiutil/src/main/native/resources/popper-*
|
||||
Bootstrap wpinet/src/main/native/resources/bootstrap-*
|
||||
CoreUI wpinet/src/main/native/resources/coreui-*
|
||||
Feather Icons wpinet/src/main/native/resources/feather-*
|
||||
jQuery wpinet/src/main/native/resources/jquery-*
|
||||
popper.js wpinet/src/main/native/resources/popper-*
|
||||
units wpimath/src/main/native/include/units/
|
||||
Eigen wpimath/src/main/native/eigeninclude/
|
||||
wpimath/src/main/native/include/unsupported/
|
||||
|
||||
@@ -11,9 +11,11 @@ apply from: "${rootDir}/shared/javacpp/setupBuild.gradle"
|
||||
|
||||
dependencies {
|
||||
implementation project(':wpiutil')
|
||||
implementation project(':wpinet')
|
||||
implementation project(':ntcore')
|
||||
implementation project(':cscore')
|
||||
devImplementation project(':wpiutil')
|
||||
devImplementation project(':wpinet')
|
||||
devImplementation project(':ntcore')
|
||||
devImplementation project(':cscore')
|
||||
}
|
||||
@@ -70,6 +72,7 @@ model {
|
||||
}
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
|
||||
lib project: ':cscore', library: 'cscore', linkage: 'shared'
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ dependencies {
|
||||
implementation 'com.google.code.gson:gson:2.8.9'
|
||||
|
||||
implementation project(':wpiutil')
|
||||
implementation project(':wpinet')
|
||||
implementation project(':ntcore')
|
||||
implementation project(':cscore')
|
||||
implementation project(':cameraserver')
|
||||
@@ -55,6 +56,7 @@ model {
|
||||
lib project: ':cameraserver', library: 'cameraserver', linkage: 'static'
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'static'
|
||||
lib project: ':cscore', library: 'cscore', linkage: 'static'
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'static'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,6 +91,7 @@ model {
|
||||
}
|
||||
project(':hal').addHalDependency(binary, 'shared')
|
||||
project(':hal').addHalJniDependency(binary)
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
nativeUtils.useRequiredLibrary(binary, 'ni_link_libraries', 'ni_runtime_libraries')
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <hal/cpp/fpga_clock.h>
|
||||
#include <wpi/Logger.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
#include <wpi/UDPClient.h>
|
||||
#include <wpinet/UDPClient.h>
|
||||
|
||||
static void LoggerFunc(unsigned int level, const char* file, unsigned int line,
|
||||
const char* msg) {
|
||||
|
||||
@@ -36,4 +36,5 @@ includeOtherLibs {
|
||||
^support/
|
||||
^tcpsockets/
|
||||
^wpi/
|
||||
^wpinet/
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ target_include_directories(cscore PUBLIC
|
||||
$<INSTALL_INTERFACE:${include_dest}/cscore>)
|
||||
target_include_directories(cscore PRIVATE src/main/native/cpp)
|
||||
wpilib_target_warnings(cscore)
|
||||
target_link_libraries(cscore PUBLIC wpiutil ${OpenCV_LIBS})
|
||||
target_link_libraries(cscore PUBLIC wpinet wpiutil ${OpenCV_LIBS})
|
||||
|
||||
set_property(TARGET cscore PROPERTY FOLDER "libraries")
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ model {
|
||||
return
|
||||
}
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
|
||||
if (it.targetPlatform.operatingSystem.linux) {
|
||||
it.linker.args '-Wl,--version-script=' + file('src/main/native/LinuxSymbolScript.txt')
|
||||
@@ -55,6 +56,15 @@ model {
|
||||
}
|
||||
}
|
||||
}
|
||||
binaries {
|
||||
all {
|
||||
if (!it.buildable || !(it instanceof NativeBinarySpec)) {
|
||||
return
|
||||
}
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -190,6 +200,7 @@ model {
|
||||
targetBuildTypes 'debug'
|
||||
binaries.all {
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
|
||||
lib library: 'cscore', linkage: 'shared'
|
||||
nativeUtils.useRequiredLibrary(it, 'imgui_static')
|
||||
@@ -220,6 +231,7 @@ model {
|
||||
targetBuildTypes 'debug'
|
||||
binaries.all {
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib library: 'cscore', linkage: 'shared'
|
||||
}
|
||||
sources {
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
#include <wpi/MemAlloc.h>
|
||||
#include <wpi/StringExtras.h>
|
||||
#include <wpi/TCPConnector.h>
|
||||
#include <wpi/timestamp.h>
|
||||
#include <wpinet/TCPConnector.h>
|
||||
|
||||
#include "Handle.h"
|
||||
#include "Instance.h"
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
#include <wpi/HttpUtil.h>
|
||||
#include <wpi/SmallString.h>
|
||||
#include <wpi/StringMap.h>
|
||||
#include <wpi/condition_variable.h>
|
||||
#include <wpi/raw_istream.h>
|
||||
#include <wpi/span.h>
|
||||
#include <wpinet/HttpUtil.h>
|
||||
|
||||
#include "SourceImpl.h"
|
||||
#include "cscore_cpp.h"
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include <wpi/EventLoopRunner.h>
|
||||
#include <wpi/Logger.h>
|
||||
#include <wpinet/EventLoopRunner.h>
|
||||
|
||||
#include "Log.h"
|
||||
#include "NetworkListener.h"
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
#include <chrono>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/HttpUtil.h>
|
||||
#include <wpi/SmallString.h>
|
||||
#include <wpi/StringExtras.h>
|
||||
#include <wpi/TCPAcceptor.h>
|
||||
#include <wpi/fmt/raw_ostream.h>
|
||||
#include <wpi/raw_socket_istream.h>
|
||||
#include <wpi/raw_socket_ostream.h>
|
||||
#include <wpinet/HttpUtil.h>
|
||||
#include <wpinet/TCPAcceptor.h>
|
||||
#include <wpinet/raw_socket_istream.h>
|
||||
#include <wpinet/raw_socket_ostream.h>
|
||||
|
||||
#include "Handle.h"
|
||||
#include "Instance.h"
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
#include <wpi/NetworkAcceptor.h>
|
||||
#include <wpi/NetworkStream.h>
|
||||
#include <wpi/SafeThread.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
#include <wpi/raw_istream.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
#include <wpi/raw_socket_ostream.h>
|
||||
#include <wpinet/NetworkAcceptor.h>
|
||||
#include <wpinet/NetworkStream.h>
|
||||
#include <wpinet/raw_socket_ostream.h>
|
||||
|
||||
#include "SinkImpl.h"
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#include "cscore_cpp.h"
|
||||
|
||||
#include <wpi/SmallString.h>
|
||||
#include <wpi/hostname.h>
|
||||
#include <wpi/json.h>
|
||||
#include <wpinet/hostname.h>
|
||||
|
||||
#include "Handle.h"
|
||||
#include "Instance.h"
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
|
||||
#include "UsbCameraListener.h"
|
||||
|
||||
#include <wpi/EventLoopRunner.h>
|
||||
#include <wpi/StringExtras.h>
|
||||
#include <wpi/uv/FsEvent.h>
|
||||
#include <wpi/uv/Timer.h>
|
||||
#include <wpinet/EventLoopRunner.h>
|
||||
#include <wpinet/uv/FsEvent.h>
|
||||
#include <wpinet/uv/Timer.h>
|
||||
|
||||
#include "Notifier.h"
|
||||
|
||||
|
||||
@@ -151,6 +151,7 @@ if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxra
|
||||
}
|
||||
lib library: nativeName, linkage: 'static'
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
|
||||
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
|
||||
@@ -189,6 +190,7 @@ if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxra
|
||||
lib library: 'glassnt', linkage: 'static'
|
||||
lib library: nativeName, linkage: 'static'
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'static'
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'static'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
|
||||
lib project: ':wpimath', library: 'wpimath', linkage: 'static'
|
||||
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
|
||||
|
||||
@@ -44,6 +44,7 @@ dependencies {
|
||||
implementation project(':wpimath')
|
||||
implementation project(':hal')
|
||||
implementation project(':wpiutil')
|
||||
implementation project(':wpinet')
|
||||
implementation project(':ntcore')
|
||||
implementation project(':cscore')
|
||||
implementation project(':cameraserver')
|
||||
@@ -169,9 +170,11 @@ model {
|
||||
lib project: ':ntcore', library: 'ntcoreJNIShared', linkage: 'shared'
|
||||
lib project: ':cscore', library: 'cscoreJNIShared', linkage: 'shared'
|
||||
lib project: ':wpimath', library: 'wpimathJNIShared', linkage: 'shared'
|
||||
lib project: ':wpinet', library: 'wpinetJNIShared', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutilJNIShared', linkage: 'shared'
|
||||
project(':hal').addHalDependency(binary, 'shared')
|
||||
project(':hal').addHalJniDependency(binary)
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
nativeUtils.useRequiredLibrary(binary, 'ni_link_libraries', 'ni_runtime_libraries')
|
||||
@@ -213,6 +216,7 @@ model {
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'static'
|
||||
lib project: ':cscore', library: 'cscore', linkage: 'static'
|
||||
project(':hal').addHalDependency(binary, 'static')
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'static'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
|
||||
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
nativeUtils.useRequiredLibrary(binary, 'ni_link_libraries', 'ni_runtime_libraries')
|
||||
|
||||
@@ -30,4 +30,5 @@ includeOtherLibs {
|
||||
^fmt/
|
||||
^support/
|
||||
^wpi/
|
||||
^wpinet/
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ target_include_directories(ntcore PUBLIC
|
||||
$<INSTALL_INTERFACE:${include_dest}/ntcore>)
|
||||
wpilib_target_warnings(ntcore)
|
||||
target_compile_features(ntcore PUBLIC cxx_std_17)
|
||||
target_link_libraries(ntcore PUBLIC wpiutil)
|
||||
target_link_libraries(ntcore PUBLIC wpinet wpiutil)
|
||||
|
||||
set_property(TARGET ntcore PROPERTY FOLDER "libraries")
|
||||
|
||||
|
||||
@@ -5,6 +5,19 @@ ext {
|
||||
|
||||
apply from: "${rootDir}/shared/jni/setupBuild.gradle"
|
||||
|
||||
model {
|
||||
components {}
|
||||
binaries {
|
||||
all {
|
||||
if (!it.buildable || !(it instanceof NativeBinarySpec)) {
|
||||
return
|
||||
}
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Action<List<String>> symbolFilter = { symbols ->
|
||||
symbols.removeIf({ !it.startsWith('NT_') })
|
||||
} as Action<List<String>>;
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
|
||||
#include <wpi/SmallVector.h>
|
||||
#include <wpi/StringExtras.h>
|
||||
#include <wpi/TCPAcceptor.h>
|
||||
#include <wpi/TCPConnector.h>
|
||||
#include <wpi/json_serializer.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
#include <wpi/timestamp.h>
|
||||
#include <wpinet/TCPAcceptor.h>
|
||||
#include <wpinet/TCPConnector.h>
|
||||
|
||||
#include "IConnectionNotifier.h"
|
||||
#include "IStorage.h"
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
|
||||
#include <wpi/SmallString.h>
|
||||
#include <wpi/StringExtras.h>
|
||||
#include <wpi/TCPConnector.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
#include <wpi/raw_socket_istream.h>
|
||||
#include <wpinet/TCPConnector.h>
|
||||
#include <wpinet/raw_socket_istream.h>
|
||||
|
||||
#include "Dispatcher.h"
|
||||
#include "Log.h"
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <wpi/NetworkStream.h>
|
||||
#include <wpi/raw_socket_istream.h>
|
||||
#include <wpi/timestamp.h>
|
||||
#include <wpinet/NetworkStream.h>
|
||||
#include <wpinet/raw_socket_istream.h>
|
||||
|
||||
#include "IConnectionNotifier.h"
|
||||
#include "Log.h"
|
||||
|
||||
@@ -100,6 +100,7 @@ if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxra
|
||||
lib project: ':glass', library: 'glassnt', linkage: 'static'
|
||||
lib project: ':glass', library: 'glass', linkage: 'static'
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'static'
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'static'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
|
||||
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
|
||||
nativeUtils.useRequiredLibrary(it, 'imgui_static')
|
||||
|
||||
@@ -25,4 +25,5 @@ includeOtherLibs {
|
||||
^ntcore
|
||||
^wpi/
|
||||
^wpigui
|
||||
^wpinet/
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ endif()
|
||||
|
||||
add_executable(roborioteamnumbersetter ${rtns_src} ${rtns_resources_src} ${rtns_rc} ${APP_ICON_MACOSX})
|
||||
wpilib_link_macos_gui(roborioteamnumbersetter)
|
||||
target_link_libraries(roborioteamnumbersetter libglass ${LIBSSH_LIBRARIES})
|
||||
target_link_libraries(roborioteamnumbersetter libglass wpinet ${LIBSSH_LIBRARIES})
|
||||
target_include_directories(roborioteamnumbersetter PRIVATE ${LIBSSH_INCLUDE_DIRS})
|
||||
|
||||
if (WIN32)
|
||||
|
||||
@@ -113,6 +113,7 @@ if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxra
|
||||
}
|
||||
it.cppCompiler.define("LIBSSH_STATIC")
|
||||
lib project: ':glass', library: 'glass', linkage: 'static'
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'static'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
|
||||
lib project: ':wpigui', library: 'wpigui', linkage: 'static'
|
||||
nativeUtils.useRequiredLibrary(it, 'imgui_static', 'libssh')
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
#include <unordered_map>
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <arpa/inet.h>
|
||||
@@ -19,13 +20,11 @@
|
||||
#include <imgui.h>
|
||||
#include <libssh/libssh.h>
|
||||
#include <wpi/Logger.h>
|
||||
#include <wpi/SmallString.h>
|
||||
#include <wpi/fs.h>
|
||||
#include <wpinet/MulticastServiceResolver.h>
|
||||
#include <wpigui.h>
|
||||
#include <unordered_map>
|
||||
#include <mutex>
|
||||
#include "wpi/SmallString.h"
|
||||
#include "DeploySession.h"
|
||||
#include "wpi/MulticastServiceResolver.h"
|
||||
|
||||
namespace gui = wpi::gui;
|
||||
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
#include <fmt/core.h>
|
||||
#include <wpi/SmallString.h>
|
||||
#include <wpi/StringExtras.h>
|
||||
#include <wpi/uv/Error.h>
|
||||
#include <wpi/uv/GetAddrInfo.h>
|
||||
#include <wpi/uv/Work.h>
|
||||
#include <wpi/uv/util.h>
|
||||
#include <wpinet/uv/Error.h>
|
||||
#include <wpinet/uv/GetAddrInfo.h>
|
||||
#include <wpinet/uv/Work.h>
|
||||
#include <wpinet/uv/util.h>
|
||||
|
||||
#include "SshSession.h"
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ Properties props = System.getProperties();
|
||||
props.setProperty("org.gradle.internal.native.headers.unresolved.dependencies.ignore", "true");
|
||||
|
||||
include 'wpiutil'
|
||||
include 'wpinet'
|
||||
include 'ntcore'
|
||||
include 'hal'
|
||||
include 'cscore'
|
||||
|
||||
@@ -34,6 +34,9 @@ if (!project.hasProperty('onlylinuxathena')) {
|
||||
if (project.hasProperty('includeNtCore')) {
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
|
||||
}
|
||||
if (project.hasProperty('includeWpinet')) {
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
}
|
||||
if (project.hasProperty('includeWpiutil')) {
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
}
|
||||
@@ -60,6 +63,9 @@ if (!project.hasProperty('onlylinuxathena')) {
|
||||
if (project.hasProperty('includeNtCore')) {
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
|
||||
}
|
||||
if (project.hasProperty('includeWpinet')) {
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
}
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
|
||||
|
||||
@@ -7,7 +7,7 @@ file(GLOB halsim_ds_socket_src src/main/native/cpp/*.cpp)
|
||||
add_library(halsim_ds_socket SHARED ${halsim_ds_socket_src})
|
||||
wpilib_target_warnings(halsim_ds_socket)
|
||||
set_target_properties(halsim_ds_socket PROPERTIES DEBUG_POSTFIX "d")
|
||||
target_link_libraries(halsim_ds_socket PUBLIC hal)
|
||||
target_link_libraries(halsim_ds_socket PUBLIC hal wpinet)
|
||||
|
||||
target_include_directories(halsim_ds_socket PRIVATE src/main/native/include)
|
||||
|
||||
|
||||
@@ -44,8 +44,13 @@ model {
|
||||
}
|
||||
}
|
||||
binaries {
|
||||
all {
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
}
|
||||
withType(GoogleTestTestSuiteBinarySpec) {
|
||||
project(':hal').addHalDependency(it, 'shared')
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib library: pluginName, linkage: 'shared'
|
||||
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
|
||||
@@ -21,12 +21,12 @@
|
||||
#include <DSCommPacket.h>
|
||||
#include <fmt/format.h>
|
||||
#include <hal/Extensions.h>
|
||||
#include <wpi/EventLoopRunner.h>
|
||||
#include <wpi/raw_uv_ostream.h>
|
||||
#include <wpi/uv/Tcp.h>
|
||||
#include <wpi/uv/Timer.h>
|
||||
#include <wpi/uv/Udp.h>
|
||||
#include <wpi/uv/util.h>
|
||||
#include <wpinet/EventLoopRunner.h>
|
||||
#include <wpinet/raw_uv_ostream.h>
|
||||
#include <wpinet/uv/Tcp.h>
|
||||
#include <wpinet/uv/Timer.h>
|
||||
#include <wpinet/uv/Udp.h>
|
||||
#include <wpinet/uv/util.h>
|
||||
|
||||
#if defined(Win32) || defined(_WIN32)
|
||||
#pragma comment(lib, "Ws2_32.lib")
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
#include <DSCommJoystickPacket.h>
|
||||
#include <hal/simulation/DriverStationData.h>
|
||||
#include <wpi/raw_uv_ostream.h>
|
||||
#include <wpi/span.h>
|
||||
#include <wpinet/raw_uv_ostream.h>
|
||||
|
||||
class DSCommPacketTest;
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ if (!project.hasProperty('onlylinuxathena')) {
|
||||
return
|
||||
}
|
||||
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ":simulation:halsim_ws_core", library: "halsim_ws_core", linkage: "static"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/SmallString.h>
|
||||
#include <wpi/uv/util.h>
|
||||
#include <wpinet/uv/util.h>
|
||||
|
||||
#include "HALSimWSClientConnection.h"
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <WSProvider_SimDevice.h>
|
||||
#include <WSProvider_Solenoid.h>
|
||||
#include <WSProvider_dPWM.h>
|
||||
#include <wpi/EventLoopRunner.h>
|
||||
#include <wpinet/EventLoopRunner.h>
|
||||
|
||||
using namespace wpilibws;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <cstdio>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/raw_uv_ostream.h>
|
||||
#include <wpinet/raw_uv_ostream.h>
|
||||
|
||||
#include "HALSimWS.h"
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
|
||||
#include <WSProviderContainer.h>
|
||||
#include <WSProvider_SimDevice.h>
|
||||
#include <wpi/uv/Async.h>
|
||||
#include <wpi/uv/Loop.h>
|
||||
#include <wpi/uv/Tcp.h>
|
||||
#include <wpi/uv/Timer.h>
|
||||
#include <wpinet/uv/Async.h>
|
||||
#include <wpinet/uv/Loop.h>
|
||||
#include <wpinet/uv/Tcp.h>
|
||||
#include <wpinet/uv/Timer.h>
|
||||
|
||||
namespace wpi {
|
||||
class json;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <WSProviderContainer.h>
|
||||
#include <WSProvider_SimDevice.h>
|
||||
#include <wpi/EventLoopRunner.h>
|
||||
#include <wpinet/EventLoopRunner.h>
|
||||
|
||||
#include "HALSimWS.h"
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
#include <utility>
|
||||
|
||||
#include <HALSimBaseWebSocketConnection.h>
|
||||
#include <wpi/WebSocket.h>
|
||||
#include <wpi/mutex.h>
|
||||
#include <wpi/uv/Buffer.h>
|
||||
#include <wpi/uv/Stream.h>
|
||||
#include <wpinet/WebSocket.h>
|
||||
#include <wpinet/uv/Buffer.h>
|
||||
#include <wpinet/uv/Stream.h>
|
||||
|
||||
#include "HALSimWS.h"
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ file(GLOB halsim_ws_core_src src/main/native/cpp/*.cpp)
|
||||
add_library(halsim_ws_core STATIC ${halsim_ws_core_src})
|
||||
wpilib_target_warnings(halsim_ws_core)
|
||||
set_target_properties(halsim_ws_core PROPERTIES DEBUG_POSTFIX "d" POSITION_INDEPENDENT_CODE ON)
|
||||
target_link_libraries(halsim_ws_core PUBLIC hal)
|
||||
target_link_libraries(halsim_ws_core PUBLIC hal wpinet)
|
||||
|
||||
target_include_directories(halsim_ws_core PUBLIC src/main/native/include)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ if (!project.hasProperty('onlylinuxathena')) {
|
||||
|
||||
ext {
|
||||
includeWpiutil = true
|
||||
includeNtCore = true
|
||||
includeWpinet = true
|
||||
pluginName = 'halsim_ws_core'
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ if (!project.hasProperty('onlylinuxathena')) {
|
||||
}
|
||||
binaries.all {
|
||||
project(':hal').addHalDependency(it, 'shared')
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
}
|
||||
appendDebugPathToBinaries(binaries)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <hal/SimDevice.h>
|
||||
#include <hal/simulation/SimDeviceData.h>
|
||||
#include <wpi/StringMap.h>
|
||||
#include <wpi/uv/AsyncFunction.h>
|
||||
#include <wpinet/uv/AsyncFunction.h>
|
||||
|
||||
#include "WSBaseProvider.h"
|
||||
#include "WSProviderContainer.h"
|
||||
|
||||
@@ -51,6 +51,7 @@ model {
|
||||
return
|
||||
}
|
||||
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ":simulation:halsim_ws_core", library: "halsim_ws_core", linkage: "static"
|
||||
}
|
||||
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
#include <string_view>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/MimeTypes.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
#include <wpi/StringExtras.h>
|
||||
#include <wpi/UrlParser.h>
|
||||
#include <wpi/fs.h>
|
||||
#include <wpi/raw_istream.h>
|
||||
#include <wpi/raw_uv_ostream.h>
|
||||
#include <wpi/uv/Request.h>
|
||||
#include <wpinet/MimeTypes.h>
|
||||
#include <wpinet/UrlParser.h>
|
||||
#include <wpinet/raw_uv_ostream.h>
|
||||
#include <wpinet/uv/Request.h>
|
||||
|
||||
namespace uv = wpi::uv;
|
||||
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/SmallString.h>
|
||||
#include <wpi/UrlParser.h>
|
||||
#include <wpi/WebSocketServer.h>
|
||||
#include <wpi/fs.h>
|
||||
#include <wpi/raw_uv_ostream.h>
|
||||
#include <wpi/uv/Loop.h>
|
||||
#include <wpi/uv/Tcp.h>
|
||||
#include <wpinet/UrlParser.h>
|
||||
#include <wpinet/WebSocketServer.h>
|
||||
#include <wpinet/raw_uv_ostream.h>
|
||||
#include <wpinet/uv/Loop.h>
|
||||
#include <wpinet/uv/Tcp.h>
|
||||
|
||||
#include "HALSimHttpConnection.h"
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
#include <utility>
|
||||
|
||||
#include <HALSimBaseWebSocketConnection.h>
|
||||
#include <wpi/HttpWebSocketServerConnection.h>
|
||||
#include <wpi/mutex.h>
|
||||
#include <wpi/uv/AsyncFunction.h>
|
||||
#include <wpi/uv/Buffer.h>
|
||||
#include <wpinet/HttpWebSocketServerConnection.h>
|
||||
#include <wpinet/uv/AsyncFunction.h>
|
||||
#include <wpinet/uv/Buffer.h>
|
||||
|
||||
#include "HALSimWeb.h"
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <WSProviderContainer.h>
|
||||
#include <WSProvider_SimDevice.h>
|
||||
#include <wpi/EventLoopRunner.h>
|
||||
#include <wpinet/EventLoopRunner.h>
|
||||
|
||||
#include "HALSimWeb.h"
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
#include <WSBaseProvider.h>
|
||||
#include <WSProviderContainer.h>
|
||||
#include <WSProvider_SimDevice.h>
|
||||
#include <wpi/uv/Async.h>
|
||||
#include <wpi/uv/Loop.h>
|
||||
#include <wpi/uv/Tcp.h>
|
||||
#include <wpinet/uv/Async.h>
|
||||
#include <wpinet/uv/Loop.h>
|
||||
#include <wpinet/uv/Tcp.h>
|
||||
|
||||
namespace wpi {
|
||||
class json;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/SmallString.h>
|
||||
#include <wpi/raw_uv_ostream.h>
|
||||
#include <wpi/uv/util.h>
|
||||
#include <wpinet/raw_uv_ostream.h>
|
||||
#include <wpinet/uv/util.h>
|
||||
|
||||
static constexpr int kTcpConnectAttemptTimeout = 1000;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <hal/HALBase.h>
|
||||
#include <hal/Main.h>
|
||||
#include <hal/simulation/DIOData.h>
|
||||
#include <wpi/uv/Loop.h>
|
||||
#include <wpinet/uv/Loop.h>
|
||||
|
||||
#include "HALSimWSServer.h"
|
||||
#include "WebServerClientTest.h"
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <wpi/WebSocket.h>
|
||||
#include <wpi/json.h>
|
||||
#include <wpi/uv/AsyncFunction.h>
|
||||
#include <wpi/uv/Buffer.h>
|
||||
#include <wpi/uv/Loop.h>
|
||||
#include <wpi/uv/Stream.h>
|
||||
#include <wpi/uv/Tcp.h>
|
||||
#include <wpi/uv/Timer.h>
|
||||
#include <wpinet/WebSocket.h>
|
||||
#include <wpinet/uv/AsyncFunction.h>
|
||||
#include <wpinet/uv/Buffer.h>
|
||||
#include <wpinet/uv/Loop.h>
|
||||
#include <wpinet/uv/Stream.h>
|
||||
#include <wpinet/uv/Tcp.h>
|
||||
#include <wpinet/uv/Timer.h>
|
||||
|
||||
namespace wpilibws {
|
||||
|
||||
|
||||
@@ -15,12 +15,14 @@ apply from: "${rootDir}/shared/javacpp/setupBuild.gradle"
|
||||
|
||||
dependencies {
|
||||
implementation project(':wpiutil')
|
||||
implementation project(':wpinet')
|
||||
implementation project(':ntcore')
|
||||
implementation project(':cscore')
|
||||
implementation project(':hal')
|
||||
implementation project(':wpimath')
|
||||
implementation project(':wpilibj')
|
||||
devImplementation project(':wpiutil')
|
||||
devImplementation project(':wpinet')
|
||||
devImplementation project(':ntcore')
|
||||
devImplementation project(':cscore')
|
||||
devImplementation project(':hal')
|
||||
@@ -71,10 +73,12 @@ model {
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
|
||||
project(':hal').addHalDependency(it, 'shared')
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
|
||||
|
||||
if (it.component.name == "${nativeName}Dev") {
|
||||
lib project: ':ntcore', library: 'ntcoreJNIShared', linkage: 'shared'
|
||||
lib project: ':wpinet', library: 'wpinetJNIShared', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutilJNIShared', linkage: 'shared'
|
||||
project(':hal').addHalJniDependency(it)
|
||||
}
|
||||
|
||||
@@ -116,6 +116,7 @@ model {
|
||||
cppCompiler.define 'DYNAMIC_CAMERA_SERVER'
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
|
||||
project(':hal').addHalDependency(it, 'shared')
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
|
||||
}
|
||||
@@ -135,6 +136,7 @@ model {
|
||||
binaries.all {
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
|
||||
project(':hal').addHalDependency(it, 'shared')
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
|
||||
|
||||
@@ -172,6 +174,7 @@ model {
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
|
||||
lib project: ':cscore', library: 'cscore', linkage: 'shared'
|
||||
project(':hal').addHalDependency(it, 'shared')
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
|
||||
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
|
||||
@@ -222,6 +225,7 @@ model {
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
|
||||
lib project: ':cscore', library: 'cscore', linkage: 'shared'
|
||||
project(':hal').addHalDependency(it, 'shared')
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
|
||||
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
|
||||
|
||||
@@ -71,6 +71,7 @@ model {
|
||||
lib project: ':cscore', library: 'cscore', linkage: 'shared'
|
||||
project(':hal').addHalDependency(binary, 'shared')
|
||||
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
}
|
||||
sources {
|
||||
@@ -98,6 +99,7 @@ model {
|
||||
lib project: ':cscore', library: 'cscore', linkage: 'shared'
|
||||
project(':hal').addHalDependency(binary, 'shared')
|
||||
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
nativeUtils.useRequiredLibrary(binary, 'ni_link_libraries', 'ni_runtime_libraries')
|
||||
@@ -145,6 +147,7 @@ model {
|
||||
lib project: ':cscore', library: 'cscore', linkage: 'shared'
|
||||
project(':hal').addHalDependency(binary, 'shared')
|
||||
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
binary.tasks.withType(CppCompile) {
|
||||
if (!(binary.toolChain in VisualCpp)) {
|
||||
@@ -216,6 +219,7 @@ model {
|
||||
lib project: ':cscore', library: 'cscore', linkage: 'shared'
|
||||
project(':hal').addHalDependency(it, 'shared')
|
||||
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
|
||||
|
||||
@@ -53,6 +53,7 @@ model {
|
||||
project(':hal').addHalDependency(binary, 'shared')
|
||||
project(':hal').addHalJniDependency(binary)
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
|
||||
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
nativeUtils.useRequiredLibrary(binary, 'ni_link_libraries', 'ni_runtime_libraries')
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <hal/cpp/fpga_clock.h>
|
||||
#include <wpi/Logger.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
#include <wpi/UDPClient.h>
|
||||
#include <wpinet/UDPClient.h>
|
||||
|
||||
static void LoggerFunc(unsigned int level, const char* file, unsigned int line,
|
||||
const char* msg) {
|
||||
|
||||
@@ -62,6 +62,7 @@ repositories {
|
||||
dependencies {
|
||||
implementation project(':hal')
|
||||
implementation project(':wpiutil')
|
||||
implementation project(':wpinet')
|
||||
implementation project(':wpimath')
|
||||
implementation project(':ntcore')
|
||||
implementation project(':cscore')
|
||||
@@ -69,6 +70,7 @@ dependencies {
|
||||
testImplementation 'org.mockito:mockito-core:4.1.0'
|
||||
devImplementation project(':hal')
|
||||
devImplementation project(':wpiutil')
|
||||
devImplementation project(':wpinet')
|
||||
devImplementation project(':wpimath')
|
||||
devImplementation project(':ntcore')
|
||||
devImplementation project(':cscore')
|
||||
@@ -110,10 +112,12 @@ model {
|
||||
binaries.all {
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
|
||||
lib project: ':cscore', library: 'cscore', linkage: 'shared'
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
|
||||
lib project: ':ntcore', library: 'ntcoreJNIShared', linkage: 'shared'
|
||||
lib project: ':cscore', library: 'cscoreJNIShared', linkage: 'shared'
|
||||
lib project: ':wpinet', library: 'wpinetJNIShared', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutilJNIShared', linkage: 'shared'
|
||||
lib project: ':wpimath', library: 'wpimathJNIShared', linkage: 'shared'
|
||||
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
|
||||
|
||||
@@ -31,6 +31,7 @@ dependencies {
|
||||
implementation project(':wpimath')
|
||||
implementation project(':hal')
|
||||
implementation project(':wpiutil')
|
||||
implementation project(':wpinet')
|
||||
implementation project(':ntcore')
|
||||
implementation project(':cscore')
|
||||
implementation project(':cameraserver')
|
||||
@@ -118,6 +119,8 @@ model {
|
||||
project(':hal').addHalJniDependency(binary)
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutilJNI', linkage: 'shared'
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpinet', library: 'wpinetJNI', linkage: 'shared'
|
||||
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
|
||||
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
||||
nativeUtils.useRequiredLibrary(binary, 'ni_link_libraries', 'ni_runtime_libraries')
|
||||
|
||||
@@ -24,6 +24,7 @@ dependencies {
|
||||
implementation project(':wpimath')
|
||||
implementation project(':hal')
|
||||
implementation project(':wpiutil')
|
||||
implementation project(':wpinet')
|
||||
implementation project(':ntcore')
|
||||
implementation project(':cscore')
|
||||
implementation project(':cameraserver')
|
||||
|
||||
41
wpinet/.styleguide
Normal file
41
wpinet/.styleguide
Normal file
@@ -0,0 +1,41 @@
|
||||
cppHeaderFileInclude {
|
||||
\.h$
|
||||
\.inc$
|
||||
\.inl$
|
||||
}
|
||||
|
||||
cppSrcFileInclude {
|
||||
\.cpp$
|
||||
}
|
||||
|
||||
generatedFileExclude {
|
||||
src/main/native/cpp/http_parser\.cpp$
|
||||
src/main/native/include/wpinet/http_parser\.h$
|
||||
src/main/native/thirdparty/libuv/
|
||||
src/main/native/resources/
|
||||
src/main/native/linux/AvahiClient
|
||||
}
|
||||
|
||||
licenseUpdateExclude {
|
||||
src/main/native/cpp/TCPAcceptor\.cpp$
|
||||
src/main/native/cpp/TCPConnector\.cpp$
|
||||
src/main/native/cpp/TCPStream\.cpp$
|
||||
src/main/native/include/wpinet/TCPAcceptor\.h$
|
||||
src/main/native/include/wpinet/TCPConnector\.h$
|
||||
src/main/native/include/wpinet/TCPStream\.h$
|
||||
}
|
||||
|
||||
repoRootNameOverride {
|
||||
wpinet
|
||||
}
|
||||
|
||||
includeGuardRoots {
|
||||
wpinet/src/main/native/cpp/
|
||||
wpinet/src/main/native/include/wpinet/
|
||||
wpinet/src/test/native/cpp/
|
||||
}
|
||||
|
||||
includeOtherLibs {
|
||||
^fmt/
|
||||
^wpi/
|
||||
}
|
||||
218
wpinet/CMakeLists.txt
Normal file
218
wpinet/CMakeLists.txt
Normal file
@@ -0,0 +1,218 @@
|
||||
project(wpinet)
|
||||
|
||||
include(SubDirList)
|
||||
include(GenResources)
|
||||
include(CompileWarnings)
|
||||
include(AddTest)
|
||||
|
||||
file(GLOB wpinet_jni_src src/main/native/cpp/jni/WPINetJNI.cpp)
|
||||
|
||||
# Java bindings
|
||||
if (WITH_JAVA)
|
||||
find_package(Java REQUIRED)
|
||||
find_package(JNI REQUIRED)
|
||||
include(UseJava)
|
||||
set(CMAKE_JAVA_COMPILE_FLAGS "-encoding" "UTF8" "-Xlint:unchecked")
|
||||
|
||||
set(CMAKE_JNI_TARGET true)
|
||||
|
||||
file(GLOB_RECURSE JAVA_SOURCES src/main/java/*.java)
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.11.0")
|
||||
set(CMAKE_JAVA_COMPILE_FLAGS "-h" "${CMAKE_CURRENT_BINARY_DIR}/jniheaders")
|
||||
add_jar(wpinet_jar ${JAVA_SOURCES} INCLUDE_JARS wpiutil_jar OUTPUT_NAME wpinet)
|
||||
else()
|
||||
add_jar(wpinet_jar ${JAVA_SOURCES} INCLUDE_JARS wpiutil_jar OUTPUT_NAME wpinet GENERATE_NATIVE_HEADERS wpinet_jni_headers)
|
||||
endif()
|
||||
|
||||
get_property(WPINET_JAR_FILE TARGET wpinet_jar PROPERTY JAR_FILE)
|
||||
install(FILES ${WPINET_JAR_FILE} DESTINATION "${java_lib_dest}")
|
||||
|
||||
set_property(TARGET wpinet_jar PROPERTY FOLDER "java")
|
||||
|
||||
add_library(wpinetjni ${wpinet_jni_src})
|
||||
wpilib_target_warnings(wpinetjni)
|
||||
target_link_libraries(wpinetjni PUBLIC wpinet)
|
||||
|
||||
set_property(TARGET wpinetjni PROPERTY FOLDER "libraries")
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.11.0")
|
||||
target_include_directories(wpinetjni PRIVATE ${JNI_INCLUDE_DIRS})
|
||||
target_include_directories(wpinetjni PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/jniheaders")
|
||||
else()
|
||||
target_link_libraries(wpinetjni PRIVATE wpinet_jni_headers)
|
||||
endif()
|
||||
add_dependencies(wpinetjni wpinet_jar)
|
||||
|
||||
if (MSVC)
|
||||
install(TARGETS wpinetjni RUNTIME DESTINATION "${jni_lib_dest}" COMPONENT Runtime)
|
||||
endif()
|
||||
|
||||
install(TARGETS wpinetjni EXPORT wpinetjni DESTINATION "${main_lib_dest}")
|
||||
|
||||
endif()
|
||||
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
if (NOT MSVC AND NOT APPLE)
|
||||
find_library(ATOMIC NAMES atomic libatomic.so.1)
|
||||
if (ATOMIC)
|
||||
message(STATUS "Found libatomic: ${ATOMIC}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
GENERATE_RESOURCES(src/main/native/resources generated/main/cpp WPI wpi wpinet_resources_src)
|
||||
|
||||
file(GLOB_RECURSE wpinet_native_src src/main/native/cpp/*.cpp)
|
||||
list(REMOVE_ITEM wpinet_native_src ${wpinet_jni_src})
|
||||
file(GLOB_RECURSE wpinet_unix_src src/main/native/unix/*.cpp)
|
||||
file(GLOB_RECURSE wpinet_linux_src src/main/native/linux/*.cpp)
|
||||
file(GLOB_RECURSE wpinet_macos_src src/main/native/macOS/*.cpp)
|
||||
file(GLOB_RECURSE wpinet_windows_src src/main/native/windows/*.cpp)
|
||||
|
||||
file(GLOB uv_native_src src/main/native/thirdparty/libuv/src/*.cpp)
|
||||
|
||||
file(GLOB uv_windows_src src/main/native/thirdparty/libuv/src/win/*.cpp)
|
||||
|
||||
set(uv_unix_src
|
||||
src/main/native/thirdparty/libuv/src/unix/async.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/core.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/dl.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/fs.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/getaddrinfo.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/getnameinfo.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/loop-watcher.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/loop.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/pipe.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/poll.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/process.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/signal.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/stream.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/tcp.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/thread.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/tty.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/udp.cpp
|
||||
)
|
||||
|
||||
set(uv_darwin_src
|
||||
src/main/native/thirdparty/libuv/src/unix/bsd-ifaddrs.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/darwin.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/darwin-proctitle.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/fsevents.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/kqueue.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/proctitle.cpp
|
||||
)
|
||||
|
||||
set(uv_linux_src
|
||||
src/main/native/thirdparty/libuv/src/unix/linux-core.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/linux-inotify.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/linux-syscalls.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/procfs-exepath.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/proctitle.cpp
|
||||
src/main/native/thirdparty/libuv/src/unix/sysinfo-loadavg.cpp
|
||||
)
|
||||
|
||||
add_library(wpinet ${wpinet_native_src} ${wpinet_resources_src})
|
||||
set_target_properties(wpinet PROPERTIES DEBUG_POSTFIX "d")
|
||||
|
||||
set_property(TARGET wpinet PROPERTY FOLDER "libraries")
|
||||
|
||||
target_compile_features(wpinet PUBLIC cxx_std_17)
|
||||
wpilib_target_warnings(wpinet)
|
||||
target_link_libraries(wpinet PUBLIC wpiutil)
|
||||
|
||||
if (NOT USE_VCPKG_LIBUV)
|
||||
target_sources(wpinet PRIVATE ${uv_native_src})
|
||||
install(DIRECTORY src/main/native/thirdparty/libuv/include/ DESTINATION "${include_dest}/wpinet")
|
||||
target_include_directories(wpinet PRIVATE
|
||||
src/main/native/thirdparty/libuv/src)
|
||||
target_include_directories(wpinet PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/thirdparty/libuv/include>
|
||||
$<INSTALL_INTERFACE:${include_dest}/wpinet>)
|
||||
if(NOT MSVC)
|
||||
target_sources(wpinet PRIVATE ${uv_unix_src})
|
||||
if (APPLE)
|
||||
target_sources(wpinet PRIVATE ${uv_darwin_src})
|
||||
else()
|
||||
target_sources(wpinet PRIVATE ${uv_linux_src})
|
||||
endif()
|
||||
target_compile_definitions(wpinet PRIVATE -D_GNU_SOURCE)
|
||||
else()
|
||||
target_sources(wpinet PRIVATE ${uv_windows_src})
|
||||
if(BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(wpinet PRIVATE -DBUILDING_UV_SHARED)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
find_package(unofficial-libuv CONFIG REQUIRED)
|
||||
target_link_libraries(wpinet unofficial::libuv::libuv)
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
target_sources(wpinet PRIVATE ${wpinet_windows_src})
|
||||
else ()
|
||||
target_sources(wpinet PRIVATE ${wpinet_unix_src})
|
||||
if (APPLE)
|
||||
target_sources(wpinet PRIVATE ${wpinet_macos_src})
|
||||
else()
|
||||
target_sources(wpinet PRIVATE ${wpinet_linux_src})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_include_directories(wpinet PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/include>
|
||||
$<INSTALL_INTERFACE:${include_dest}/wpinet>)
|
||||
|
||||
install(TARGETS wpinet EXPORT wpinet DESTINATION "${main_lib_dest}")
|
||||
install(DIRECTORY src/main/native/include/ DESTINATION "${include_dest}/wpinet")
|
||||
|
||||
if (WITH_JAVA AND MSVC)
|
||||
install(TARGETS wpinet RUNTIME DESTINATION "${jni_lib_dest}" COMPONENT Runtime)
|
||||
endif()
|
||||
|
||||
if (WITH_FLAT_INSTALL)
|
||||
set (wpinet_config_dir ${wpilib_dest})
|
||||
else()
|
||||
set (wpinet_config_dir share/wpinet)
|
||||
endif()
|
||||
|
||||
configure_file(wpinet-config.cmake.in ${WPILIB_BINARY_DIR}/wpinet-config.cmake )
|
||||
install(FILES ${WPILIB_BINARY_DIR}/wpinet-config.cmake DESTINATION ${wpinet_config_dir})
|
||||
install(EXPORT wpinet DESTINATION ${wpinet_config_dir})
|
||||
|
||||
SUBDIR_LIST(wpinet_examples "${CMAKE_CURRENT_SOURCE_DIR}/examples")
|
||||
foreach(example ${wpinet_examples})
|
||||
file(GLOB wpinet_example_src examples/${example}/*.cpp)
|
||||
if(wpinet_example_src)
|
||||
add_executable(wpinet_${example} ${wpinet_example_src})
|
||||
wpilib_target_warnings(wpinet_${example})
|
||||
target_link_libraries(wpinet_${example} wpinet)
|
||||
set_property(TARGET wpinet_${example} PROPERTY FOLDER "examples")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
set (LIBUTIL -lutil)
|
||||
else()
|
||||
set (LIBUTIL)
|
||||
endif()
|
||||
|
||||
file(GLOB netconsoleServer_src src/netconsoleServer/native/cpp/*.cpp)
|
||||
add_executable(netconsoleServer ${netconsoleServer_src})
|
||||
wpilib_target_warnings(netconsoleServer)
|
||||
target_link_libraries(netconsoleServer wpinet ${LIBUTIL})
|
||||
|
||||
file(GLOB netconsoleTee_src src/netconsoleTee/native/cpp/*.cpp)
|
||||
add_executable(netconsoleTee ${netconsoleTee_src})
|
||||
wpilib_target_warnings(netconsoleTee)
|
||||
target_link_libraries(netconsoleTee wpinet)
|
||||
|
||||
set_property(TARGET netconsoleServer PROPERTY FOLDER "examples")
|
||||
set_property(TARGET netconsoleTee PROPERTY FOLDER "examples")
|
||||
|
||||
if (WITH_TESTS)
|
||||
wpilib_add_test(wpinet src/test/native/cpp)
|
||||
target_include_directories(wpinet_test PRIVATE src/test/native/include)
|
||||
target_link_libraries(wpinet_test wpinet ${LIBUTIL} gmock_main)
|
||||
endif()
|
||||
284
wpinet/build.gradle
Normal file
284
wpinet/build.gradle
Normal file
@@ -0,0 +1,284 @@
|
||||
apply from: "${rootDir}/shared/resources.gradle"
|
||||
|
||||
ext {
|
||||
skipJniCheck = true
|
||||
baseId = 'wpinet'
|
||||
groupId = 'edu.wpi.first.net'
|
||||
|
||||
nativeName = 'wpinet'
|
||||
devMain = 'edu.wpi.first.net.DevMain'
|
||||
def generateTask = createGenerateResourcesTask('main', 'WPI', 'wpi', project)
|
||||
|
||||
splitSetup = {
|
||||
it.tasks.withType(CppCompile) {
|
||||
dependsOn generateTask
|
||||
}
|
||||
it.sources {
|
||||
libuvCpp(CppSourceSet) {
|
||||
source {
|
||||
srcDirs 'src/main/native/thirdparty/libuv/src'
|
||||
include '*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/main/native/include', 'src/main/native/thirdparty/libuv/include', 'src/main/native/thirdparty/libuv/src'
|
||||
}
|
||||
}
|
||||
resourcesCpp(CppSourceSet) {
|
||||
source {
|
||||
srcDirs "$buildDir/generated/main/cpp", "$rootDir/shared/singlelib"
|
||||
include '*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/main/native/include'
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!it.targetPlatform.operatingSystem.isWindows()) {
|
||||
it.cppCompiler.define '_GNU_SOURCE'
|
||||
it.sources {
|
||||
libuvUnixCpp(CppSourceSet) {
|
||||
source {
|
||||
srcDirs 'src/main/native/thirdparty/libuv/src/unix'
|
||||
includes = [
|
||||
'async.cpp',
|
||||
'core.cpp',
|
||||
'dl.cpp',
|
||||
'fs.cpp',
|
||||
'getaddrinfo.cpp',
|
||||
'getnameinfo.cpp',
|
||||
'loop-watcher.cpp',
|
||||
'loop.cpp',
|
||||
'pipe.cpp',
|
||||
'poll.cpp',
|
||||
'process.cpp',
|
||||
'signal.cpp',
|
||||
'stream.cpp',
|
||||
'tcp.cpp',
|
||||
'thread.cpp',
|
||||
'timer.cpp',
|
||||
'tty.cpp',
|
||||
'udp.cpp',
|
||||
]
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/main/native/include', 'src/main/native/thirdparty/libuv/include', 'src/main/native/thirdparty/libuv/src'
|
||||
}
|
||||
}
|
||||
wpinetUnixCpp(CppSourceSet) {
|
||||
source {
|
||||
srcDirs 'src/main/native/unix'
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/main/native/include', 'src/main/native/cpp'
|
||||
include '**/*.h'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (it.targetPlatform.operatingSystem.isWindows()) {
|
||||
if (it in SharedLibraryBinarySpec) {
|
||||
it.cppCompiler.define 'BUILDING_UV_SHARED'
|
||||
}
|
||||
it.sources {
|
||||
libuvWindowsCpp(CppSourceSet) {
|
||||
source {
|
||||
srcDirs 'src/main/native/thirdparty/libuv/src/win'
|
||||
include '*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/main/native/include', 'src/main/native/thirdparty/libuv/include', 'src/main/native/thirdparty/libuv/src'
|
||||
}
|
||||
}
|
||||
wpinetWindowsCpp(CppSourceSet) {
|
||||
source {
|
||||
srcDirs 'src/main/native/windows'
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/main/native/include', 'src/main/native/cpp'
|
||||
include '**/*.h'
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (it.targetPlatform.operatingSystem.isMacOsX()) {
|
||||
it.sources {
|
||||
libuvMacCpp(CppSourceSet) {
|
||||
source {
|
||||
srcDirs 'src/main/native/thirdparty/libuv/src/unix'
|
||||
includes = [
|
||||
'bsd-ifaddrs.cpp',
|
||||
'darwin.cpp',
|
||||
'darwin-proctitle.cpp',
|
||||
'fsevents.cpp',
|
||||
'kqueue.cpp',
|
||||
'proctitle.cpp'
|
||||
]
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/main/native/include', 'src/main/native/thirdparty/libuv/include', 'src/main/native/thirdparty/libuv/src'
|
||||
}
|
||||
}
|
||||
wpinetmacOSCpp(CppSourceSet) {
|
||||
source {
|
||||
srcDirs 'src/main/native/macOS'
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/main/native/include', 'src/main/native/cpp'
|
||||
include '**/*.h'
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
it.sources {
|
||||
libuvLinuxCpp(CppSourceSet) {
|
||||
source {
|
||||
srcDirs 'src/main/native/thirdparty/libuv/src/unix'
|
||||
includes = [
|
||||
'linux-core.cpp',
|
||||
'linux-inotify.cpp',
|
||||
'linux-syscalls.cpp',
|
||||
'procfs-exepath.cpp',
|
||||
'proctitle.cpp',
|
||||
'sysinfo-loadavg.cpp',
|
||||
]
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/main/native/include', 'src/main/native/thirdparty/libuv/include', 'src/main/native/thirdparty/libuv/src'
|
||||
}
|
||||
}
|
||||
wpinetLinuxCpp(CppSourceSet) {
|
||||
source {
|
||||
srcDirs 'src/main/native/linux'
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/main/native/include', 'src/main/native/cpp', 'src/main/native/fmtlib/include'
|
||||
include '**/*.h'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def examplesMap = [:];
|
||||
file("$projectDir/examples").list(new FilenameFilter() {
|
||||
@Override
|
||||
public boolean accept(File current, String name) {
|
||||
return new File(current, name).isDirectory();
|
||||
}
|
||||
}).each {
|
||||
examplesMap.put(it, [])
|
||||
}
|
||||
|
||||
apply from: "${rootDir}/shared/jni/setupBuild.gradle"
|
||||
|
||||
nativeUtils.exportsConfigs {
|
||||
wpinet {
|
||||
x86ExcludeSymbols = [
|
||||
'_CT??_R0?AV_System_error',
|
||||
'_CT??_R0?AVexception',
|
||||
'_CT??_R0?AVfailure',
|
||||
'_CT??_R0?AVruntime_error',
|
||||
'_CT??_R0?AVsystem_error',
|
||||
'_CTA5?AVfailure',
|
||||
'_TI5?AVfailure',
|
||||
'_CT??_R0?AVout_of_range',
|
||||
'_CTA3?AVout_of_range',
|
||||
'_TI3?AVout_of_range',
|
||||
'_CT??_R0?AVbad_cast'
|
||||
]
|
||||
x64ExcludeSymbols = [
|
||||
'_CT??_R0?AV_System_error',
|
||||
'_CT??_R0?AVexception',
|
||||
'_CT??_R0?AVfailure',
|
||||
'_CT??_R0?AVruntime_error',
|
||||
'_CT??_R0?AVsystem_error',
|
||||
'_CTA5?AVfailure',
|
||||
'_TI5?AVfailure',
|
||||
'_CT??_R0?AVout_of_range',
|
||||
'_CTA3?AVout_of_range',
|
||||
'_TI3?AVout_of_range',
|
||||
'_CT??_R0?AVbad_cast'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
cppHeadersZip {
|
||||
from('src/main/native/thirdparty/libuv/include') {
|
||||
into '/'
|
||||
}
|
||||
}
|
||||
|
||||
model {
|
||||
components {
|
||||
all {
|
||||
it.sources.each {
|
||||
it.exportedHeaders {
|
||||
srcDirs 'src/main/native/include', 'src/main/native/thirdparty/libuv/include', 'src/main/native/thirdparty/libuv/src'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
model {
|
||||
components {
|
||||
examplesMap.each { key, value ->
|
||||
"${key}"(NativeExecutableSpec) {
|
||||
targetBuildTypes 'debug'
|
||||
binaries.all {
|
||||
lib library: 'wpinet', linkage: 'shared'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
||||
}
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDirs 'examples/' + "${key}"
|
||||
include '**/*.cpp'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
netconsoleServer(NativeExecutableSpec) {
|
||||
targetBuildTypes 'release'
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDirs = [
|
||||
'src/netconsoleServer/native/cpp'
|
||||
]
|
||||
includes = ['**/*.cpp']
|
||||
}
|
||||
}
|
||||
}
|
||||
binaries.all { binary ->
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'static'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
|
||||
if (binary.targetPlatform.operatingSystem.isLinux()) {
|
||||
linker.args "-lutil"
|
||||
}
|
||||
}
|
||||
}
|
||||
netconsoleTee(NativeExecutableSpec) {
|
||||
targetBuildTypes 'release'
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDirs = [
|
||||
'src/netconsoleTee/native/cpp'
|
||||
]
|
||||
includes = ['**/*.cpp']
|
||||
}
|
||||
}
|
||||
}
|
||||
binaries.all { binary ->
|
||||
lib project: ':wpinet', library: 'wpinet', linkage: 'static'
|
||||
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,11 +4,12 @@
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include "fmt/format.h"
|
||||
#include "wpi/DsClient.h"
|
||||
#include "wpi/EventLoopRunner.h"
|
||||
#include "wpi/Logger.h"
|
||||
#include "wpi/uv/Error.h"
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/Logger.h>
|
||||
|
||||
#include "wpinet/DsClient.h"
|
||||
#include "wpinet/EventLoopRunner.h"
|
||||
#include "wpinet/uv/Error.h"
|
||||
|
||||
namespace uv = wpi::uv;
|
||||
|
||||
@@ -4,11 +4,12 @@
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include "wpi/EventLoopRunner.h"
|
||||
#include "wpi/Logger.h"
|
||||
#include "wpi/ParallelTcpConnector.h"
|
||||
#include "wpi/uv/Error.h"
|
||||
#include "wpi/uv/Tcp.h"
|
||||
#include <wpi/Logger.h>
|
||||
|
||||
#include "wpinet/EventLoopRunner.h"
|
||||
#include "wpinet/ParallelTcpConnector.h"
|
||||
#include "wpinet/uv/Error.h"
|
||||
#include "wpinet/uv/Tcp.h"
|
||||
|
||||
namespace uv = wpi::uv;
|
||||
|
||||
@@ -4,12 +4,13 @@
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include "fmt/format.h"
|
||||
#include "wpi/EventLoopRunner.h"
|
||||
#include "wpi/HttpServerConnection.h"
|
||||
#include "wpi/UrlParser.h"
|
||||
#include "wpi/uv/Loop.h"
|
||||
#include "wpi/uv/Tcp.h"
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include "wpinet/EventLoopRunner.h"
|
||||
#include "wpinet/HttpServerConnection.h"
|
||||
#include "wpinet/UrlParser.h"
|
||||
#include "wpinet/uv/Loop.h"
|
||||
#include "wpinet/uv/Tcp.h"
|
||||
|
||||
namespace uv = wpi::uv;
|
||||
|
||||
17
wpinet/src/dev/java/edu/wpi/first/net/DevMain.java
Normal file
17
wpinet/src/dev/java/edu/wpi/first/net/DevMain.java
Normal file
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package edu.wpi.first.net;
|
||||
|
||||
import edu.wpi.first.util.RuntimeDetector;
|
||||
|
||||
public final class DevMain {
|
||||
/** Main entry point. */
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello World!");
|
||||
System.out.println(RuntimeDetector.getPlatformPath());
|
||||
}
|
||||
|
||||
private DevMain() {}
|
||||
}
|
||||
11
wpinet/src/dev/native/cpp/main.cpp
Normal file
11
wpinet/src/dev/native/cpp/main.cpp
Normal file
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include <fmt/core.h>
|
||||
#include <wpi/SmallString.h>
|
||||
|
||||
int main() {
|
||||
wpi::SmallString<128> v1("Hello");
|
||||
fmt::print("{}\n", v1.str());
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package edu.wpi.first.util;
|
||||
package edu.wpi.first.net;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -23,23 +23,23 @@ public class MulticastServiceAnnouncer implements AutoCloseable {
|
||||
String[] keys = txt.keySet().toArray(String[]::new);
|
||||
String[] values = txt.values().toArray(String[]::new);
|
||||
m_handle =
|
||||
WPIUtilJNI.createMulticastServiceAnnouncer(serviceName, serviceType, port, keys, values);
|
||||
WPINetJNI.createMulticastServiceAnnouncer(serviceName, serviceType, port, keys, values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
WPIUtilJNI.freeMulticastServiceAnnouncer(m_handle);
|
||||
WPINetJNI.freeMulticastServiceAnnouncer(m_handle);
|
||||
}
|
||||
|
||||
public void start() {
|
||||
WPIUtilJNI.startMulticastServiceAnnouncer(m_handle);
|
||||
WPINetJNI.startMulticastServiceAnnouncer(m_handle);
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
WPIUtilJNI.stopMulticastServiceAnnouncer(m_handle);
|
||||
WPINetJNI.stopMulticastServiceAnnouncer(m_handle);
|
||||
}
|
||||
|
||||
public boolean hasImplementation() {
|
||||
return WPIUtilJNI.getMulticastServiceAnnouncerHasImplementation(m_handle);
|
||||
return WPINetJNI.getMulticastServiceAnnouncerHasImplementation(m_handle);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package edu.wpi.first.util;
|
||||
package edu.wpi.first.net;
|
||||
|
||||
/** Class to resolve a service over mDNS. */
|
||||
public class MulticastServiceResolver implements AutoCloseable {
|
||||
@@ -14,31 +14,31 @@ public class MulticastServiceResolver implements AutoCloseable {
|
||||
* @param serviceType service type to look for
|
||||
*/
|
||||
public MulticastServiceResolver(String serviceType) {
|
||||
m_handle = WPIUtilJNI.createMulticastServiceResolver(serviceType);
|
||||
m_handle = WPINetJNI.createMulticastServiceResolver(serviceType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
WPIUtilJNI.freeMulticastServiceResolver(m_handle);
|
||||
WPINetJNI.freeMulticastServiceResolver(m_handle);
|
||||
}
|
||||
|
||||
public void start() {
|
||||
WPIUtilJNI.startMulticastServiceResolver(m_handle);
|
||||
WPINetJNI.startMulticastServiceResolver(m_handle);
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
WPIUtilJNI.stopMulticastServiceResolver(m_handle);
|
||||
WPINetJNI.stopMulticastServiceResolver(m_handle);
|
||||
}
|
||||
|
||||
public boolean hasImplementation() {
|
||||
return WPIUtilJNI.getMulticastServiceResolverHasImplementation(m_handle);
|
||||
return WPINetJNI.getMulticastServiceResolverHasImplementation(m_handle);
|
||||
}
|
||||
|
||||
public int getEventHandle() {
|
||||
return WPIUtilJNI.getMulticastServiceResolverEventHandle(m_handle);
|
||||
return WPINetJNI.getMulticastServiceResolverEventHandle(m_handle);
|
||||
}
|
||||
|
||||
public ServiceData[] getData() {
|
||||
return WPIUtilJNI.getMulticastServiceResolverData(m_handle);
|
||||
return WPINetJNI.getMulticastServiceResolverData(m_handle);
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,7 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package edu.wpi.first.util.net;
|
||||
|
||||
import edu.wpi.first.util.WPIUtilJNI;
|
||||
package edu.wpi.first.net;
|
||||
|
||||
/**
|
||||
* Forward ports to another host. This is primarily useful for accessing Ethernet-connected devices
|
||||
@@ -24,7 +22,7 @@ public final class PortForwarder {
|
||||
* @param remotePort remote port number
|
||||
*/
|
||||
public static void add(int port, String remoteHost, int remotePort) {
|
||||
WPIUtilJNI.addPortForwarder(port, remoteHost, remotePort);
|
||||
WPINetJNI.addPortForwarder(port, remoteHost, remotePort);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -33,6 +31,6 @@ public final class PortForwarder {
|
||||
* @param port local port number
|
||||
*/
|
||||
public static void remove(int port) {
|
||||
WPIUtilJNI.removePortForwarder(port);
|
||||
WPINetJNI.removePortForwarder(port);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package edu.wpi.first.util;
|
||||
package edu.wpi.first.net;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
85
wpinet/src/main/java/edu/wpi/first/net/WPINetJNI.java
Normal file
85
wpinet/src/main/java/edu/wpi/first/net/WPINetJNI.java
Normal file
@@ -0,0 +1,85 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package edu.wpi.first.net;
|
||||
|
||||
import edu.wpi.first.util.RuntimeLoader;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
public class WPINetJNI {
|
||||
static boolean libraryLoaded = false;
|
||||
static RuntimeLoader<WPINetJNI> loader = null;
|
||||
|
||||
public static class Helper {
|
||||
private static AtomicBoolean extractOnStaticLoad = new AtomicBoolean(true);
|
||||
|
||||
public static boolean getExtractOnStaticLoad() {
|
||||
return extractOnStaticLoad.get();
|
||||
}
|
||||
|
||||
public static void setExtractOnStaticLoad(boolean load) {
|
||||
extractOnStaticLoad.set(load);
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
if (Helper.getExtractOnStaticLoad()) {
|
||||
try {
|
||||
loader =
|
||||
new RuntimeLoader<>(
|
||||
"wpinetjni", RuntimeLoader.getDefaultExtractionRoot(), WPINetJNI.class);
|
||||
loader.loadLibrary();
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
libraryLoaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Force load the library.
|
||||
*
|
||||
* @throws IOException if the library failed to load
|
||||
*/
|
||||
public static synchronized void forceLoad() throws IOException {
|
||||
if (libraryLoaded) {
|
||||
return;
|
||||
}
|
||||
loader =
|
||||
new RuntimeLoader<>("wpinetjni", RuntimeLoader.getDefaultExtractionRoot(), WPINetJNI.class);
|
||||
loader.loadLibrary();
|
||||
libraryLoaded = true;
|
||||
}
|
||||
|
||||
public static native void addPortForwarder(int port, String remoteHost, int remotePort);
|
||||
|
||||
public static native void removePortForwarder(int port);
|
||||
|
||||
public static native int createMulticastServiceAnnouncer(
|
||||
String serviceName, String serviceType, int port, String[] keys, String[] values);
|
||||
|
||||
public static native void freeMulticastServiceAnnouncer(int handle);
|
||||
|
||||
public static native void startMulticastServiceAnnouncer(int handle);
|
||||
|
||||
public static native void stopMulticastServiceAnnouncer(int handle);
|
||||
|
||||
public static native boolean getMulticastServiceAnnouncerHasImplementation(int handle);
|
||||
|
||||
public static native int createMulticastServiceResolver(String serviceType);
|
||||
|
||||
public static native void freeMulticastServiceResolver(int handle);
|
||||
|
||||
public static native void startMulticastServiceResolver(int handle);
|
||||
|
||||
public static native void stopMulticastServiceResolver(int handle);
|
||||
|
||||
public static native boolean getMulticastServiceResolverHasImplementation(int handle);
|
||||
|
||||
public static native int getMulticastServiceResolverEventHandle(int handle);
|
||||
|
||||
public static native ServiceData[] getMulticastServiceResolverData(int handle);
|
||||
}
|
||||
@@ -2,15 +2,15 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/DsClient.h"
|
||||
#include "wpinet/DsClient.h"
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/Logger.h>
|
||||
#include <wpi/StringExtras.h>
|
||||
#include <wpi/json.h>
|
||||
#include <wpi/uv/Tcp.h>
|
||||
#include <wpi/uv/Timer.h>
|
||||
|
||||
#include "wpi/Logger.h"
|
||||
#include "wpinet/uv/Tcp.h"
|
||||
#include "wpinet/uv/Timer.h"
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/EventLoopRunner.h"
|
||||
#include "wpinet/EventLoopRunner.h"
|
||||
|
||||
#include "wpi/SmallVector.h"
|
||||
#include "wpi/condition_variable.h"
|
||||
#include "wpi/mutex.h"
|
||||
#include "wpi/uv/AsyncFunction.h"
|
||||
#include "wpi/uv/Loop.h"
|
||||
#include <wpi/SmallVector.h>
|
||||
#include <wpi/condition_variable.h>
|
||||
#include <wpi/mutex.h>
|
||||
|
||||
#include "wpinet/uv/AsyncFunction.h"
|
||||
#include "wpinet/uv/Loop.h"
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/HttpParser.h"
|
||||
#include "wpinet/HttpParser.h"
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
@@ -2,15 +2,16 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/HttpServerConnection.h"
|
||||
#include "wpinet/HttpServerConnection.h"
|
||||
|
||||
#include "fmt/format.h"
|
||||
#include "wpi/SmallString.h"
|
||||
#include "wpi/SmallVector.h"
|
||||
#include "wpi/SpanExtras.h"
|
||||
#include "wpi/StringExtras.h"
|
||||
#include "wpi/fmt/raw_ostream.h"
|
||||
#include "wpi/raw_uv_ostream.h"
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/SmallString.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
#include <wpi/SpanExtras.h>
|
||||
#include <wpi/StringExtras.h>
|
||||
#include <wpi/fmt/raw_ostream.h>
|
||||
|
||||
#include "wpinet/raw_uv_ostream.h"
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
@@ -2,15 +2,16 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/HttpUtil.h"
|
||||
#include "wpinet/HttpUtil.h"
|
||||
|
||||
#include <cctype>
|
||||
|
||||
#include "fmt/format.h"
|
||||
#include "wpi/Base64.h"
|
||||
#include "wpi/StringExtras.h"
|
||||
#include "wpi/TCPConnector.h"
|
||||
#include "wpi/raw_ostream.h"
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/Base64.h>
|
||||
#include <wpi/StringExtras.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
|
||||
#include "wpinet/TCPConnector.h"
|
||||
|
||||
namespace wpi {
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/MimeTypes.h"
|
||||
#include "wpinet/MimeTypes.h"
|
||||
|
||||
#include "wpi/StringExtras.h"
|
||||
#include "wpi/StringMap.h"
|
||||
#include <wpi/StringExtras.h>
|
||||
#include <wpi/StringMap.h>
|
||||
|
||||
namespace wpi {
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "wpi/DenseMap.h"
|
||||
#include "wpi/MulticastServiceAnnouncer.h"
|
||||
#include "wpi/MulticastServiceResolver.h"
|
||||
#include "wpi/UidVector.h"
|
||||
#include <wpi/DenseMap.h>
|
||||
#include <wpi/UidVector.h>
|
||||
|
||||
#include "wpinet/MulticastServiceAnnouncer.h"
|
||||
#include "wpinet/MulticastServiceResolver.h"
|
||||
|
||||
namespace wpi {
|
||||
struct MulticastHandleManager {
|
||||
@@ -2,7 +2,7 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/MulticastServiceAnnouncer.h"
|
||||
#include "wpinet/MulticastServiceAnnouncer.h"
|
||||
|
||||
#include <wpi/SmallVector.h>
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/MulticastServiceResolver.h"
|
||||
#include "wpinet/MulticastServiceResolver.h"
|
||||
|
||||
#include <wpi/MemAlloc.h>
|
||||
|
||||
#include "MulticastHandleManager.h"
|
||||
#include "wpi/MemAlloc.h"
|
||||
|
||||
extern "C" {
|
||||
WPI_MulticastServiceResolverHandle WPI_CreateMulticastServiceResolver(
|
||||
@@ -2,16 +2,16 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/ParallelTcpConnector.h"
|
||||
#include "wpinet/ParallelTcpConnector.h"
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/Logger.h>
|
||||
|
||||
#include "wpi/Logger.h"
|
||||
#include "wpi/uv/GetAddrInfo.h"
|
||||
#include "wpi/uv/Loop.h"
|
||||
#include "wpi/uv/Tcp.h"
|
||||
#include "wpi/uv/Timer.h"
|
||||
#include "wpi/uv/util.h"
|
||||
#include "wpinet/uv/GetAddrInfo.h"
|
||||
#include "wpinet/uv/Loop.h"
|
||||
#include "wpinet/uv/Tcp.h"
|
||||
#include "wpinet/uv/Timer.h"
|
||||
#include "wpinet/uv/util.h"
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/PortForwarder.h"
|
||||
#include "wpinet/PortForwarder.h"
|
||||
|
||||
#include "fmt/format.h"
|
||||
#include "wpi/DenseMap.h"
|
||||
#include "wpi/EventLoopRunner.h"
|
||||
#include "wpi/uv/GetAddrInfo.h"
|
||||
#include "wpi/uv/Tcp.h"
|
||||
#include "wpi/uv/Timer.h"
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/DenseMap.h>
|
||||
|
||||
#include "wpinet/EventLoopRunner.h"
|
||||
#include "wpinet/uv/GetAddrInfo.h"
|
||||
#include "wpinet/uv/Tcp.h"
|
||||
#include "wpinet/uv/Timer.h"
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/SocketError.h"
|
||||
#include "wpinet/SocketError.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
@@ -21,7 +21,7 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include "wpi/TCPAcceptor.h"
|
||||
#include "wpinet/TCPAcceptor.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
@@ -38,9 +38,10 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "wpi/Logger.h"
|
||||
#include "wpi/SmallString.h"
|
||||
#include "wpi/SocketError.h"
|
||||
#include <wpi/Logger.h>
|
||||
#include <wpi/SmallString.h>
|
||||
|
||||
#include "wpinet/SocketError.h"
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
limitations under the License
|
||||
*/
|
||||
|
||||
#include "wpi/TCPConnector.h"
|
||||
#include "wpinet/TCPConnector.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
|
||||
@@ -40,10 +40,11 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "wpi/Logger.h"
|
||||
#include "wpi/SmallString.h"
|
||||
#include "wpi/SocketError.h"
|
||||
#include "wpi/TCPStream.h"
|
||||
#include <wpi/Logger.h>
|
||||
#include <wpi/SmallString.h>
|
||||
|
||||
#include "wpinet/SocketError.h"
|
||||
#include "wpinet/TCPStream.h"
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/TCPConnector.h" // NOLINT(build/include_order)
|
||||
#include "wpinet/TCPConnector.h" // NOLINT(build/include_order)
|
||||
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
#include <tuple>
|
||||
|
||||
#include "wpi/SmallSet.h"
|
||||
#include "wpi/condition_variable.h"
|
||||
#include "wpi/mutex.h"
|
||||
#include <wpi/SmallSet.h>
|
||||
#include <wpi/condition_variable.h>
|
||||
#include <wpi/mutex.h>
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include "wpi/TCPStream.h"
|
||||
#include "wpinet/TCPStream.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/UDPClient.h"
|
||||
#include "wpinet/UDPClient.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <WinSock2.h>
|
||||
@@ -15,9 +15,10 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "wpi/Logger.h"
|
||||
#include "wpi/SmallString.h"
|
||||
#include "wpi/SocketError.h"
|
||||
#include <wpi/Logger.h>
|
||||
#include <wpi/SmallString.h>
|
||||
|
||||
#include "wpinet/SocketError.h"
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
@@ -2,19 +2,20 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/WebSocket.h"
|
||||
#include "wpinet/WebSocket.h"
|
||||
|
||||
#include <random>
|
||||
|
||||
#include "fmt/format.h"
|
||||
#include "wpi/Base64.h"
|
||||
#include "wpi/HttpParser.h"
|
||||
#include "wpi/SmallString.h"
|
||||
#include "wpi/SmallVector.h"
|
||||
#include "wpi/StringExtras.h"
|
||||
#include "wpi/raw_uv_ostream.h"
|
||||
#include "wpi/sha1.h"
|
||||
#include "wpi/uv/Stream.h"
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/Base64.h>
|
||||
#include <wpi/SmallString.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
#include <wpi/StringExtras.h>
|
||||
#include <wpi/sha1.h>
|
||||
|
||||
#include "wpinet/HttpParser.h"
|
||||
#include "wpinet/raw_uv_ostream.h"
|
||||
#include "wpinet/uv/Stream.h"
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
@@ -2,15 +2,16 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/WebSocketServer.h"
|
||||
#include "wpinet/WebSocketServer.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "wpi/StringExtras.h"
|
||||
#include "wpi/fmt/raw_ostream.h"
|
||||
#include "wpi/raw_uv_ostream.h"
|
||||
#include "wpi/uv/Buffer.h"
|
||||
#include "wpi/uv/Stream.h"
|
||||
#include <wpi/StringExtras.h>
|
||||
#include <wpi/fmt/raw_ostream.h>
|
||||
|
||||
#include "wpinet/raw_uv_ostream.h"
|
||||
#include "wpinet/uv/Buffer.h"
|
||||
#include "wpinet/uv/Stream.h"
|
||||
|
||||
using namespace wpi;
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "wpi/hostname.h"
|
||||
#include "wpinet/hostname.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
#include <wpi/SmallVector.h>
|
||||
|
||||
#include "uv.h"
|
||||
#include "wpi/SmallVector.h"
|
||||
|
||||
namespace wpi {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
#include "wpi/http_parser.h"
|
||||
#include "wpinet/http_parser.h"
|
||||
#include <assert.h>
|
||||
#include <stddef.h>
|
||||
#include <ctype.h>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user