From 1127c631b060a8f95e30cde3f89e2dd97fd34e5c Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 10 Apr 2020 23:50:21 +0800 Subject: add iosapp and macapp templates --- .../objc/iosapp/project/src/AppDelegate.h | 15 + .../objc/iosapp/project/src/AppDelegate.m | 41 ++ .../AppIcon.appiconset/Contents.json | 98 +++ .../project/src/Assets.xcassets/Contents.json | 6 + .../project/src/Base.lproj/LaunchScreen.storyboard | 25 + .../iosapp/project/src/Base.lproj/Main.storyboard | 24 + xmake/templates/objc/iosapp/project/src/Info.plist | 66 ++ .../objc/iosapp/project/src/SceneDelegate.h | 16 + .../objc/iosapp/project/src/SceneDelegate.m | 50 ++ .../objc/iosapp/project/src/ViewController.h | 15 + .../objc/iosapp/project/src/ViewController.m | 23 + xmake/templates/objc/iosapp/project/src/main.m | 19 + xmake/templates/objc/iosapp/project/xmake.lua | 6 + xmake/templates/objc/iosapp/template.lua | 2 + .../objc/macapp/project/src/AppDelegate.h | 15 + .../objc/macapp/project/src/AppDelegate.m | 27 + .../AppIcon.appiconset/Contents.json | 58 ++ .../project/src/Assets.xcassets/Contents.json | 6 + .../macapp/project/src/Base.lproj/Main.storyboard | 717 +++++++++++++++++++++ xmake/templates/objc/macapp/project/src/Info.plist | 38 ++ .../objc/macapp/project/src/ViewController.h | 15 + .../objc/macapp/project/src/ViewController.m | 27 + xmake/templates/objc/macapp/project/src/main.m | 16 + .../objc/macapp/project/src/test.entitlements | 10 + xmake/templates/objc/macapp/project/xmake.lua | 6 + xmake/templates/objc/macapp/template.lua | 2 + 26 files changed, 1343 insertions(+) create mode 100644 xmake/templates/objc/iosapp/project/src/AppDelegate.h create mode 100644 xmake/templates/objc/iosapp/project/src/AppDelegate.m create mode 100644 xmake/templates/objc/iosapp/project/src/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 xmake/templates/objc/iosapp/project/src/Assets.xcassets/Contents.json create mode 100644 xmake/templates/objc/iosapp/project/src/Base.lproj/LaunchScreen.storyboard create mode 100644 xmake/templates/objc/iosapp/project/src/Base.lproj/Main.storyboard create mode 100644 xmake/templates/objc/iosapp/project/src/Info.plist create mode 100644 xmake/templates/objc/iosapp/project/src/SceneDelegate.h create mode 100644 xmake/templates/objc/iosapp/project/src/SceneDelegate.m create mode 100644 xmake/templates/objc/iosapp/project/src/ViewController.h create mode 100644 xmake/templates/objc/iosapp/project/src/ViewController.m create mode 100644 xmake/templates/objc/iosapp/project/src/main.m create mode 100644 xmake/templates/objc/iosapp/project/xmake.lua create mode 100644 xmake/templates/objc/iosapp/template.lua create mode 100644 xmake/templates/objc/macapp/project/src/AppDelegate.h create mode 100644 xmake/templates/objc/macapp/project/src/AppDelegate.m create mode 100644 xmake/templates/objc/macapp/project/src/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 xmake/templates/objc/macapp/project/src/Assets.xcassets/Contents.json create mode 100644 xmake/templates/objc/macapp/project/src/Base.lproj/Main.storyboard create mode 100644 xmake/templates/objc/macapp/project/src/Info.plist create mode 100644 xmake/templates/objc/macapp/project/src/ViewController.h create mode 100644 xmake/templates/objc/macapp/project/src/ViewController.m create mode 100644 xmake/templates/objc/macapp/project/src/main.m create mode 100644 xmake/templates/objc/macapp/project/src/test.entitlements create mode 100644 xmake/templates/objc/macapp/project/xmake.lua create mode 100644 xmake/templates/objc/macapp/template.lua diff --git a/xmake/templates/objc/iosapp/project/src/AppDelegate.h b/xmake/templates/objc/iosapp/project/src/AppDelegate.h new file mode 100644 index 000000000..b01a8dc72 --- /dev/null +++ b/xmake/templates/objc/iosapp/project/src/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + + +@end + diff --git a/xmake/templates/objc/iosapp/project/src/AppDelegate.m b/xmake/templates/objc/iosapp/project/src/AppDelegate.m new file mode 100644 index 000000000..0ad500bfe --- /dev/null +++ b/xmake/templates/objc/iosapp/project/src/AppDelegate.m @@ -0,0 +1,41 @@ +// +// AppDelegate.m +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +#pragma mark - UISceneSession lifecycle + + +- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; +} + + +- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. +} + + +@end diff --git a/xmake/templates/objc/iosapp/project/src/Assets.xcassets/AppIcon.appiconset/Contents.json b/xmake/templates/objc/iosapp/project/src/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..d8db8d65f --- /dev/null +++ b/xmake/templates/objc/iosapp/project/src/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/xmake/templates/objc/iosapp/project/src/Assets.xcassets/Contents.json b/xmake/templates/objc/iosapp/project/src/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/xmake/templates/objc/iosapp/project/src/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/xmake/templates/objc/iosapp/project/src/Base.lproj/LaunchScreen.storyboard b/xmake/templates/objc/iosapp/project/src/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..865e9329f --- /dev/null +++ b/xmake/templates/objc/iosapp/project/src/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmake/templates/objc/iosapp/project/src/Base.lproj/Main.storyboard b/xmake/templates/objc/iosapp/project/src/Base.lproj/Main.storyboard new file mode 100644 index 000000000..808a21ce7 --- /dev/null +++ b/xmake/templates/objc/iosapp/project/src/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmake/templates/objc/iosapp/project/src/Info.plist b/xmake/templates/objc/iosapp/project/src/Info.plist new file mode 100644 index 000000000..686d21a3a --- /dev/null +++ b/xmake/templates/objc/iosapp/project/src/Info.plist @@ -0,0 +1,66 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundleDisplayName + $(PRODUCT_DISPLAY_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + SceneDelegate + UISceneStoryboardFile + Main + + + + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/xmake/templates/objc/iosapp/project/src/SceneDelegate.h b/xmake/templates/objc/iosapp/project/src/SceneDelegate.h new file mode 100644 index 000000000..5dbf88aa6 --- /dev/null +++ b/xmake/templates/objc/iosapp/project/src/SceneDelegate.h @@ -0,0 +1,16 @@ +// +// SceneDelegate.h +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface SceneDelegate : UIResponder + +@property (strong, nonatomic) UIWindow * window; + +@end + diff --git a/xmake/templates/objc/iosapp/project/src/SceneDelegate.m b/xmake/templates/objc/iosapp/project/src/SceneDelegate.m new file mode 100644 index 000000000..d6698dd7c --- /dev/null +++ b/xmake/templates/objc/iosapp/project/src/SceneDelegate.m @@ -0,0 +1,50 @@ +#import "SceneDelegate.h" + +@interface SceneDelegate () + +@end + +@implementation SceneDelegate + + +- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). +} + + +- (void)sceneDidDisconnect:(UIScene *)scene { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). +} + + +- (void)sceneDidBecomeActive:(UIScene *)scene { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. +} + + +- (void)sceneWillResignActive:(UIScene *)scene { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). +} + + +- (void)sceneWillEnterForeground:(UIScene *)scene { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. +} + + +- (void)sceneDidEnterBackground:(UIScene *)scene { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. +} + + +@end diff --git a/xmake/templates/objc/iosapp/project/src/ViewController.h b/xmake/templates/objc/iosapp/project/src/ViewController.h new file mode 100644 index 000000000..e74d2f236 --- /dev/null +++ b/xmake/templates/objc/iosapp/project/src/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/xmake/templates/objc/iosapp/project/src/ViewController.m b/xmake/templates/objc/iosapp/project/src/ViewController.m new file mode 100644 index 000000000..c3441c87a --- /dev/null +++ b/xmake/templates/objc/iosapp/project/src/ViewController.m @@ -0,0 +1,23 @@ +// +// ViewController.m +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + + +@end diff --git a/xmake/templates/objc/iosapp/project/src/main.m b/xmake/templates/objc/iosapp/project/src/main.m new file mode 100644 index 000000000..11a58afc7 --- /dev/null +++ b/xmake/templates/objc/iosapp/project/src/main.m @@ -0,0 +1,19 @@ +// +// main.m +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + NSString * appDelegateClassName; + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + appDelegateClassName = NSStringFromClass([AppDelegate class]); + } + return UIApplicationMain(argc, argv, nil, appDelegateClassName); +} diff --git a/xmake/templates/objc/iosapp/project/xmake.lua b/xmake/templates/objc/iosapp/project/xmake.lua new file mode 100644 index 000000000..b5b00b81f --- /dev/null +++ b/xmake/templates/objc/iosapp/project/xmake.lua @@ -0,0 +1,6 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + add_rules("xcode.application") + add_files("src/*.m", "src/**.storyboard", "src/*.xcassets") + add_files("src/Info.plist") diff --git a/xmake/templates/objc/iosapp/template.lua b/xmake/templates/objc/iosapp/template.lua new file mode 100644 index 000000000..9355dc661 --- /dev/null +++ b/xmake/templates/objc/iosapp/template.lua @@ -0,0 +1,2 @@ +template("xcode.iosapp") + add_configfiles("xmake.lua") diff --git a/xmake/templates/objc/macapp/project/src/AppDelegate.h b/xmake/templates/objc/macapp/project/src/AppDelegate.h new file mode 100644 index 000000000..5f5ba059e --- /dev/null +++ b/xmake/templates/objc/macapp/project/src/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface AppDelegate : NSObject + + +@end + diff --git a/xmake/templates/objc/macapp/project/src/AppDelegate.m b/xmake/templates/objc/macapp/project/src/AppDelegate.m new file mode 100644 index 000000000..da967d2ef --- /dev/null +++ b/xmake/templates/objc/macapp/project/src/AppDelegate.m @@ -0,0 +1,27 @@ +// +// AppDelegate.m +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + // Insert code here to initialize your application +} + + +- (void)applicationWillTerminate:(NSNotification *)aNotification { + // Insert code here to tear down your application +} + + +@end diff --git a/xmake/templates/objc/macapp/project/src/Assets.xcassets/AppIcon.appiconset/Contents.json b/xmake/templates/objc/macapp/project/src/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..2db2b1c7c --- /dev/null +++ b/xmake/templates/objc/macapp/project/src/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/xmake/templates/objc/macapp/project/src/Assets.xcassets/Contents.json b/xmake/templates/objc/macapp/project/src/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/xmake/templates/objc/macapp/project/src/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/xmake/templates/objc/macapp/project/src/Base.lproj/Main.storyboard b/xmake/templates/objc/macapp/project/src/Base.lproj/Main.storyboard new file mode 100644 index 000000000..7a6d659a5 --- /dev/null +++ b/xmake/templates/objc/macapp/project/src/Base.lproj/Main.storyboard @@ -0,0 +1,717 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmake/templates/objc/macapp/project/src/Info.plist b/xmake/templates/objc/macapp/project/src/Info.plist new file mode 100644 index 000000000..ce53d780c --- /dev/null +++ b/xmake/templates/objc/macapp/project/src/Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundleDisplayName + $(PRODUCT_DISPLAY_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2020 tboox. All rights reserved. + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + NSSupportsAutomaticTermination + + NSSupportsSuddenTermination + + + diff --git a/xmake/templates/objc/macapp/project/src/ViewController.h b/xmake/templates/objc/macapp/project/src/ViewController.h new file mode 100644 index 000000000..a974fc934 --- /dev/null +++ b/xmake/templates/objc/macapp/project/src/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface ViewController : NSViewController + + +@end + diff --git a/xmake/templates/objc/macapp/project/src/ViewController.m b/xmake/templates/objc/macapp/project/src/ViewController.m new file mode 100644 index 000000000..bccdf6189 --- /dev/null +++ b/xmake/templates/objc/macapp/project/src/ViewController.m @@ -0,0 +1,27 @@ +// +// ViewController.m +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "ViewController.h" + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + // Do any additional setup after loading the view. +} + + +- (void)setRepresentedObject:(id)representedObject { + [super setRepresentedObject:representedObject]; + + // Update the view, if already loaded. +} + + +@end diff --git a/xmake/templates/objc/macapp/project/src/main.m b/xmake/templates/objc/macapp/project/src/main.m new file mode 100644 index 000000000..ae3706f51 --- /dev/null +++ b/xmake/templates/objc/macapp/project/src/main.m @@ -0,0 +1,16 @@ +// +// main.m +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +int main(int argc, const char * argv[]) { + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + } + return NSApplicationMain(argc, argv); +} diff --git a/xmake/templates/objc/macapp/project/src/test.entitlements b/xmake/templates/objc/macapp/project/src/test.entitlements new file mode 100644 index 000000000..f2ef3ae02 --- /dev/null +++ b/xmake/templates/objc/macapp/project/src/test.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/xmake/templates/objc/macapp/project/xmake.lua b/xmake/templates/objc/macapp/project/xmake.lua new file mode 100644 index 000000000..b5b00b81f --- /dev/null +++ b/xmake/templates/objc/macapp/project/xmake.lua @@ -0,0 +1,6 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + add_rules("xcode.application") + add_files("src/*.m", "src/**.storyboard", "src/*.xcassets") + add_files("src/Info.plist") diff --git a/xmake/templates/objc/macapp/template.lua b/xmake/templates/objc/macapp/template.lua new file mode 100644 index 000000000..1c9e67542 --- /dev/null +++ b/xmake/templates/objc/macapp/template.lua @@ -0,0 +1,2 @@ +template("xcode.macapp") + add_configfiles("xmake.lua") -- cgit v1.3.1