Skip to content

Commit

Permalink
add and update macos build scripts, gitignore macos project.pbxproj
Browse files Browse the repository at this point in the history
  • Loading branch information
itswisdomagain committed Dec 21, 2023
1 parent be285e7 commit ebbe645
Show file tree
Hide file tree
Showing 20 changed files with 207 additions and 720 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,4 @@ assets/images/app_logo.png
macos/Runner/Info.plist
macos/Runner/DebugProfile.entitlements
macos/Runner/Release.entitlements
macos/Runner.xcodeproj/project.pbxproj
33 changes: 33 additions & 0 deletions build_macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
cd scripts/macos

echo "============================ BUILDING DEPS ============================"
source ./app_env.sh cakewallet
../android/manifest.sh # to avoid "`connectivity_plus` requires your app to be migrated" error
./app_config.sh
./build_all.sh
./setup.sh
./gen.sh

echo "=================== generate secrets, localization ===================="
cd ../.. && flutter pub get
flutter packages pub run tool/generate_new_secrets.dart
flutter packages pub run tool/generate_localization.dart

echo "================================ mobx ================================="
cd cw_core && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
cd cw_monero && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
cd cw_bitcoin && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
# cd cw_haven && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
cd cw_ethereum && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
cd cw_nano && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
cd cw_bitcoin_cash && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
cd cw_polygon && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
flutter packages pub run build_runner build --delete-conflicting-outputs

echo "
============================ ALL DONE. NEXT STEPS: ====================
= =
= UPDATE TEAM AND BUNDLE IDENTIFIER IN XCODE > SIGNING & CAPABILITIES =
= =
=======================================================================
"
14 changes: 14 additions & 0 deletions configure_cake_wallet_macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cd scripts/macos
source ./app_env.sh cakewallet
../android/manifest.sh # to avoid "`connectivity_plus` requires your app to be migrated" error
./app_config.sh
cd ../.. && flutter pub get
cd cw_core && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
cd cw_monero && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
cd cw_bitcoin && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
# cd cw_haven && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
cd cw_ethereum && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
cd cw_nano && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
cd cw_bitcoin_cash && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
cd cw_polygon && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
flutter packages pub run build_runner build --delete-conflicting-outputs
9 changes: 0 additions & 9 deletions cw_nano/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -764,15 +764,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.1"
tor:
dependency: transitive
description:
path: "."
ref: main
resolved-ref: "09ba92cb11d4e3cacf97256e57863b805f79f2e5"
url: "https://github.com/cake-tech/tor.git"
source: git
version: "0.0.1"
typed_data:
dependency: transitive
description:
Expand Down
57 changes: 57 additions & 0 deletions howto-build-macos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Building CakeWallet for MacOS

## Requirements and Setup

The following are the system requirements to build CakeWallet for your Mac.

```
MacOS 12.6.3 Monterey. (Other versions untested)
Flutter 3.10.6. (Other versions untested)
```

## Build Steps

These steps will help you configure and execute a build of CakeWallet from its source code.

### 1. Installing Package Dependencies

The following packages must be installed on your build system.
Skip this step if they are already installed.

`$ brew install python autoconf automake libtool doxygen graphviz`

### 2. Acquiring the CakeWallet Source Code

Create the directory that will be use to store the CakeWallet source and download the source code into that directory.

`$ git clone https://github.com/cake-tech/cake_wallet.git --branch main`

Proceed into the source code before proceeding with the next steps:

`$ cd {cake_wallet_repo_directory}`

### 3. Execute Build & Setup Commands for CakeWallet

Execute the `build_macos.sh` script.

`$ ./build_macos.sh`

The `build_macos.sh` script will generate and update relevant project files, including cryptographic salts that the CakeWallet binary will be built with, which are used for secure encryption of your data.

It will also build the Monero libraries and their dependencies.

### 4. Run!

Open the `macos/Runner.xcworkspace` file in Xcode and edit the Team and Bundle Identifier.
Then you can run the app.

`$ flutter run -d macos`

### 5. Troubleshooting

If you experience encryption or data corruption issues, possibly because of overridding previously used secrets with newly generated secrets, delete the app data dir and clear the app's NSDefaults storage. You might need to replace `com.fotolockr.cakewallet` with the bundle ID you set in step 4 above.

`$ rm -rf $HOME/Library/Containers/com.fotolockr.cakewallet/`
`$ defaults delete com.fotolockr.cakewallet`

Copyright (c) 2023 Cake Technologies LLC.
5 changes: 0 additions & 5 deletions macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ PODS:
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- tor (0.0.1)
- url_launcher_macos (0.0.1):
- FlutterMacOS
- wakelock_plus (0.0.1):
Expand All @@ -60,7 +59,6 @@ DEPENDENCIES:
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
- share_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/share_plus_macos/macos`)
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
- tor (from `Flutter/ephemeral/.symlinks/plugins/tor/macos`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
- wakelock_plus (from `Flutter/ephemeral/.symlinks/plugins/wakelock_plus/macos`)

Expand Down Expand Up @@ -93,8 +91,6 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/share_plus_macos/macos
shared_preferences_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin
tor:
:path: Flutter/ephemeral/.symlinks/plugins/tor/macos
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
wakelock_plus:
Expand All @@ -114,7 +110,6 @@ SPEC CHECKSUMS:
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
share_plus_macos: 853ee48e7dce06b633998ca0735d482dd671ade4
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
tor: 2138c48428e696b83eacdda404de6d5574932e26
url_launcher_macos: d2691c7dd33ed713bf3544850a623080ec693d95
wakelock_plus: 4783562c9a43d209c458cb9b30692134af456269

Expand Down
Loading

0 comments on commit ebbe645

Please sign in to comment.