Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

chore: support building universal macos package (#3110)

Lucas.Xu70914e622810
diff --git a/frontend/appflowy_flutter/macos/Runner.xcodeproj/project.pbxproj b/frontend/appflowy_flutter/macos/Runner.xcodeproj/project.pbxproj
index de6bf2b7c8..c003a68128 100644
--- a/frontend/appflowy_flutter/macos/Runner.xcodeproj/project.pbxproj
+++ b/frontend/appflowy_flutter/macos/Runner.xcodeproj/project.pbxproj
@@ -429,10 +429,12 @@
COMBINE_HIDPI_IMAGES = YES;
EXCLUDED_ARCHS = "";
INFOPLIST_FILE = Runner/Info.plist;
+ INFOPLIST_KEY_CFBundleDisplayName = AppFlowy;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
+ MACOSX_DEPLOYMENT_TARGET = 11.0;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.appflowy.appflowy.flutter;
PRODUCT_NAME = AppFlowy;
@@ -563,10 +565,12 @@
COMBINE_HIDPI_IMAGES = YES;
EXCLUDED_ARCHS = "";
INFOPLIST_FILE = Runner/Info.plist;
+ INFOPLIST_KEY_CFBundleDisplayName = AppFlowy;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
+ MACOSX_DEPLOYMENT_TARGET = 11.0;
PRODUCT_BUNDLE_IDENTIFIER = com.appflowy.appflowy.flutter;
PRODUCT_NAME = AppFlowy;
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -588,11 +592,13 @@
COMBINE_HIDPI_IMAGES = YES;
EXCLUDED_ARCHS = "";
INFOPLIST_FILE = Runner/Info.plist;
+ INFOPLIST_KEY_CFBundleDisplayName = AppFlowy;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
- ONLY_ACTIVE_ARCH = YES;
+ MACOSX_DEPLOYMENT_TARGET = 11.0;
+ ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.appflowy.appflowy.flutter;
PRODUCT_NAME = AppFlowy;
PROVISIONING_PROFILE_SPECIFIER = "";
diff --git a/frontend/appflowy_flutter/macos/Runner/DebugProfile.entitlements b/frontend/appflowy_flutter/macos/Runner/DebugProfile.entitlements
index ae544967cf..526b08b5bf 100644
--- a/frontend/appflowy_flutter/macos/Runner/DebugProfile.entitlements
+++ b/frontend/appflowy_flutter/macos/Runner/DebugProfile.entitlements
@@ -2,8 +2,18 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key>com.apple.security.app-sandbox</key>
+ <true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
+ <key>com.apple.security.files.downloads.read-write</key>
+ <true/>
+ <key>com.apple.security.files.user-selected.read-write</key>
+ <true/>
+ <key>com.apple.security.network.client</key>
+ <true/>
+ <key>com.apple.security.network.server</key>
+ <true/>
<key>com.apple.security.temporary-exception.files.absolute-path.read-write</key>
<array>
<string>/</string>
diff --git a/frontend/appflowy_flutter/macos/Runner/Info.plist b/frontend/appflowy_flutter/macos/Runner/Info.plist
index 43954508aa..a012e20b4d 100644
--- a/frontend/appflowy_flutter/macos/Runner/Info.plist
+++ b/frontend/appflowy_flutter/macos/Runner/Info.plist
@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key>LSApplicationCategoryType</key>
+ <string>public.app-category.productivity</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
diff --git a/frontend/appflowy_flutter/macos/Runner/Release.entitlements b/frontend/appflowy_flutter/macos/Runner/Release.entitlements
index f1e49b4f10..71949adefe 100644
--- a/frontend/appflowy_flutter/macos/Runner/Release.entitlements
+++ b/frontend/appflowy_flutter/macos/Runner/Release.entitlements
@@ -2,6 +2,16 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key>com.apple.security.app-sandbox</key>
+ <true/>
+ <key>com.apple.security.files.downloads.read-write</key>
+ <true/>
+ <key>com.apple.security.files.user-selected.read-write</key>
+ <true/>
+ <key>com.apple.security.network.client</key>
+ <true/>
+ <key>com.apple.security.network.server</key>
+ <true/>
<key>com.apple.security.temporary-exception.files.absolute-path.read-write</key>
<array>
<string>/</string>
diff --git a/frontend/scripts/code_generation/env/generate_env.sh b/frontend/scripts/code_generation/env/generate_env.sh
old mode 100644
new mode 100755
diff --git a/frontend/scripts/code_generation/generate.sh b/frontend/scripts/code_generation/generate.sh
index 8c800f2eaa..1fe2d41292 100755
--- a/frontend/scripts/code_generation/generate.sh
+++ b/frontend/scripts/code_generation/generate.sh
@@ -22,7 +22,7 @@ cd freezed
# Allow execution permissions on CI
chmod +x ./generate_freezed.sh
./generate_freezed.sh "$@"
-cd..
+cd ..
echo "Generating env files using build_runner"
cd env
diff --git a/frontend/scripts/flutter_release_build/build_universal_package_for_macos.sh b/frontend/scripts/flutter_release_build/build_universal_package_for_macos.sh
new file mode 100644
index 0000000000..fe073a1fe7
--- /dev/null
+++ b/frontend/scripts/flutter_release_build/build_universal_package_for_macos.sh
@@ -0,0 +1,27 @@
+# build the universal binary for AppFlowy on macOS
+
+echo 'πŸš€ ---------------------------------------------------'
+echo 'πŸš€ building libdart_ffi.a(x86_64) for AppFlowy on macOS'
+cargo make --profile production-mac-x86_64 appflowy-core-release
+
+echo 'πŸš€ ---------------------------------------------------'
+echo 'πŸš€ building libdart_ffi.a(arm64) for AppFlowy on macOS'
+cargo make --profile production-mac-arm64 appflowy-core-release
+
+echo 'πŸš€ -------------------------------------------------------'
+echo 'πŸš€ building libdart_ffi.a(universal) for AppFlowy on macOS'
+lipo -create \
+ rust-lib/target/x86_64-apple-darwin/release/libdart_ffi.a \
+ rust-lib/target/aarch64-apple-darwin/release/libdart_ffi.a \
+ -output rust-lib/target/libdart_ffi.a
+
+lipo -archs rust-lib/target/libdart_ffi.a
+
+echo 'πŸš€ ------------------------------------------------------------'
+echo 'πŸš€ moving libdart_ffi.a(universal) for AppFlowy Backend Package'
+cp -rf rust-lib/target/libdart_ffi.a \
+ appflowy_flutter/packages/appflowy_backend/macos/
+
+echo 'πŸš€ ---------------------------------------------------'
+echo 'πŸš€ building the flutter application for macOS'
+flutter build macos --release
diff --git a/frontend/scripts/makefile/desktop.toml b/frontend/scripts/makefile/desktop.toml
index c4ccbdc20e..db9f23eb75 100644
--- a/frontend/scripts/makefile/desktop.toml
+++ b/frontend/scripts/makefile/desktop.toml
@@ -15,15 +15,6 @@ mac_alias = "appflowy-core-dev-macos"
windows_alias = "appflowy-core-dev-windows"
linux_alias = "appflowy-core-dev-linux"
-[tasks.appflowy-core-dev-android]
-category = "Build"
-dependencies = ["env_check"]
-run_task = { name = [
- "setup-crate-type",
- "sdk-build-android",
- "restore-crate-type",
-] }
-
[tasks.appflowy-core-dev-macos]
category = "Build"
dependencies = ["env_check"]