From 7df9c580ef15476b14b397075f4a9cc147248d98 Mon Sep 17 00:00:00 2001 From: Ivan Santiago Paunovic Date: Wed, 12 May 2021 17:49:46 -0300 Subject: [PATCH 1/6] Remove target 1.6, ignore warnings about deprecated options Signed-off-by: Ivan Santiago Paunovic --- rcljava/CMakeLists.txt | 2 +- rcljava_common/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rcljava/CMakeLists.txt b/rcljava/CMakeLists.txt index 85cba623..ffe73c2a 100644 --- a/rcljava/CMakeLists.txt +++ b/rcljava/CMakeLists.txt @@ -38,7 +38,7 @@ if(NOT WIN32) add_compile_options(-Wall -Wextra -Wpedantic) endif() -set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.6" "-target" "1.6") +set(CMAKE_JAVA_COMPILE_FLAGS "-source" "6" "-Xlint:-options") include_directories(include) diff --git a/rcljava_common/CMakeLists.txt b/rcljava_common/CMakeLists.txt index 228f24ea..7cacbbec 100644 --- a/rcljava_common/CMakeLists.txt +++ b/rcljava_common/CMakeLists.txt @@ -31,7 +31,7 @@ if(NOT WIN32) add_compile_options(-Wall -Wextra -Wpedantic) endif() -set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.6" "-target" "1.6") +set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.6" "-Xlint:-options") set(${PROJECT_NAME}_java_sources "src/main/java/org/ros2/rcljava/common/JNIUtils.java" From 561df9841b5914d8f995e2cdc55e1405eab45a44 Mon Sep 17 00:00:00 2001 From: Ivan Santiago Paunovic Date: Wed, 12 May 2021 17:51:29 -0300 Subject: [PATCH 2/6] Only add flags if they weren't specified internally Signed-off-by: Ivan Santiago Paunovic --- rcljava/CMakeLists.txt | 4 +++- rcljava_common/CMakeLists.txt | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/rcljava/CMakeLists.txt b/rcljava/CMakeLists.txt index ffe73c2a..1dc0de29 100644 --- a/rcljava/CMakeLists.txt +++ b/rcljava/CMakeLists.txt @@ -38,7 +38,9 @@ if(NOT WIN32) add_compile_options(-Wall -Wextra -Wpedantic) endif() -set(CMAKE_JAVA_COMPILE_FLAGS "-source" "6" "-Xlint:-options") +if (NOT CMAKE_JAVA_COMPILE_FLAGS) + set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.6" "-Xlint:-options") +endif() include_directories(include) diff --git a/rcljava_common/CMakeLists.txt b/rcljava_common/CMakeLists.txt index 7cacbbec..7fe685a5 100644 --- a/rcljava_common/CMakeLists.txt +++ b/rcljava_common/CMakeLists.txt @@ -31,7 +31,9 @@ if(NOT WIN32) add_compile_options(-Wall -Wextra -Wpedantic) endif() -set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.6" "-Xlint:-options") +if (NOT CMAKE_JAVA_COMPILE_FLAGS) + set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.6" "-Xlint:-options") +endif() set(${PROJECT_NAME}_java_sources "src/main/java/org/ros2/rcljava/common/JNIUtils.java" From 02fb6646bf16df7ac74c5d6acdfe91cd987bee24 Mon Sep 17 00:00:00 2001 From: Ivan Santiago Paunovic Date: Thu, 13 May 2021 14:59:51 -0300 Subject: [PATCH 3/6] Don't pass java compile flags in CMake, instead do that in CI Signed-off-by: Ivan Santiago Paunovic --- .github/workflows/build_and_test.yml | 10 +++++++++- rcljava/CMakeLists.txt | 4 ---- rcljava_common/CMakeLists.txt | 4 ---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 919f47ad..0e2efa31 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -19,7 +19,15 @@ jobs: package-name: rosidl_generator_java rcljava_common rcljava target-ros2-distro: rolling vcs-repo-file-url: ${{ github.workspace }}/ros2_java_desktop.repos - + colcon-defaults: | + { + "build": { + "cmake-args": [ + "-DCMAKE_JAVA_COMPILE_FLAGS=--release;6;-Xlint:-options", + "--no-warn-unused-cli" + ] + } + } # build_android: # runs-on: ubuntu-18.04 # steps: diff --git a/rcljava/CMakeLists.txt b/rcljava/CMakeLists.txt index 1dc0de29..7c1115bc 100644 --- a/rcljava/CMakeLists.txt +++ b/rcljava/CMakeLists.txt @@ -38,10 +38,6 @@ if(NOT WIN32) add_compile_options(-Wall -Wextra -Wpedantic) endif() -if (NOT CMAKE_JAVA_COMPILE_FLAGS) - set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.6" "-Xlint:-options") -endif() - include_directories(include) function(set_properties _target_name _build_type) diff --git a/rcljava_common/CMakeLists.txt b/rcljava_common/CMakeLists.txt index 7fe685a5..a85f0df3 100644 --- a/rcljava_common/CMakeLists.txt +++ b/rcljava_common/CMakeLists.txt @@ -31,10 +31,6 @@ if(NOT WIN32) add_compile_options(-Wall -Wextra -Wpedantic) endif() -if (NOT CMAKE_JAVA_COMPILE_FLAGS) - set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.6" "-Xlint:-options") -endif() - set(${PROJECT_NAME}_java_sources "src/main/java/org/ros2/rcljava/common/JNIUtils.java" "src/main/java/org/ros2/rcljava/exceptions/RCLException.java" From 4afcb0ec406d89059edb4943c7bda036c36b629e Mon Sep 17 00:00:00 2001 From: Ivan Santiago Paunovic Date: Thu, 13 May 2021 15:30:45 -0300 Subject: [PATCH 4/6] Build both with java 6 and default java version Signed-off-by: Ivan Santiago Paunovic --- .github/workflows/build_and_test.yml | 36 ++++++++++++++++++---------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 0e2efa31..10dda2bd 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -4,7 +4,27 @@ on: [push] jobs: build_and_test: - runs-on: ubuntu-20.04 + strategy: + matrix: + rosdistro: [rolling] + os: [ubuntu-20.04] + java_version: [6, default] + include: + - java_version: 6 + colcon_defaults: | + { + "build": { + "cmake-args": [ + "-DCMAKE_JAVA_COMPILE_FLAGS=--release;6;-Xlint:-options", + "--no-warn-unused-cli" + ] + } + } + - java_version: default + colcon_defaults: | + { + } + runs-on: ${{matrix.os}} steps: - name: Install Java run: | @@ -13,21 +33,13 @@ jobs: - uses: actions/checkout@v2 - uses: ros-tooling/setup-ros@v0.2 with: - required-ros-distributions: rolling + required-ros-distributions: ${{matrix.rosdistro}} - uses: ros-tooling/action-ros-ci@master with: package-name: rosidl_generator_java rcljava_common rcljava - target-ros2-distro: rolling + target-ros2-distro: ${{matrix.rosdistro}} vcs-repo-file-url: ${{ github.workspace }}/ros2_java_desktop.repos - colcon-defaults: | - { - "build": { - "cmake-args": [ - "-DCMAKE_JAVA_COMPILE_FLAGS=--release;6;-Xlint:-options", - "--no-warn-unused-cli" - ] - } - } + colcon-defaults: ${{matrix.colcon_defaults}} # build_android: # runs-on: ubuntu-18.04 # steps: From 18e24fd4372fe1669306a540ceab7893fa6b00ed Mon Sep 17 00:00:00 2001 From: Ivan Santiago Paunovic Date: Thu, 13 May 2021 16:35:54 -0300 Subject: [PATCH 5/6] Fix CI Signed-off-by: Ivan Santiago Paunovic --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 10dda2bd..b3308f62 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -15,7 +15,7 @@ jobs: { "build": { "cmake-args": [ - "-DCMAKE_JAVA_COMPILE_FLAGS=--release;6;-Xlint:-options", + "-DCMAKE_JAVA_COMPILE_FLAGS=-source;1.6;-target;1.6;-Xlint:-options", "--no-warn-unused-cli" ] } From 2688e4e90ecf523cd614bc4bd575ed8dce8314ad Mon Sep 17 00:00:00 2001 From: Ivan Santiago Paunovic Date: Thu, 13 May 2021 17:07:11 -0300 Subject: [PATCH 6/6] fail-fast: false Signed-off-by: Ivan Santiago Paunovic --- .github/workflows/build_and_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index b3308f62..620b53ee 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -5,6 +5,7 @@ on: [push] jobs: build_and_test: strategy: + fail-fast: false matrix: rosdistro: [rolling] os: [ubuntu-20.04]