From 4beb6cb822a4b074fa5250128ba87c31d613ca05 Mon Sep 17 00:00:00 2001 From: kangping Date: Thu, 22 Oct 2020 23:23:26 +0800 Subject: [PATCH] [swig] revert changes to the minimum SWIG version (#153) This commit reverts changes of downgrading minimum SWIG version to 3.0. We downgraded the minimum version for easy installation of SWIG on old Linux distributions. But the incoming Commissioner Android App relies on the Java methods generated by SWIG 4.0. Unfortunately, we didn't have a GH job to test the SWIG-generated Java code for now, but it will come with the Android App. --- .github/workflows/build.yml | 5 +---- include/commissioner/defines.hpp | 2 +- include/commissioner/network_data.hpp | 2 +- script/bootstrap.sh | 2 +- src/java/CMakeLists.txt | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c6fb557e9..6bd3183c8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -163,10 +163,7 @@ jobs: ninja java-binding: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-10.15, ubuntu-18.04] + runs-on: macos-10.15 steps: - uses: actions/checkout@v2 - name: Bootstrap diff --git a/include/commissioner/defines.hpp b/include/commissioner/defines.hpp index 2c90e0064..ef6042785 100644 --- a/include/commissioner/defines.hpp +++ b/include/commissioner/defines.hpp @@ -161,7 +161,7 @@ static constexpr uint8_t kRadioChannelPage2 = 2; /** * Type alias of raw byte array. */ -typedef std::vector ByteArray; +using ByteArray = std::vector; } // namespace commissioner diff --git a/include/commissioner/network_data.hpp b/include/commissioner/network_data.hpp index ffd8c7919..c7d3efc7b 100644 --- a/include/commissioner/network_data.hpp +++ b/include/commissioner/network_data.hpp @@ -185,7 +185,7 @@ struct ChannelMaskEntry ByteArray mMasks; }; -typedef std::vector ChannelMask; +using ChannelMask = std::vector; /** * A SecurityPolicy includes RotationTime and SecurityFlags. diff --git a/script/bootstrap.sh b/script/bootstrap.sh index d5e2eaa5f..eae5f136f 100755 --- a/script/bootstrap.sh +++ b/script/bootstrap.sh @@ -94,7 +94,7 @@ elif [ "$(uname)" = "Darwin" ]; then llvm@10 \ cmake \ ninja \ - swig \ + swig@4 \ lcov && true sudo ln -s "$(brew --prefix llvm@10)/bin/clang-format" /usr/local/bin/clang-format-10 diff --git a/src/java/CMakeLists.txt b/src/java/CMakeLists.txt index fb8b9b482..57c9edf39 100644 --- a/src/java/CMakeLists.txt +++ b/src/java/CMakeLists.txt @@ -29,7 +29,7 @@ set(JAVA_PACKAGE_NAME io.openthread.commissioner) set(JAVA_OUTFILE_DIR ${CMAKE_CURRENT_BINARY_DIR}/io/openthread/commissioner) -find_package(SWIG 3.0 REQUIRED) +find_package(SWIG 4.0 REQUIRED) find_package(Java REQUIRED) if (NOT OT_COMM_ANDROID)