feat: add distinction between input and output net specfication
This commit is contained in:
parent
4e2e5aa14a
commit
6c94686a14
21
build.sh
21
build.sh
@ -27,7 +27,8 @@ help() {
|
|||||||
echo " --ndk Android NDK path (default: ANDROID_NDK_HOME environment variable)"
|
echo " --ndk Android NDK path (default: ANDROID_NDK_HOME environment variable)"
|
||||||
echo " --no-android Disable Android build (default: false)"
|
echo " --no-android Disable Android build (default: false)"
|
||||||
echo " --no-ios Disable iOS 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
|
# Function to log a message to the console and log file
|
||||||
@ -51,7 +52,8 @@ command_exists() {
|
|||||||
replace_project_names() {
|
replace_project_names() {
|
||||||
sed -i '' "s/INPUT_PROJECT_NAME/$input_project_name/g" $1
|
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/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
|
# Function to ask for confirmation before continuing
|
||||||
@ -108,7 +110,7 @@ build_android() {
|
|||||||
|
|
||||||
# Copy the generated library to the output directory
|
# Copy the generated library to the output directory
|
||||||
mkdir -p $output_dir/${abis[$arch]}
|
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
|
done
|
||||||
|
|
||||||
# Copy the generated headers to the output directory
|
# 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
|
# Copy $input_project_dir/bin/Release/net8.0/*.xcframework to output directory
|
||||||
log "Copying iOS libraries 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
|
# Copy the generated headers to the output directory
|
||||||
log "Copying header to output directory"
|
log "Copying header to output directory"
|
||||||
@ -171,17 +173,20 @@ while [ "$1" != "" ]; do
|
|||||||
output=$1
|
output=$1
|
||||||
;;
|
;;
|
||||||
-y)
|
-y)
|
||||||
shift
|
|
||||||
assume_yes=true
|
assume_yes=true
|
||||||
;;
|
;;
|
||||||
--ndk)
|
--ndk)
|
||||||
shift
|
shift
|
||||||
export ANDROID_NDK_HOME=$1
|
export ANDROID_NDK_HOME=$1
|
||||||
;;
|
;;
|
||||||
--spec)
|
--input-spec)
|
||||||
shift
|
shift
|
||||||
input_project_net_spec=$1
|
input_project_net_spec=$1
|
||||||
;;
|
;;
|
||||||
|
--output-spec)
|
||||||
|
shift
|
||||||
|
output_project_net_spec=$1
|
||||||
|
;;
|
||||||
--no-android)
|
--no-android)
|
||||||
WANT_TO_BUILD_ANDROID=false
|
WANT_TO_BUILD_ANDROID=false
|
||||||
;;
|
;;
|
||||||
@ -213,6 +218,10 @@ if [ -z "$input_project_net_spec" ]; then
|
|||||||
input_project_net_spec="net8.0"
|
input_project_net_spec="net8.0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$output_project_net_spec" ]; then
|
||||||
|
output_project_net_spec="net8.0"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$output" ]; then
|
if [ -z "$output" ]; then
|
||||||
output="libs"
|
output="libs"
|
||||||
fi
|
fi
|
||||||
|
@ -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",
|
"CSharpUnmanagedOutputPath": "GENERATED_PROJECT_NAME/Generated.cs",
|
||||||
"COutputPath": "GENERATED_PROJECT_NAME/Generated.h",
|
"COutputPath": "GENERATED_PROJECT_NAME/Generated.h",
|
||||||
"ExcludedTypeNames": [
|
"ExcludedTypeNames": [
|
||||||
|
@ -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",
|
"CSharpUnmanagedOutputPath": "GENERATED_PROJECT_NAME/Generated.cs",
|
||||||
"COutputPath": "GENERATED_PROJECT_NAME/Generated.h",
|
"COutputPath": "GENERATED_PROJECT_NAME/Generated.h",
|
||||||
"AssemblySearchPaths": [
|
"AssemblySearchPaths": [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user