diff options
| author | ruki <[email protected]> | 2025-11-26 11:33:49 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-11-26 11:33:49 +0800 |
| commit | e7cd3c2c12d3d51ffef3d2aa9885bfef9db8d650 (patch) | |
| tree | 01bf3737ff18ffb3d6b663c781d2cc9dbd8541d1 /tests | |
| parent | 76dc60d1552a0afe1faffd996a36a412e44d548d (diff) | |
| parent | 29ec59fdd5478d14aed635022630a5f1ff492e7c (diff) | |
Merge pull request #7062 from xmake-io/dmg
Add dmg xpack format
Diffstat (limited to 'tests')
33 files changed, 311 insertions, 1 deletions
diff --git a/tests/plugins/pack/.gitignore b/tests/plugins/pack/console/.gitignore index 152105761..152105761 100644 --- a/tests/plugins/pack/.gitignore +++ b/tests/plugins/pack/console/.gitignore diff --git a/tests/plugins/pack/LICENSE.md b/tests/plugins/pack/console/LICENSE.md index fe2ff7e48..fe2ff7e48 100644 --- a/tests/plugins/pack/LICENSE.md +++ b/tests/plugins/pack/console/LICENSE.md diff --git a/tests/plugins/pack/include/foo/foo.h b/tests/plugins/pack/console/include/foo/foo.h index e69de29bb..e69de29bb 100644 --- a/tests/plugins/pack/include/foo/foo.h +++ b/tests/plugins/pack/console/include/foo/foo.h diff --git a/tests/plugins/pack/include/test.h b/tests/plugins/pack/console/include/test.h index e69de29bb..e69de29bb 100644 --- a/tests/plugins/pack/include/test.h +++ b/tests/plugins/pack/console/include/test.h diff --git a/tests/plugins/pack/src/assets/file1.txt b/tests/plugins/pack/console/src/assets/file1.txt index ce0136250..ce0136250 100644 --- a/tests/plugins/pack/src/assets/file1.txt +++ b/tests/plugins/pack/console/src/assets/file1.txt diff --git a/tests/plugins/pack/src/assets/file2.txt b/tests/plugins/pack/console/src/assets/file2.txt index ce0136250..ce0136250 100644 --- a/tests/plugins/pack/src/assets/file2.txt +++ b/tests/plugins/pack/console/src/assets/file2.txt diff --git a/tests/plugins/pack/src/assets/img1.png b/tests/plugins/pack/console/src/assets/img1.png index e69de29bb..e69de29bb 100644 --- a/tests/plugins/pack/src/assets/img1.png +++ b/tests/plugins/pack/console/src/assets/img1.png diff --git a/tests/plugins/pack/src/assets/img2.png b/tests/plugins/pack/console/src/assets/img2.png index e69de29bb..e69de29bb 100644 --- a/tests/plugins/pack/src/assets/img2.png +++ b/tests/plugins/pack/console/src/assets/img2.png diff --git a/tests/plugins/pack/src/assets/xmake.ico b/tests/plugins/pack/console/src/assets/xmake.ico Binary files differindex 52c8ef389..52c8ef389 100644 --- a/tests/plugins/pack/src/assets/xmake.ico +++ b/tests/plugins/pack/console/src/assets/xmake.ico diff --git a/tests/plugins/pack/src/main.cpp b/tests/plugins/pack/console/src/main.cpp index 55d2f380a..55d2f380a 100644 --- a/tests/plugins/pack/src/main.cpp +++ b/tests/plugins/pack/console/src/main.cpp diff --git a/tests/plugins/pack/src/xmake.rc b/tests/plugins/pack/console/src/xmake.rc index 3a2783607..3a2783607 100644 --- a/tests/plugins/pack/src/xmake.rc +++ b/tests/plugins/pack/console/src/xmake.rc diff --git a/tests/plugins/pack/xmake.lua b/tests/plugins/pack/console/xmake.lua index cf07d8ca6..244bcaee6 100644 --- a/tests/plugins/pack/xmake.lua +++ b/tests/plugins/pack/console/xmake.lua @@ -19,7 +19,7 @@ target("foo") add_packages("zlib") xpack("test") - set_formats("nsis", "srpm", "rpm", "deb", "zip", "targz", "srczip", "srctargz", "runself", "wix") + set_formats("nsis", "srpm", "rpm", "deb", "zip", "targz", "srczip", "srctargz", "runself", "wix", "dmg") set_title("hello") set_author("ruki <[email protected]>") set_description("A test installer.") diff --git a/tests/plugins/pack/macapp/src/AppDelegate.h b/tests/plugins/pack/macapp/src/AppDelegate.h new file mode 100644 index 000000000..413f74ce4 --- /dev/null +++ b/tests/plugins/pack/macapp/src/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// macapp +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import <Cocoa/Cocoa.h> + +@interface AppDelegate : NSObject <NSApplicationDelegate> + + +@end + diff --git a/tests/plugins/pack/macapp/src/AppDelegate.m b/tests/plugins/pack/macapp/src/AppDelegate.m new file mode 100644 index 000000000..b6c5d02ab --- /dev/null +++ b/tests/plugins/pack/macapp/src/AppDelegate.m @@ -0,0 +1,28 @@ +// +// AppDelegate.m +// macapp +// +// 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/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..6fa879752 --- /dev/null +++ b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,69 @@ +{ + "images" : [ + { + "filename" : "icon_16x16.png", + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "filename" : "[email protected]", + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "filename" : "icon_32x32.png", + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "filename" : "[email protected]", + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "filename" : "icon_128x128.png", + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "filename" : "[email protected]", + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "filename" : "icon_256x256.png", + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "filename" : "[email protected]", + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "filename" : "icon_512x512.png", + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "filename" : "[email protected]", + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} + diff --git a/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/icon_128x128.png b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/icon_128x128.png Binary files differnew file mode 100644 index 000000000..5d787b620 --- /dev/null +++ b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/icon_128x128.png diff --git a/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/[email protected] b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/[email protected] Binary files differnew file mode 100644 index 000000000..be7f6c4f2 --- /dev/null +++ b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/[email protected] diff --git a/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/icon_16x16.png b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/icon_16x16.png Binary files differnew file mode 100644 index 000000000..8b2771975 --- /dev/null +++ b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/icon_16x16.png diff --git a/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/[email protected] b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/[email protected] Binary files differnew file mode 100644 index 000000000..331c7af96 --- /dev/null +++ b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/[email protected] diff --git a/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/icon_256x256.png b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/icon_256x256.png Binary files differnew file mode 100644 index 000000000..be7f6c4f2 --- /dev/null +++ b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/icon_256x256.png diff --git a/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/[email protected] b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/[email protected] Binary files differnew file mode 100644 index 000000000..a5677925b --- /dev/null +++ b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/[email protected] diff --git a/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/icon_32x32.png b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/icon_32x32.png Binary files differnew file mode 100644 index 000000000..331c7af96 --- /dev/null +++ b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/icon_32x32.png diff --git a/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/[email protected] b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/[email protected] Binary files differnew file mode 100644 index 000000000..c8e5ac0c2 --- /dev/null +++ b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/[email protected] diff --git a/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/icon_512x512.png b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/icon_512x512.png Binary files differnew file mode 100644 index 000000000..a5677925b --- /dev/null +++ b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/icon_512x512.png diff --git a/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/[email protected] b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/[email protected] Binary files differnew file mode 100644 index 000000000..d6533fea6 --- /dev/null +++ b/tests/plugins/pack/macapp/src/Assets.xcassets/AppIcon.appiconset/[email protected] diff --git a/tests/plugins/pack/macapp/src/Assets.xcassets/Contents.json b/tests/plugins/pack/macapp/src/Assets.xcassets/Contents.json new file mode 100644 index 000000000..7afcdfaf8 --- /dev/null +++ b/tests/plugins/pack/macapp/src/Assets.xcassets/Contents.json @@ -0,0 +1,7 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} + diff --git a/tests/plugins/pack/macapp/src/Base.lproj/Main.storyboard b/tests/plugins/pack/macapp/src/Base.lproj/Main.storyboard new file mode 100644 index 000000000..dd1212a78 --- /dev/null +++ b/tests/plugins/pack/macapp/src/Base.lproj/Main.storyboard @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="11134" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS"> + <dependencies> + <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11134"/> + </dependencies> + <scenes> + <!--Application--> + <scene sceneID="JPo-4y-FX3"> + <objects> + <application id="hnw-xV-0zn" sceneMemberID="viewController"> + <menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6"> + <items> + <menuItem title="macapp" id="1Xt-HY-uBw"> + <modifierMask key="keyEquivalentModifierMask"/> + <menu key="submenu" title="macapp" systemMenu="apple" id="uQy-DD-JDr"> + <items> + <menuItem title="About macapp" id="5kV-Vb-QxS"> + <modifierMask key="keyEquivalentModifierMask"/> + </menuItem> + <menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/> + <menuItem title="Quit macapp" keyEquivalent="q" id="4sb-4s-VLi"> + </menuItem> + </items> + </menu> + </menuItem> + </items> + </menu> + <connections> + <outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/> + </connections> + </application> + <customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModuleProvider=""/> + <customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/> + </objects> + <point key="canvasLocation" x="75" y="0.0"/> + </scene> + <!--Window Controller--> + <scene sceneID="R2V-B0-nI4"> + <objects> + <windowController id="B8D-0N-5wS" sceneMemberID="viewController"> + <window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA"> + <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/> + <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/> + <rect key="contentRect" x="196" y="240" width="480" height="270"/> + <rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/> + <connections> + <outlet property="delegate" destination="B8D-0N-5wS" id="98r-iN-zZc"/> + </connections> + </window> + <connections> + <segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="cq2-FE-JQM"/> + </connections> + </windowController> + <customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/> + </objects> + <point key="canvasLocation" x="75" y="250"/> + </scene> + <!--View Controller--> + <scene sceneID="hIz-AP-VOD"> + <objects> + <viewController id="XfG-lQ-9wD" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController"> + <view key="view" id="m2S-Jp-Qdl"> + <rect key="frame" x="0.0" y="0.0" width="480" height="270"/> + <autoresizingMask key="autoresizingMask"/> + </view> + </viewController> + <customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/> + </objects> + <point key="canvasLocation" x="75" y="655"/> + </scene> + </scenes> +</document> + diff --git a/tests/plugins/pack/macapp/src/Info.plist b/tests/plugins/pack/macapp/src/Info.plist new file mode 100644 index 000000000..477a62fd7 --- /dev/null +++ b/tests/plugins/pack/macapp/src/Info.plist @@ -0,0 +1,39 @@ +<?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>CFBundleDevelopmentRegion</key> + <string>$(DEVELOPMENT_LANGUAGE)</string> + <key>CFBundleExecutable</key> + <string>$(EXECUTABLE_NAME)</string> + <key>CFBundleIconFile</key> + <string>AppIcon</string> + <key>CFBundleIdentifier</key> + <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>$(PRODUCT_NAME)</string> + <key>CFBundleDisplayName</key> + <string>$(PRODUCT_DISPLAY_NAME)</string> + <key>CFBundlePackageType</key> + <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> + <key>CFBundleShortVersionString</key> + <string>1.0</string> + <key>CFBundleVersion</key> + <string>1</string> + <key>LSMinimumSystemVersion</key> + <string>$(MACOSX_DEPLOYMENT_TARGET)</string> + <key>NSHumanReadableCopyright</key> + <string>Copyright © 2020 tboox. All rights reserved.</string> + <key>NSMainStoryboardFile</key> + <string>Main</string> + <key>NSPrincipalClass</key> + <string>NSApplication</string> + <key>NSSupportsAutomaticTermination</key> + <true/> + <key>NSSupportsSuddenTermination</key> + <true/> +</dict> +</plist> + diff --git a/tests/plugins/pack/macapp/src/ViewController.h b/tests/plugins/pack/macapp/src/ViewController.h new file mode 100644 index 000000000..41858ce17 --- /dev/null +++ b/tests/plugins/pack/macapp/src/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// macapp +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import <Cocoa/Cocoa.h> + +@interface ViewController : NSViewController + + +@end + diff --git a/tests/plugins/pack/macapp/src/ViewController.m b/tests/plugins/pack/macapp/src/ViewController.m new file mode 100644 index 000000000..23f78028d --- /dev/null +++ b/tests/plugins/pack/macapp/src/ViewController.m @@ -0,0 +1,28 @@ +// +// ViewController.m +// macapp +// +// 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/tests/plugins/pack/macapp/src/assets/xmake.ico b/tests/plugins/pack/macapp/src/assets/xmake.ico Binary files differnew file mode 100644 index 000000000..52c8ef389 --- /dev/null +++ b/tests/plugins/pack/macapp/src/assets/xmake.ico diff --git a/tests/plugins/pack/macapp/src/main.m b/tests/plugins/pack/macapp/src/main.m new file mode 100644 index 000000000..01b588b66 --- /dev/null +++ b/tests/plugins/pack/macapp/src/main.m @@ -0,0 +1,17 @@ +// +// main.m +// macapp +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import <Cocoa/Cocoa.h> + +int main(int argc, const char * argv[]) { + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + } + return NSApplicationMain(argc, argv); +} + diff --git a/tests/plugins/pack/macapp/xmake.lua b/tests/plugins/pack/macapp/xmake.lua new file mode 100644 index 000000000..4dd391ae0 --- /dev/null +++ b/tests/plugins/pack/macapp/xmake.lua @@ -0,0 +1,19 @@ +set_version("1.0.0") +add_rules("mode.debug", "mode.release") + +includes("@builtin/xpack") + +target("macapp") + add_rules("xcode.application") + add_files("src/*.m", "src/**.storyboard", "src/*.xcassets") + add_files("src/Info.plist") + +xpack("macapp") + set_formats("dmg") + set_title("MacApp Test") + set_author("ruki <[email protected]>") + set_description("A test macOS application installer.") + set_homepage("https://xmake.io") + set_license("Apache-2.0") + add_targets("macapp") + |
