chore: support building universal macos package (#3110)

This commit is contained in:
Lucas.Xu 2023-08-03 19:02:44 +07:00 committed by GitHub
parent 45cbd70bf4
commit 70914e6228
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 57 additions and 11 deletions

View File

@ -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 = "";

View File

@ -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>

View File

@ -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>

View File

@ -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>

0
frontend/scripts/code_generation/env/generate_env.sh vendored Normal file → Executable file
View File

View File

@ -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

View File

@ -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

View File

@ -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"]