feat: add distinction between input and output net specfication

This commit is contained in:
Hugo Pointcheval 2023-11-24 17:45:21 +01:00
parent 4e2e5aa14a
commit 6c94686a14
Signed by: hugo
GPG Key ID: 3AAC487E131E00BC
3 changed files with 17 additions and 8 deletions

View File

@ -27,7 +27,8 @@ help() {
echo " --ndk Android NDK path (default: ANDROID_NDK_HOME environment variable)"
echo " --no-android Disable Android build (default: false)"
echo " --no-ios Disable iOS build (default: false)"
echo " --spec Net spec (default: net8.0)"
echo " --input-spec Input project .NET spec (default: net8.0)"
echo " --output-spec Output project .NET spec (default: net8.0)"
}
# Function to log a message to the console and log file
@ -51,7 +52,8 @@ command_exists() {
replace_project_names() {
sed -i '' "s/INPUT_PROJECT_NAME/$input_project_name/g" $1
sed -i '' "s/GENERATED_PROJECT_NAME/$generated_project_name/g" $1
sed -i '' "s/NET_SPEC/$input_project_net_spec/g" $1
sed -i '' "s/INPUT_NET_SPEC/$input_project_net_spec/g" $1
sed -i '' "s/OUTPUT_NET_SPEC/$output_project_net_spec/g" $1
}
# Function to ask for confirmation before continuing
@ -108,7 +110,7 @@ build_android() {
# Copy the generated library to the output directory
mkdir -p $output_dir/${abis[$arch]}
cp $generated_project_dir/bin/Release/$input_project_net_spec/linux-bionic-$arch/native/$generated_project_name.so $output_dir/${abis[$arch]}/lib$input_project_name.so
cp $generated_project_dir/bin/Release/$output_project_net_spec/linux-bionic-$arch/native/$generated_project_name.so $output_dir/${abis[$arch]}/lib$input_project_name.so
done
# Copy the generated headers to the output directory
@ -130,7 +132,7 @@ build_ios() {
# Copy $input_project_dir/bin/Release/net8.0/*.xcframework to output directory
log "Copying iOS libraries to output directory"
cp $input_project_dir/bin/Release/$input_project_net_spec/*.xcframework $output_dir
cp $input_project_dir/bin/Release/$output_project_net_spec/*.xcframework $output_dir
# Copy the generated headers to the output directory
log "Copying header to output directory"
@ -171,17 +173,20 @@ while [ "$1" != "" ]; do
output=$1
;;
-y)
shift
assume_yes=true
;;
--ndk)
shift
export ANDROID_NDK_HOME=$1
;;
--spec)
--input-spec)
shift
input_project_net_spec=$1
;;
--output-spec)
shift
output_project_net_spec=$1
;;
--no-android)
WANT_TO_BUILD_ANDROID=false
;;
@ -213,6 +218,10 @@ if [ -z "$input_project_net_spec" ]; then
input_project_net_spec="net8.0"
fi
if [ -z "$output_project_net_spec" ]; then
output_project_net_spec="net8.0"
fi
if [ -z "$output" ]; then
output="libs"
fi

View File

@ -1,5 +1,5 @@
{
"AssemblyPath": "INPUT_PROJECT_NAME/bin/Release/NET_SPEC/INPUT_PROJECT_NAME.dll",
"AssemblyPath": "INPUT_PROJECT_NAME/bin/Release/INPUT_NET_SPEC/INPUT_PROJECT_NAME.dll",
"CSharpUnmanagedOutputPath": "GENERATED_PROJECT_NAME/Generated.cs",
"COutputPath": "GENERATED_PROJECT_NAME/Generated.h",
"ExcludedTypeNames": [

View File

@ -1,5 +1,5 @@
{
"AssemblyPath": "INPUT_PROJECT_NAME/bin/Release/NET_SPEC/INPUT_PROJECT_NAME.dll",
"AssemblyPath": "INPUT_PROJECT_NAME/bin/Release/INPUT_NET_SPEC/INPUT_PROJECT_NAME.dll",
"CSharpUnmanagedOutputPath": "GENERATED_PROJECT_NAME/Generated.cs",
"COutputPath": "GENERATED_PROJECT_NAME/Generated.h",
"AssemblySearchPaths": [