Skip to content

Commit

Permalink
Only generate a single os gir file for local dev
Browse files Browse the repository at this point in the history
  • Loading branch information
adamreeve committed May 30, 2024
1 parent 8acf0ab commit 3dc03c5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions csharp/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false

# Ignore 'call site is reachable on all platforms' when using code generated
# from a single platform gir file
dotnet_diagnostic.CA1416.severity = none

# Xml project files
[*.{csproj,props,targets}]
indent_size = 2
Expand Down
18 changes: 10 additions & 8 deletions csharp/generate_gobject_bindings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ for os_name in ${os_names[@]}; do
cp "${gircore_gir_dir}/${os_name}/${gir_dep}.gir" "${gir_dir}/${os_name}"
done

# TODO: Make this work cross platform and merge all platforms in CI build
for index in ${!arrow_gobject_libs[*]}; do
arrow_lib=${arrow_gobject_libs[$index]}
cp "${arrow_gir_dir}/${arrow_lib}.gir" "${gir_dir}/${os_name}"
namespace=${namespaces[$index]}
sed -i.bak "s/<namespace name=\"\([^\"]*\)\"/<namespace name=\"${namespace}\"/" "${gir_dir}/${os_name}/${arrow_lib}.gir"
rm -r "${gir_dir}/${os_name}/${arrow_lib}.gir.bak"
done
done

# TODO: Make this select the appropriate platform and merge all platforms in CI build
os_name="linux"
for index in ${!arrow_gobject_libs[*]}; do
arrow_lib=${arrow_gobject_libs[$index]}
cp "${arrow_gir_dir}/${arrow_lib}.gir" "${gir_dir}/${os_name}"
namespace=${namespaces[$index]}
sed -i.bak "s/<namespace name=\"\([^\"]*\)\"/<namespace name=\"${namespace}\"/" "${gir_dir}/${os_name}/${arrow_lib}.gir"
rm -r "${gir_dir}/${os_name}/${arrow_lib}.gir.bak"
done

dotnet run --project tools/gir.core/src/Generation/GirTool/GirTool.csproj -- \
Expand Down

0 comments on commit 3dc03c5

Please sign in to comment.