diff --git a/.gitignore b/.gitignore index 24bb2ad..d714f68 100644 --- a/.gitignore +++ b/.gitignore @@ -737,3 +737,5 @@ Temporary Items MyLib.Generated/Hello.cs MyLib.Generated/Hello.h beyondnetgen.*.config.json +libs/ +*.Generated/ diff --git a/build.sh b/build.sh index 2303a80..8d87a69 100755 --- a/build.sh +++ b/build.sh @@ -63,17 +63,25 @@ ask_confirmation() { fi } -# Function to build the Android libraries -build_android() { +# Generate project +generate_project() { cd $script_dir - # Copy template beyondnetgen.android.config.json + # Copy template beyondnetgen.*.config.json cp template.beyondnetgen.android.config.json beyondnetgen.android.config.json replace_project_names beyondnetgen.android.config.json + cp template.beyondnetgen.ios.config.json beyondnetgen.ios.config.json + replace_project_names beyondnetgen.ios.config.json + # Generate project - log "Generating Android project" + log "Generating project" run "beyondnetgen beyondnetgen.android.config.json" +} + +# Function to build the Android libraries +build_android() { + generate_project # Copy android_fake_clang.* to generated project cp android_fake_clang.* "$generated_project_dir/" @@ -130,6 +138,7 @@ build_ios() { # Set default values WANT_TO_BUILD_ANDROID=true WANT_TO_BUILD_IOS=true +ONLY_GENERATE=false # Check for arguments if [ $# -eq 0 ]; then @@ -269,8 +278,9 @@ fi # Check if BUILD_IOS or BUILD_ANDROID is true if [ "$BUILD_IOS" = false ] && [ "$BUILD_ANDROID" = false ]; then - log "Neither iOS nor Android build is enabled. Aborting." - exit 1 + log "Neither iOS nor Android build is enabled." + log "Only generating project." + ONLY_GENERATE=true fi ## CONFIG @@ -307,6 +317,11 @@ log "Building input project" cd $input_project_dir run "dotnet publish -v normal -c Release" +# Only generate project +if [ "$ONLY_GENERATE" = true ]; then + generate_project +fi + # Build Android libraries if [ "$BUILD_ANDROID" = true ]; then build_android diff --git a/template.beyondnetgen.android.config.json b/template.beyondnetgen.android.config.json index cf68a75..9e6be2b 100644 --- a/template.beyondnetgen.android.config.json +++ b/template.beyondnetgen.android.config.json @@ -144,7 +144,6 @@ "System.Action", "System.MulticastDelegate", "System.Delegate", - "System.Exception", "System.Reflection.MethodBase", "System.RuntimeMethodHandle", "System.RuntimeTypeHandle", @@ -251,7 +250,6 @@ "System.Security.SecureString", "System.Runtime.InteropServices.CustomQueryInterfaceMode", "System.NullReferenceException", - "System.SystemException", "System.PlatformNotSupportedException", "System.NotSupportedException", "System.UIntPtr",