]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/tools/deploy/macosx/macosx.factor
use radix literals
[factor.git] / basis / tools / deploy / macosx / macosx.factor
index c02642ba1d1c5db792d5e865a23108b472e656f4..98b3d2528a2b33dd204041ae1b9fb72470944959 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2007, 2009 Slava Pestov.
+! Copyright (C) 2007, 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: io io.files io.files.info.unix io.pathnames
 io.directories io.directories.hierarchy kernel namespaces make
@@ -10,11 +10,14 @@ combinators vocabs.metadata vocabs.loader ;
 IN: tools.deploy.macosx
 
 : bundle-dir ( -- dir )
-    vm parent-directory parent-directory ;
+    running.app?
+    [ vm parent-directory parent-directory ]
+    [ "resource:Factor.app" ]
+    if ;
 
 : copy-bundle-dir ( bundle-name dir -- )
     [ bundle-dir prepend-path swap ] keep
-    "Contents" prepend-path append-path copy-tree ;
+    append-path copy-tree ;
 
 : app-plist ( icon? executable bundle-name -- assoc )
     [
@@ -34,12 +37,9 @@ IN: tools.deploy.macosx
     "Contents/Info.plist" append-path
     write-plist ;
 
-: copy-dll ( bundle-name -- )
-    "Frameworks/libfactor.dylib" copy-bundle-dir ;
-
 : copy-nib ( bundle-name -- )
     deploy-ui? get [
-        "Resources/English.lproj/MiniFactor.nib" copy-bundle-dir
+        "Contents/Resources/English.lproj/MiniFactor.nib" copy-bundle-dir
     ] [ drop ] if ;
 
 : copy-icns ( vocab bundle-name -- icon? )
@@ -50,17 +50,16 @@ IN: tools.deploy.macosx
 : create-app-dir ( vocab bundle-name -- vm )
     {
         [
-            nip {
-                [ copy-dll ]
-                [ copy-nib ]
-                [ "Contents/Resources" append-path make-directories ]
-            } cleave
+            nip
+            [ copy-nib ]
+            [ "Contents/Resources" append-path make-directories ]
+            [ "Contents/Frameworks" append-path make-directories ] tri
         ]
         [ copy-icns ]
         [ create-app-plist ]
         [ "Contents/MacOS/" append-path copy-vm ]
     } 2cleave
-    dup OCT: 755 set-file-permissions ;
+    dup 0o755 set-file-permissions ;
 
 : deploy.app-image ( vocab bundle-name -- str )
     [ % "/Contents/Resources/" % % ".image" % ] "" make ;
@@ -74,7 +73,6 @@ IN: tools.deploy.macosx
     -> selectFile:inFileViewerRootedAtPath: drop ;
 
 M: macosx deploy* ( vocab -- )
-    ".app deploy tool" assert.app
     "resource:" [
         dup deploy-config [
             bundle-name dup exists? [ delete-tree ] [ drop ] if