Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
energye
energy
提交
83ec1513
energy
项目概览
energye
/
energy
通知
13
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
energy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
83ec1513
编写于
9月 21, 2023
作者:
yanghye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
command-line: add package for darwin
上级
8cf1ddf9
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
91 addition
and
51 deletion
+91
-51
cmd/internal/assets/assets/energy_darwin.json
cmd/internal/assets/assets/energy_darwin.json
+9
-6
cmd/internal/assets/assets/packager/darwin/Info.dev.plist
cmd/internal/assets/assets/packager/darwin/Info.dev.plist
+0
-32
cmd/internal/assets/assets/packager/darwin/Info.plist
cmd/internal/assets/assets/packager/darwin/Info.plist
+46
-12
cmd/internal/packager/pkg_app_darwin.go
cmd/internal/packager/pkg_app_darwin.go
+22
-1
cmd/internal/project/project.go
cmd/internal/project/project.go
+14
-0
未找到文件。
cmd/internal/assets/assets/energy_darwin.json
浏览文件 @
83ec1513
...
...
@@ -4,15 +4,18 @@
"frameworkPath"
:
"{{.FrameworkPath}}"
,
"assetsDir"
:
"assets"
,
"outputFilename"
:
"{{.OutputFilename}}"
,
"
info
"
:
{
"icon"
:
"{{.ProjectPath}}/resources/icon.
ico
"
,
"
plist
"
:
{
"icon"
:
"{{.ProjectPath}}/resources/icon.
png
"
,
"companyName"
:
"{{.CompanyName}}"
,
"productName"
:
"{{.ProductName}}"
,
"fileVersion"
:
"1.0.0"
,
"productVersion"
:
"1.0.0"
,
"locals"
:
[
"zh_CN"
,
"en"
],
"cfBundleVersion"
:
"1.0.0"
,
"cfBundleShortVersionString"
:
"1.0.0"
,
"copyright"
:
"Copyright....."
,
"comments"
:
"Built using ENERGY (https://github.com/energye/energy)"
,
"fileDescription"
:
"Built using ENERGY (https://github.com/energye/energy)"
"comments"
:
"Built using ENERGY (https://github.com/energye/energy)"
},
"author"
:
{
"name"
:
"yanghy"
,
...
...
cmd/internal/assets/assets/packager/darwin/Info.dev.plist
已删除
100644 → 0
浏览文件 @
8cf1ddf9
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict>
<key>
CFBundlePackageType
</key>
<string>
APPL
</string>
<key>
CFBundleName
</key>
<string>
{{.Info.ProductName}}
</string>
<key>
CFBundleExecutable
</key>
<string>
{{.Name}}
</string>
<key>
CFBundleIdentifier
</key>
<string>
com.energy.{{.Name}}
</string>
<key>
CFBundleVersion
</key>
<string>
{{.Info.ProductVersion}}
</string>
<key>
CFBundleGetInfoString
</key>
<string>
{{.Info.Comments}}
</string>
<key>
CFBundleShortVersionString
</key>
<string>
{{.Info.ProductVersion}}
</string>
<key>
CFBundleIconFile
</key>
<string>
iconfile
</string>
<key>
LSMinimumSystemVersion
</key>
<string>
10.13.0
</string>
<key>
NSHighResolutionCapable
</key>
<string>
true
</string>
<key>
NSHumanReadableCopyright
</key>
<string>
{{.Info.Copyright}}
</string>
<key>
NSAppTransportSecurity
</key>
<dict>
<key>
NSAllowsLocalNetworking
</key>
<true/>
</dict>
</dict>
</plist>
\ No newline at end of file
cmd/internal/assets/assets/packager/darwin/Info.plist
浏览文件 @
83ec1513
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict>
<key>
CFBundlePackageType
</key>
<string>
APPL
</string>
<key>
CFBundleName
</key>
<string>
{{.Info.ProductName}}
</string>
<key>
CFBundleExecutable
</key>
<string>
{{.OutputFilename}}
</string>
<key>
CFBundleName
</key>
<string>
{{.Name}}
</string>
<key>
CFBundleLocalizations
</key>
<array>
<string>
{{.PList.Locales}}
</string>
</array>
<key>
CFBundleIdentifier
</key>
<string>
com.
energy.{{.
Name}}
</string>
<string>
com.
{{.PList.CompanyName}}.{{.PList.Product
Name}}
</string>
<key>
CFBundleVersion
</key>
<string>
{{.Info.ProductVersion}}
</string>
<key>
CFBundleGetInfoString
</key>
<string>
{{.Info.Comments}}
</string>
<string>
{{.PList.CFBundleVersion}}
</string>
<key>
CFBundleShortVersionString
</key>
<string>
{{.Info.ProductVersion}}
</string>
<string>
{{.PList.CFBundleShortVersionString}}
</string>
<key>
CFBundleGetInfoString
</key>
<string>
{{.PList.Comments}}
</string>
<key>
CFBundleIconFile
</key>
<string>
iconfile
</string>
<string>
{{.PList.Icon}}
</string>
<key>
NSHumanReadableCopyright
</key>
<string>
{{.PList.Copyright}}
</string>
<key>
LSUIElement
</key>
<
{{.PList.LSUIElement}}/>
<key>
LSMinimumSystemVersion
</key>
<string>
10.13.0
</string>
<key>
NSHighResolutionCapable
</key>
<string>
true
</string>
<key>
NSHumanReadableCopyright
</key>
<string>
{{.Info.Copyright}}
</string>
<key>
NSAppTransportSecurity
</key>
<dict>
<key>
NSAllowsArbitraryLoads
</key>
<true/>
</dict>
<key>
NSPrincipalClass
</key>
<string>
TCrCocoaApplication
</string>
<key>
CFBundlePackageType
</key>
<string>
APPL
</string>
<key>
CFBundleInfoDictionaryVersion
</key>
<string>
6.0
</string>
<key>
CFBundleDocumentTypes
</key>
<array>
<dict>
<key>
CFBundleTypeRole
</key>
<string>
Viewer
</string>
<key>
CFBundleTypeExtensions
</key>
<array>
<string>
*
</string>
</array>
<key>
CFBundleTypeOSTypes
</key>
<array>
<string>
fold
</string>
<string>
disk
</string>
<string>
****
</string>
</array>
</dict>
</array>
<key>
NSHighResolutionCapable
</key>
<true/>
</dict>
</plist>
\ No newline at end of file
cmd/internal/packager/pkg_app_darwin.go
浏览文件 @
83ec1513
...
...
@@ -14,9 +14,30 @@
package
packager
import
(
"fmt"
"github.com/energye/energy/v2/cmd/internal/assets"
"github.com/energye/energy/v2/cmd/internal/project"
"github.com/energye/energy/v2/cmd/internal/tools"
"os"
"path/filepath"
)
func
GeneraInstaller
(
projectData
*
project
.
Project
)
error
{
const
(
darwinInfoPList
=
"darwin/Info.plist"
)
var
(
pkgInfo
=
[]
byte
{
0x41
,
0x50
,
0x50
,
0x4C
,
0x3F
,
0x3F
,
0x3F
,
0x3F
,
0x0D
,
0x0A
}
)
func
GeneraInstaller
(
proj
*
project
.
Project
)
error
{
appRoot
:=
fmt
.
Sprintf
(
"linux/%s-%s"
,
proj
.
Name
,
proj
.
Info
.
ProductVersion
)
buildOutDir
:=
assets
.
BuildOutPath
(
proj
)
buildOutDir
=
filepath
.
Join
(
buildOutDir
,
appRoot
)
if
!
tools
.
IsExist
(
buildOutDir
)
{
if
err
:=
os
.
MkdirAll
(
buildOutDir
,
0755
);
err
!=
nil
{
return
fmt
.
Errorf
(
"unable to create directory: %w"
,
err
)
}
}
return
nil
}
cmd/internal/project/project.go
浏览文件 @
83ec1513
...
...
@@ -32,6 +32,7 @@ type Project struct {
Info
Info
`json:"info"`
// 应用信息
NSIS
NSIS
`json:"nsis"`
// windows nsis 安装包
Dpkg
DPKG
`json:"dpkg"`
// linux dpkg 安装包
PList
PList
`json:"plist"`
// darwin plist 安装包
Author
Author
`json:"author"`
// 作者信息
}
...
...
@@ -151,6 +152,19 @@ type DPKG struct {
CompressFile
string
`json:"-"`
//压缩后的文件完全目录
}
type
PList
struct
{
Icon
string
`json:"icon"`
//应用图标, png 或 icns, 如果指定png则生成icns, 如果指定icns则直接使用
CompanyName
string
`json:"companyName"`
//公司名称
ProductName
string
`json:"productName"`
//产品名称
FileVersion
string
`json:"FileVersion"`
//文件版本
Locals
[]
string
`json:"locals"`
//语言
CFBundleVersion
string
`json:"cfBundleVersion"`
//内部版本
CFBundleShortVersionString
string
`json:"cfBundleShortVersionString"`
//发布版本号版本
Copyright
*
string
`json:"copyright"`
//版权
Comments
*
string
`json:"comments"`
//exe详情描述
}
type
Author
struct
{
Name
string
`json:"name"`
Email
string
`json:"email"`
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录