Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
9b16addf
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
9b16addf
编写于
7月 30, 2015
作者:
C
Chinmay Garde
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow loading SkyX files on Mac desktop
上级
20483160
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
823 addition
and
35 deletion
+823
-35
build/config/mac/rules.gni
build/config/mac/rules.gni
+7
-3
sky/build/sky_app.gni
sky/build/sky_app.gni
+39
-3
sky/packages/sky/example/game/BUILD.gn
sky/packages/sky/example/game/BUILD.gn
+3
-0
sky/packages/sky/example/game/mac/Info.plist
sky/packages/sky/example/game/mac/Info.plist
+34
-0
sky/packages/sky/example/game/mac/sky_mac.xib
sky/packages/sky/example/game/mac/sky_mac.xib
+695
-0
sky/shell/BUILD.gn
sky/shell/BUILD.gn
+26
-27
sky/shell/mac/sky_window.mm
sky/shell/mac/sky_window.mm
+19
-2
未找到文件。
build/config/mac/rules.gni
浏览文件 @
9b16addf
...
...
@@ -87,6 +87,10 @@ template("resource_copy_mac") {
set_sources_assignment_filter([])
sources = _resources
outputs = [ "$root_build_dir/$_app_name.app/$_bundle_directory/Contents/Resources/{{source_file_part}}" ]
if (defined(invoker.deps)) {
deps = invoker.deps
}
}
}
...
...
@@ -147,14 +151,14 @@ template("mac_app") {
script = mac_app_script
sources = [ invoker.info_plist ]
outputs = [ "$root_build_dir/Info.plist" ]
outputs = [ "$root_build_dir/
plist/$app_name/
Info.plist" ]
args = [
"plist",
"-i",
rebase_path(invoker.info_plist, root_build_dir),
"-o",
rebase_path(
root_build_dir
),
rebase_path(
"$root_build_dir/plist/$app_name"
),
]
}
...
...
@@ -163,7 +167,7 @@ template("mac_app") {
copy_plist_gen_target_name = target_name + "_plist_copy"
copy(copy_plist_gen_target_name) {
sources = [
"$root_build_dir/Info.plist",
"$root_build_dir/
plist/$app_name/
Info.plist",
]
outputs = [
...
...
sky/build/sky_app.gni
浏览文件 @
9b16addf
...
...
@@ -7,7 +7,7 @@ import("//sky/build/skyx.gni")
template("sky_app") {
skyx_target_name = target_name
if (is_android || is_ios) {
if (is_android || is_ios
|| is_mac
) {
skyx_target_name = "app"
}
...
...
@@ -113,7 +113,9 @@ template("sky_app") {
"$target_gen_dir/app.skyx",
]
resources += invoker.launcher_resources
if (defined(invoker.launcher_resources)) {
resources += invoker.launcher_resources
}
bundle_directory = "."
deps = [ ":app" ]
...
...
@@ -129,7 +131,41 @@ template("sky_app") {
deps += invoker.deps
}
}
} else if(is_ios) {
} else if(is_mac && defined(invoker.info_plist)) {
import("//build/config/mac/rules.gni")
mac_app(target_name) {
app_name = target_name + "_app"
info_plist = invoker.info_plist
xibs = invoker.xibs
resources_gen_target_name = target_name + "_res"
resource_copy_mac(resources_gen_target_name) {
resources = [
"//third_party/icu/android/icudtl.dat",
"$target_gen_dir/app.skyx",
]
if (defined(invoker.launcher_resources)) {
resources += invoker.launcher_resources
}
bundle_directory = "."
deps = [ ":app" ]
}
deps = [
":$resources_gen_target_name",
"//sky/shell:mac_scaffolding",
]
if (defined(invoker.deps)) {
deps += invoker.deps
}
}
} else if(is_ios || is_mac) {
# No Info.plist specified. But we still need an empty target
group(target_name) {
}
...
...
sky/packages/sky/example/game/BUILD.gn
浏览文件 @
9b16addf
...
...
@@ -21,5 +21,8 @@ sky_app("game") {
"assets/Icon@2x.png",
"ios/LaunchScreen.storyboardc",
]
} else if (is_mac) {
info_plist = "mac/Info.plist"
xibs = [ "mac/sky_mac.xib" ]
}
}
sky/packages/sky/example/game/mac/Info.plist
0 → 100644
浏览文件 @
9b16addf
<?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>
en
</string>
<key>
CFBundleExecutable
</key>
<string>
game_app
</string>
<key>
CFBundleIconFile
</key>
<string></string>
<key>
CFBundleIdentifier
</key>
<string>
org.domokit.sky.asteroids
</string>
<key>
CFBundleInfoDictionaryVersion
</key>
<string>
6.0
</string>
<key>
CFBundleName
</key>
<string>
Asteroids
</string>
<key>
CFBundlePackageType
</key>
<string>
APPL
</string>
<key>
CFBundleShortVersionString
</key>
<string>
1.0
</string>
<key>
CFBundleSignature
</key>
<string>
????
</string>
<key>
CFBundleVersion
</key>
<string>
1
</string>
<key>
LSMinimumSystemVersion
</key>
<string>
10.6
</string>
<key>
NSHumanReadableCopyright
</key>
<string>
Copyright © 2015 The Chromium Authors. All rights reserved.
</string>
<key>
NSMainNibFile
</key>
<string>
sky_mac
</string>
<key>
NSPrincipalClass
</key>
<string>
SkyApplication
</string>
</dict>
</plist>
sky/packages/sky/example/game/mac/sky_mac.xib
0 → 100644
浏览文件 @
9b16addf
此差异已折叠。
点击以展开。
sky/shell/BUILD.gn
浏览文件 @
9b16addf
...
...
@@ -235,10 +235,34 @@ if (is_android) {
} else if (is_mac) {
import("//build/config/mac/rules.gni")
source_set("mac_scaffolding") {
sources = [
"mac/main_mac.mm",
"mac/platform_mac.h",
"mac/platform_mac.mm",
"mac/platform_service_provider_mac.cc",
"mac/platform_view_mac.h",
"mac/platform_view_mac.mm",
"mac/sky_app_delegate.h",
"mac/sky_app_delegate.m",
"mac/sky_application.h",
"mac/sky_application.mm",
"mac/sky_window.h",
"mac/sky_window.mm",
"testing/test_runner.cc",
"testing/test_runner.h",
]
deps = common_deps + [
":common",
"//sky/services/ns_net",
"//sky/services/testing:interfaces",
]
}
mac_app("shell") {
app_name = "SkyShell"
info_plist = "mac/Info.plist"
scaffolding_target = "mac_scaffolding"
# entitlements_path = ""
# code_signing_identity = ""
...
...
@@ -250,33 +274,8 @@ if (is_android) {
bundle_directory = "."
}
source_set(scaffolding_target) {
sources = [
"mac/main_mac.mm",
"mac/platform_mac.h",
"mac/platform_mac.mm",
"mac/platform_service_provider_mac.cc",
"mac/platform_view_mac.h",
"mac/platform_view_mac.mm",
"mac/sky_app_delegate.h",
"mac/sky_app_delegate.m",
"mac/sky_application.h",
"mac/sky_application.mm",
"mac/sky_window.h",
"mac/sky_window.mm",
"testing/test_runner.cc",
"testing/test_runner.h",
]
deps = common_deps + [
":common",
"//sky/services/ns_net",
"//sky/services/testing:interfaces",
]
}
deps = [
":
$scaffolding_target
",
":
mac_scaffolding
",
":sky_resources",
]
}
...
...
sky/shell/mac/sky_window.mm
浏览文件 @
9b16addf
...
...
@@ -70,12 +70,29 @@ static inline sky::EventType EventTypeFromNSEventPhase(NSEventPhase phase) {
.
infoDictionary
objectForKey
:
@"org.domokit.sky.load_url"
];
}
-
(
NSString
*
)
skyInitialBundleURL
{
return
[[
NSBundle
mainBundle
]
pathForResource
:
@"app"
ofType
:
@"skyx"
];
}
-
(
void
)
setupAndLoadDart
{
auto
interface_request
=
mojo
::
GetProxy
(
&
_sky_engine
);
self
.
platformView
->
ConnectToEngine
(
interface_request
.
Pass
());
mojo
::
String
string
(
self
.
skyInitialLoadURL
.
UTF8String
);
_sky_engine
->
RunFromNetwork
(
string
);
NSString
*
endpoint
=
self
.
skyInitialBundleURL
;
if
(
endpoint
.
length
>
0
)
{
// Load from bundle
mojo
::
String
string
(
endpoint
.
UTF8String
);
_sky_engine
->
RunFromBundle
(
string
);
return
;
}
endpoint
=
self
.
skyInitialLoadURL
;
if
(
endpoint
.
length
>
0
)
{
// Load from URL
mojo
::
String
string
(
endpoint
.
UTF8String
);
_sky_engine
->
RunFromNetwork
(
string
);
return
;
}
}
-
(
void
)
windowDidResize
:(
NSNotification
*
)
notification
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录