tools.deploy.macosx: copy "icon.icns" from deployed vocab to app bundle as app icon
parent
45c85d1851
commit
f9d6ba0339
|
@ -6,7 +6,7 @@ sequences system tools.deploy.backend tools.deploy.config
|
||||||
tools.deploy.config.editor assocs hashtables prettyprint
|
tools.deploy.config.editor assocs hashtables prettyprint
|
||||||
io.backend.unix cocoa io.encodings.utf8 io.backend
|
io.backend.unix cocoa io.encodings.utf8 io.backend
|
||||||
cocoa.application cocoa.classes cocoa.plists
|
cocoa.application cocoa.classes cocoa.plists
|
||||||
combinators ;
|
combinators vocabs.metadata vocabs.loader ;
|
||||||
IN: tools.deploy.macosx
|
IN: tools.deploy.macosx
|
||||||
|
|
||||||
: bundle-dir ( -- dir )
|
: bundle-dir ( -- dir )
|
||||||
|
@ -16,7 +16,7 @@ IN: tools.deploy.macosx
|
||||||
[ bundle-dir prepend-path swap ] keep
|
[ bundle-dir prepend-path swap ] keep
|
||||||
"Contents" prepend-path append-path copy-tree ;
|
"Contents" prepend-path append-path copy-tree ;
|
||||||
|
|
||||||
: app-plist ( executable bundle-name -- assoc )
|
: app-plist ( icon? executable bundle-name -- assoc )
|
||||||
[
|
[
|
||||||
"6.0" "CFBundleInfoDictionaryVersion" set
|
"6.0" "CFBundleInfoDictionaryVersion" set
|
||||||
"APPL" "CFBundlePackageType" set
|
"APPL" "CFBundlePackageType" set
|
||||||
|
@ -25,9 +25,11 @@ IN: tools.deploy.macosx
|
||||||
|
|
||||||
[ "CFBundleExecutable" set ]
|
[ "CFBundleExecutable" set ]
|
||||||
[ "org.factor." prepend "CFBundleIdentifier" set ] bi
|
[ "org.factor." prepend "CFBundleIdentifier" set ] bi
|
||||||
|
|
||||||
|
[ "Icon.icns" "CFBundleIconFile" set ] when
|
||||||
] H{ } make-assoc ;
|
] H{ } make-assoc ;
|
||||||
|
|
||||||
: create-app-plist ( executable bundle-name -- )
|
: create-app-plist ( icon? executable bundle-name -- )
|
||||||
[ app-plist ] keep
|
[ app-plist ] keep
|
||||||
"Contents/Info.plist" append-path
|
"Contents/Info.plist" append-path
|
||||||
write-plist ;
|
write-plist ;
|
||||||
|
@ -40,7 +42,13 @@ IN: tools.deploy.macosx
|
||||||
"Resources/English.lproj/MiniFactor.nib" copy-bundle-dir
|
"Resources/English.lproj/MiniFactor.nib" copy-bundle-dir
|
||||||
] [ drop ] if ;
|
] [ drop ] if ;
|
||||||
|
|
||||||
|
: copy-icns ( vocab bundle-name -- icon? )
|
||||||
|
swap dup vocab-mac-icon-path vocab-append-path dup exists?
|
||||||
|
[ swap "Contents/Resources/Icon.icns" append-path copy-file t ]
|
||||||
|
[ 2drop f ] if ;
|
||||||
|
|
||||||
: create-app-dir ( vocab bundle-name -- vm )
|
: create-app-dir ( vocab bundle-name -- vm )
|
||||||
|
{
|
||||||
[
|
[
|
||||||
nip {
|
nip {
|
||||||
[ copy-dll ]
|
[ copy-dll ]
|
||||||
|
@ -48,8 +56,10 @@ IN: tools.deploy.macosx
|
||||||
[ "Contents/Resources" append-path make-directories ]
|
[ "Contents/Resources" append-path make-directories ]
|
||||||
} cleave
|
} cleave
|
||||||
]
|
]
|
||||||
|
[ copy-icns ]
|
||||||
[ create-app-plist ]
|
[ create-app-plist ]
|
||||||
[ "Contents/MacOS/" append-path copy-vm ] 2tri
|
[ "Contents/MacOS/" append-path copy-vm ]
|
||||||
|
} 2cleave
|
||||||
dup OCT: 755 set-file-permissions ;
|
dup OCT: 755 set-file-permissions ;
|
||||||
|
|
||||||
: deploy.app-image ( vocab bundle-name -- str )
|
: deploy.app-image ( vocab bundle-name -- str )
|
||||||
|
|
|
@ -19,6 +19,12 @@ MEMO: vocab-file-contents ( vocab name -- seq )
|
||||||
3append throw
|
3append throw
|
||||||
] ?if ;
|
] ?if ;
|
||||||
|
|
||||||
|
: vocab-windows-icon-path ( vocab -- string )
|
||||||
|
vocab-dir "icon.ico" append-path ;
|
||||||
|
|
||||||
|
: vocab-mac-icon-path ( vocab -- string )
|
||||||
|
vocab-dir "icon.icns" append-path ;
|
||||||
|
|
||||||
: vocab-resources-path ( vocab -- string )
|
: vocab-resources-path ( vocab -- string )
|
||||||
vocab-dir "resources.txt" append-path ;
|
vocab-dir "resources.txt" append-path ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue