forked from wpilibsuite/allwpilib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into more-serialization
- Loading branch information
Showing
113 changed files
with
1,206 additions
and
656 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
macro(add_source_jar target) | ||
set(oneValueArgs OUTPUT_NAME OUTPUT_DIR) | ||
cmake_parse_arguments(SOURCE_JAR "" "${oneValueArgs}" "BASE_DIRECTORIES" ${ARGN}) | ||
foreach(base_package_dir ${SOURCE_JAR_BASE_DIRECTORIES}) | ||
file(GLOB_RECURSE directories LIST_DIRECTORIES true ${base_package_dir}/*.directoriesonly) | ||
# Find all packages | ||
foreach(directory ${directories}) | ||
cmake_path( | ||
RELATIVE_PATH | ||
directory | ||
BASE_DIRECTORY ${base_package_dir} | ||
OUTPUT_VARIABLE package_name | ||
) | ||
file(GLOB package_sources ${directory}/*.java) | ||
if(package_sources STREQUAL "") | ||
continue() | ||
endif() | ||
# If package sources are scattered across different places, consolidate them under one package | ||
list(FIND packages ${package_name} index) | ||
if(index EQUAL -1) | ||
list(APPEND packages ${package_name}) | ||
endif() | ||
list(APPEND ${package_name} ${package_sources}) | ||
endforeach() | ||
endforeach() | ||
set(resources "") | ||
foreach(package ${packages}) | ||
string(APPEND resources "NAMESPACE \"${package}\" ${${package}} ") | ||
endforeach() | ||
cmake_language( | ||
EVAL CODE | ||
"add_jar(${target} RESOURCES ${resources} OUTPUT_NAME ${SOURCE_JAR_OUTPUT_NAME} OUTPUT_DIR ${SOURCE_JAR_OUTPUT_DIR})" | ||
) | ||
endmacro() |
Oops, something went wrong.