Skip to content

Commit 9198a96

Browse files
committed
Refactored init script for Java library with native JNI project template.
The cmake/cpp_DependencyUtil.cmake template file included the same content as the one for C. Removed as it is redundant. Refactored init code accordingly. Signed-off-by: kilo52 <phil.gaiser@raven-computing.com>
1 parent 000caf8 commit 9198a96

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

java/03_library_native_jni/init.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright (C) 2025 Raven Computing
2+
# Copyright (C) 2026 Raven Computing
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -55,9 +55,7 @@ function process_files_lvl_2() {
5555
if [[ "$var_java_lib_jni_native_lang" == "C" ]]; then
5656
c_or_cpp="c";
5757
remove_file "cmake/ConfigGtest.cmake";
58-
remove_file "cmake/cpp_DependencyUtil.cmake";
5958
remove_file "cmake/cpp_TestUtil.cmake";
60-
move_file "cmake/c_DependencyUtil.cmake" "cmake/DependencyUtil.cmake";
6159
move_file "cmake/c_TestUtil.cmake" "cmake/TestUtil.cmake";
6260
remove_file "src/main/cpp";
6361
remove_file "src/test/cpp";
@@ -76,9 +74,7 @@ function process_files_lvl_2() {
7674
else
7775
c_or_cpp="cpp";
7876
remove_file "cmake/ConfigUnity.cmake";
79-
remove_file "cmake/c_DependencyUtil.cmake";
8077
remove_file "cmake/c_TestUtil.cmake";
81-
move_file "cmake/cpp_DependencyUtil.cmake" "cmake/DependencyUtil.cmake";
8278
move_file "cmake/cpp_TestUtil.cmake" "cmake/TestUtil.cmake";
8379
remove_file "src/main/c";
8480
remove_file "src/test/c";
@@ -95,6 +91,9 @@ function process_files_lvl_2() {
9591
replace_var "CMAKE_TEST_SOURCE_FILE" "StringComparatorTest.cpp";
9692
fi
9793

94+
# Common for both C and C++
95+
move_file "cmake/c_DependencyUtil.cmake" "cmake/DependencyUtil.cmake";
96+
9897
# Set the namespace variables for the C++ part of the project
9998
# shellcheck disable=SC2154
10099
var_namespace_colon="${var_namespace//./::}";

java/03_library_native_jni/source/cmake/cpp_DependencyUtil.cmake

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)