Skip to content

Commit

Permalink
macOS Test
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonacox committed Jan 20, 2025
1 parent 3e3479f commit 9c5e88a
Show file tree
Hide file tree
Showing 15 changed files with 1,972 additions and 1 deletion.
1 change: 0 additions & 1 deletion example/macOS Test App
Submodule macOS Test App deleted from f621ff
34 changes: 34 additions & 0 deletions example/macOS Test App copy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# macOS Test App

This is a test app for macOS using the curl, openssl and nghttp2 libraries.

## Screenshots

macOS Test Build

<img width="641" alt="Image" src="https://github.com/user-attachments/assets/a05b76b5-2052-4033-be18-fdf45f7342e0" />

## Build Instructions

Build the libraries with macOS support:

```bash
# Standard Build
./build.sh

# Option: Build only macOS
./build.sh -p macos
```

Load and build the project using Xcode. Example lib binaries (xcframework) and header files are included but will be replaced when you run the build script.

## New Project Setup Details

If you are setting up a new Xcode project, there are few things you will need to set up. These are all set up for you already in the xcodeproj file:

* You will also need to add the xcframework files (libs) and header files (include). You will also need to add libz.tbd, liblapd.tgb, CoreFoundation.framework, and SystemConfiguraiton.framework to the Xcode project ("General").
<img width="482" alt="Image" src="https://github.com/user-attachments/assets/29fd3b15-f130-41cd-91d8-689a6b8b3f50" />

* You will need to allow "Outgoing Connection (Client)" in the "Signing & Capabilities" of the project target "Sandbox" settings.
<img width="482" alt="Image" src="https://github.com/user-attachments/assets/cd7f5e68-bc3e-4b5c-94d6-cb44c4c2ad23" />

713 changes: 713 additions & 0 deletions example/macOS Test App copy/macOS Test App.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
17 changes: 17 additions & 0 deletions example/macOS Test App copy/macOS Test App/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// AppDelegate.h
// macOS Test App
//
// Created by Jason Cox on 1/19/25.
//

#import <Cocoa/Cocoa.h>
#import <curl/curl.h>
#import <openssl/ssl.h>

@interface AppDelegate : NSResponder <NSApplicationDelegate>

@property (strong, nonatomic) NSWindow *window;

@end

34 changes: 34 additions & 0 deletions example/macOS Test App copy/macOS Test App/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// AppDelegate.m
// macOS Test App
//
// Created by Jason Cox on 1/19/25.
//

#import "AppDelegate.h"

@interface AppDelegate ()


@end

@implementation AppDelegate


- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
// libcurl - see http://curl.haxx.se/libcurl/
curl_global_init(0L);
}

- (void)applicationWillTerminate:(NSNotification *)aNotification {
// Insert code here to tear down your application
// libcurl cleanup
curl_global_cleanup();
}

- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app {
return YES;
}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"images" : [
{
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
783 changes: 783 additions & 0 deletions example/macOS Test App copy/macOS Test App/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions example/macOS Test App copy/macOS Test App/ViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// ViewController.h
// macOS Test App
//
// Created by Jason Cox on 1/19/25.
//

#import <Cocoa/Cocoa.h>
#import <curl/curl.h>
#import <openssl/ssl.h>

@interface ViewController : NSViewController
{
IBOutlet NSTextField *_urlText; // user field for URL address
IBOutlet NSTextView *_resultText; // user field for resulting cURL data
IBOutlet NSButton *_getButton; // user button to start GET
IBOutlet NSTextField *_appTitle; // application title to update for version

// CURL global data
CURL *_curl; // curl handle
NSData *_dataToSend;
size_t _dataToSendBookmark;
NSMutableData *_dataReceived;
NSString *cacertPath; // path to cacert.pem file
}

@property (retain, nonatomic) NSTextField *_urlText;
@property (retain, nonatomic) NSTextView *_resultText;
@property (retain, nonatomic) NSButton *_getButton;
@property (retain, nonatomic) NSTextField *_appTitle;

- (IBAction)Get: (id)sender; // action method to run GET

@end

Loading

0 comments on commit 9c5e88a

Please # to comment.