Skip to content

Commit b2f9710

Browse files
authored
Merge pull request #32 from futurepaul/repair-macos
get macos building
2 parents f897359 + e321f99 commit b2f9710

File tree

8 files changed

+162
-7
lines changed

8 files changed

+162
-7
lines changed

justfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ gen:
1717
flutter_rust_bridge_codegen \
1818
-r minimint-bridge/src/api.rs \
1919
-d lib/bridge_generated.dart \
20-
-c ios/Runner/bridge_generated.h
20+
-c ios/Runner/bridge_generated.h \
21+
-c macos/Runner/bridge_generated.h
2122

lib/screens/receive.dart

+6-4
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,12 @@ class ReceiveScreen extends ConsumerWidget {
7474
var desc = descriptionController.text;
7575
var amount = int.parse(amountController.text);
7676
try {
77-
await receiveNotifier.createReceive(
78-
Receive(description: desc, amountSats: amount));
79-
// TODO figure out the right way to do this async without the mounted flag
80-
context.go("/receive/confirm");
77+
await receiveNotifier
78+
.createReceive(
79+
Receive(description: desc, amountSats: amount))
80+
.then((_) {
81+
context.go("/receive/confirm");
82+
});
8183
} catch (err) {
8284
context.go("/errormodal", extra: err);
8385
}

macos/Podfile.lock

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
PODS:
2+
- FlutterMacOS (1.0.0)
3+
- path_provider_macos (0.0.1):
4+
- FlutterMacOS
5+
- share_plus_macos (0.0.1):
6+
- FlutterMacOS
7+
- shared_preferences_macos (0.0.1):
8+
- FlutterMacOS
9+
- url_launcher_macos (0.0.1):
10+
- FlutterMacOS
11+
12+
DEPENDENCIES:
13+
- FlutterMacOS (from `Flutter/ephemeral`)
14+
- path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`)
15+
- share_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/share_plus_macos/macos`)
16+
- shared_preferences_macos (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos`)
17+
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
18+
19+
EXTERNAL SOURCES:
20+
FlutterMacOS:
21+
:path: Flutter/ephemeral
22+
path_provider_macos:
23+
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos
24+
share_plus_macos:
25+
:path: Flutter/ephemeral/.symlinks/plugins/share_plus_macos/macos
26+
shared_preferences_macos:
27+
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos
28+
url_launcher_macos:
29+
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
30+
31+
SPEC CHECKSUMS:
32+
FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424
33+
path_provider_macos: 3c0c3b4b0d4a76d2bf989a913c2de869c5641a19
34+
share_plus_macos: 853ee48e7dce06b633998ca0735d482dd671ade4
35+
shared_preferences_macos: a64dc611287ed6cbe28fd1297898db1336975727
36+
url_launcher_macos: 597e05b8e514239626bcf4a850fcf9ef5c856ec3
37+
38+
PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c
39+
40+
COCOAPODS: 1.11.3

macos/Runner.xcodeproj/project.pbxproj

+54-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
2727
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
2828
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
29+
6E24AAD528BD9F7A002F45B1 /* libminimint-bridge_static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6E24AAD028BD9D6D002F45B1 /* libminimint-bridge_static.a */; };
2930
8E2193B11A39F6A15AD9BA97 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A638F82B11816F36070305A0 /* Pods_Runner.framework */; };
3031
/* End PBXBuildFile section */
3132

@@ -37,6 +38,20 @@
3738
remoteGlobalIDString = 33CC111A2044C6BA0003C045;
3839
remoteInfo = FLX;
3940
};
41+
6E24AACF28BD9D6D002F45B1 /* PBXContainerItemProxy */ = {
42+
isa = PBXContainerItemProxy;
43+
containerPortal = 6E24AACB28BD9D6D002F45B1 /* minimint-bridge.xcodeproj */;
44+
proxyType = 2;
45+
remoteGlobalIDString = CA60AA3689D6BE71F52C75AC;
46+
remoteInfo = "minimint-bridge-staticlib";
47+
};
48+
6E24AAD128BD9D8A002F45B1 /* PBXContainerItemProxy */ = {
49+
isa = PBXContainerItemProxy;
50+
containerPortal = 6E24AACB28BD9D6D002F45B1 /* minimint-bridge.xcodeproj */;
51+
proxyType = 1;
52+
remoteGlobalIDString = CA60AA3689D62C3761166523;
53+
remoteInfo = "minimint-bridge-staticlib";
54+
};
4055
/* End PBXContainerItemProxy section */
4156

4257
/* Begin PBXCopyFilesBuildPhase section */
@@ -70,6 +85,7 @@
7085
4957D26F29264BA81A878AEC /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
7186
5B16FE20128C16D5B6AB7CEC /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
7287
5E108007AD5E32F3107B01FA /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
88+
6E24AACB28BD9D6D002F45B1 /* minimint-bridge.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "minimint-bridge.xcodeproj"; path = "../../minimint-bridge/minimint-bridge.xcodeproj"; sourceTree = "<group>"; };
7389
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
7490
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
7591
A638F82B11816F36070305A0 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -80,6 +96,7 @@
8096
isa = PBXFrameworksBuildPhase;
8197
buildActionMask = 2147483647;
8298
files = (
99+
6E24AAD528BD9F7A002F45B1 /* libminimint-bridge_static.a in Frameworks */,
83100
8E2193B11A39F6A15AD9BA97 /* Pods_Runner.framework in Frameworks */,
84101
);
85102
runOnlyForDeploymentPostprocessing = 0;
@@ -94,7 +111,6 @@
94111
5E108007AD5E32F3107B01FA /* Pods-Runner.release.xcconfig */,
95112
5B16FE20128C16D5B6AB7CEC /* Pods-Runner.profile.xcconfig */,
96113
);
97-
name = Pods;
98114
path = Pods;
99115
sourceTree = "<group>";
100116
};
@@ -153,6 +169,7 @@
153169
33FAB671232836740065AC1E /* Runner */ = {
154170
isa = PBXGroup;
155171
children = (
172+
6E24AACB28BD9D6D002F45B1 /* minimint-bridge.xcodeproj */,
156173
33CC10F02044A3C60003C045 /* AppDelegate.swift */,
157174
33CC11122044BFA00003C045 /* MainFlutterWindow.swift */,
158175
33E51913231747F40026EE4D /* DebugProfile.entitlements */,
@@ -163,6 +180,14 @@
163180
path = Runner;
164181
sourceTree = "<group>";
165182
};
183+
6E24AACC28BD9D6D002F45B1 /* Products */ = {
184+
isa = PBXGroup;
185+
children = (
186+
6E24AAD028BD9D6D002F45B1 /* libminimint-bridge_static.a */,
187+
);
188+
name = Products;
189+
sourceTree = "<group>";
190+
};
166191
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
167192
isa = PBXGroup;
168193
children = (
@@ -189,6 +214,7 @@
189214
buildRules = (
190215
);
191216
dependencies = (
217+
6E24AAD228BD9D8A002F45B1 /* PBXTargetDependency */,
192218
33CC11202044C79F0003C045 /* PBXTargetDependency */,
193219
);
194220
name = Runner;
@@ -233,6 +259,12 @@
233259
mainGroup = 33CC10E42044A3C60003C045;
234260
productRefGroup = 33CC10EE2044A3C60003C045 /* Products */;
235261
projectDirPath = "";
262+
projectReferences = (
263+
{
264+
ProductGroup = 6E24AACC28BD9D6D002F45B1 /* Products */;
265+
ProjectRef = 6E24AACB28BD9D6D002F45B1 /* minimint-bridge.xcodeproj */;
266+
},
267+
);
236268
projectRoot = "";
237269
targets = (
238270
33CC10EC2044A3C60003C045 /* Runner */,
@@ -241,6 +273,16 @@
241273
};
242274
/* End PBXProject section */
243275

276+
/* Begin PBXReferenceProxy section */
277+
6E24AAD028BD9D6D002F45B1 /* libminimint-bridge_static.a */ = {
278+
isa = PBXReferenceProxy;
279+
fileType = archive.ar;
280+
path = "libminimint-bridge_static.a";
281+
remoteRef = 6E24AACF28BD9D6D002F45B1 /* PBXContainerItemProxy */;
282+
sourceTree = BUILT_PRODUCTS_DIR;
283+
};
284+
/* End PBXReferenceProxy section */
285+
244286
/* Begin PBXResourcesBuildPhase section */
245287
33CC10EB2044A3C60003C045 /* Resources */ = {
246288
isa = PBXResourcesBuildPhase;
@@ -351,6 +393,11 @@
351393
target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */;
352394
targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */;
353395
};
396+
6E24AAD228BD9D8A002F45B1 /* PBXTargetDependency */ = {
397+
isa = PBXTargetDependency;
398+
name = "minimint-bridge-staticlib";
399+
targetProxy = 6E24AAD128BD9D8A002F45B1 /* PBXContainerItemProxy */;
400+
};
354401
/* End PBXTargetDependency section */
355402

356403
/* Begin PBXVariantGroup section */
@@ -421,12 +468,14 @@
421468
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
422469
CODE_SIGN_STYLE = Automatic;
423470
COMBINE_HIDPI_IMAGES = YES;
471+
DEVELOPMENT_TEAM = "";
424472
INFOPLIST_FILE = Runner/Info.plist;
425473
LD_RUNPATH_SEARCH_PATHS = (
426474
"$(inherited)",
427475
"@executable_path/../Frameworks",
428476
);
429477
PROVISIONING_PROFILE_SPECIFIER = "";
478+
SWIFT_OBJC_BRIDGING_HEADER = Runner/bridge_generated.h;
430479
SWIFT_VERSION = 5.0;
431480
};
432481
name = Profile;
@@ -547,12 +596,14 @@
547596
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
548597
CODE_SIGN_STYLE = Automatic;
549598
COMBINE_HIDPI_IMAGES = YES;
599+
DEVELOPMENT_TEAM = "";
550600
INFOPLIST_FILE = Runner/Info.plist;
551601
LD_RUNPATH_SEARCH_PATHS = (
552602
"$(inherited)",
553603
"@executable_path/../Frameworks",
554604
);
555605
PROVISIONING_PROFILE_SPECIFIER = "";
606+
SWIFT_OBJC_BRIDGING_HEADER = Runner/bridge_generated.h;
556607
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
557608
SWIFT_VERSION = 5.0;
558609
};
@@ -567,12 +618,14 @@
567618
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
568619
CODE_SIGN_STYLE = Automatic;
569620
COMBINE_HIDPI_IMAGES = YES;
621+
DEVELOPMENT_TEAM = "";
570622
INFOPLIST_FILE = Runner/Info.plist;
571623
LD_RUNPATH_SEARCH_PATHS = (
572624
"$(inherited)",
573625
"@executable_path/../Frameworks",
574626
);
575627
PROVISIONING_PROFILE_SPECIFIER = "";
628+
SWIFT_OBJC_BRIDGING_HEADER = Runner/bridge_generated.h;
576629
SWIFT_VERSION = 5.0;
577630
};
578631
name = Release;

macos/Runner/AppDelegate.swift

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import FlutterMacOS
44
@NSApplicationMain
55
class AppDelegate: FlutterAppDelegate {
66
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
7+
// http://cjycode.com/flutter_rust_bridge/integrate/ios_headers.html
8+
dummy_method_to_enforce_bundling()
79
return true
810
}
911
}

macos/Runner/DebugProfile.entitlements

+2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@
88
<true/>
99
<key>com.apple.security.network.server</key>
1010
<true/>
11+
<key>com.apple.security.network.client</key>
12+
<true/>
1113
</dict>
1214
</plist>

macos/Runner/bridge_generated.h

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#include <stdbool.h>
2+
#include <stdint.h>
3+
#include <stdlib.h>
4+
5+
typedef struct wire_uint_8_list {
6+
uint8_t *ptr;
7+
int32_t len;
8+
} wire_uint_8_list;
9+
10+
typedef struct WireSyncReturnStruct {
11+
uint8_t *ptr;
12+
int32_t len;
13+
bool success;
14+
} WireSyncReturnStruct;
15+
16+
typedef int64_t DartPort;
17+
18+
typedef bool (*DartPostCObjectFnType)(DartPort port_id, void *message);
19+
20+
void wire_init(int64_t port_, struct wire_uint_8_list *path);
21+
22+
void wire_join_federation(int64_t port_,
23+
struct wire_uint_8_list *user_dir,
24+
struct wire_uint_8_list *config_url);
25+
26+
void wire_leave_federation(int64_t port_);
27+
28+
void wire_balance(int64_t port_);
29+
30+
void wire_pay(int64_t port_, struct wire_uint_8_list *bolt11);
31+
32+
void wire_decode_invoice(int64_t port_, struct wire_uint_8_list *bolt11);
33+
34+
void wire_invoice(int64_t port_, uint64_t amount, struct wire_uint_8_list *description);
35+
36+
struct wire_uint_8_list *new_uint_8_list(int32_t len);
37+
38+
void free_WireSyncReturnStruct(struct WireSyncReturnStruct val);
39+
40+
void store_dart_post_cobject(DartPostCObjectFnType ptr);
41+
42+
static int64_t dummy_method_to_enforce_bundling(void) {
43+
int64_t dummy_var = 0;
44+
dummy_var ^= ((int64_t) (void*) wire_init);
45+
dummy_var ^= ((int64_t) (void*) wire_join_federation);
46+
dummy_var ^= ((int64_t) (void*) wire_leave_federation);
47+
dummy_var ^= ((int64_t) (void*) wire_balance);
48+
dummy_var ^= ((int64_t) (void*) wire_pay);
49+
dummy_var ^= ((int64_t) (void*) wire_decode_invoice);
50+
dummy_var ^= ((int64_t) (void*) wire_invoice);
51+
dummy_var ^= ((int64_t) (void*) new_uint_8_list);
52+
dummy_var ^= ((int64_t) (void*) free_WireSyncReturnStruct);
53+
dummy_var ^= ((int64_t) (void*) store_dart_post_cobject);
54+
return dummy_var;
55+
}

minimint-bridge/minimint-bridge.xcodeproj/xcuserdata/futurepaul.xcuserdatad/xcschemes/xcschememanagement.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<key>minimint-bridge-staticlib.xcscheme_^#shared#^_</key>
88
<dict>
99
<key>orderHint</key>
10-
<integer>9</integer>
10+
<integer>8</integer>
1111
</dict>
1212
</dict>
1313
</dict>

0 commit comments

Comments
 (0)