mwaylabs / Espresso

The-M-Projects build tools using node.js.
www.the-m-project.org
Other
84 stars 28 forks source link

plutil throws "Unknown format specifier: json" #89

Closed siamak-haschemi closed 11 months ago

siamak-haschemi commented 12 years ago

Using the detox branch, I created a HelloWorld project with the following config.json:

{
    "name" : "MProjectHelloWorld",
    "mode": "debug",
    "debugLevel": 1,
    "eliminate": false,
    "minify": false,
    "proxies": [
        {
            "baseUrl": "http://your.server.com",
            "proxyAlias": "myServer"
        },
        {
            "baseUrl": "http://your.server2.com",
            "proxyAlias": "myServer2"
        }
    ],
    "htmlHeader": [
        "",
        "",
        "",
        "",
        "",
        ""
    ],
    "application": {
        "version": "0.0.1",
        "debugMode": true,
        "useTransitions": true,
        "keyPrefix": "#m#",
        "keySuffix": "_",
        "timeStampCreated": "created_at",
        "timeStampUpdated": "updated_at",
        "m_id": "m_id"
    },
   "package":{        
        "ios-sim": {
            "method": "PhoneGap",
            "os": "iOS",
            "sdk": "iphonesimulator4.3",
            "mode": "debug",
            "plists": {
                "PhoneGap": {
                    "ExternalHosts": ["*"]
                }
            },
            "autoScaleIcon": true
        }
    }
}

Running the espresso build (using espresso package run ios-sim) gives me:

Warning: dropping plists because typeof is neither string nor boolean.
+ export build_dir=/Users/siamakhaschemi/Development/src/MProjectHelloWorld/build/1337518765642
+ build_dir=/Users/siamakhaschemi/Development/src/MProjectHelloWorld/build/1337518765642
+ export sdk=iphonesimulator4.3
+ sdk=iphonesimulator4.3
+ export activity=MyActivity
+ activity=MyActivity
+ export package=com.test.mypackage
+ package=com.test.mypackage
+ validate-activity
+ validate-package
+ validate-build_dir
+ validate-sdk iphonesimulator
++ mktemp -d /var/folders/R+/R+4dcmGVEVaq344BlYTdZE+++TI/-Tmp-//package-phonegap-iOS.XXXXXXXXXX
+ cd /var/folders/R+/R+4dcmGVEVaq344BlYTdZE+++TI/-Tmp-//package-phonegap-iOS.90oCAX3m55
+ trap 'cd '\''/Users/siamakhaschemi/Development/src/MProjectHelloWorld/build/1337518765642'\''; rm -fR '\''/var/folders/R+/R+4dcmGVEVaq344BlYTdZE+++TI/-Tmp-/package-phonegap-iOS.90oCAX3m55'\''' EXIT INT QUIT
+ ln -s /Users/siamakhaschemi/Development/src/MProjectHelloWorld/build/1337518765642 src
+ ln -s /Users/siamakhaschemi/Development/src/MProjectHelloWorld app
+ setup-project
+ cd /Users/siamakhaschemi/Development/src/Espresso/package/../submodules/github/4z3/callback-ios/
+ ./bin/create /var/folders/R+/R+4dcmGVEVaq344BlYTdZE+++TI/-Tmp-/package-phonegap-iOS.90oCAX3m55/iOS-project com.test.mypackage MyActivity
+ cd /var/folders/R+/R+4dcmGVEVaq344BlYTdZE+++TI/-Tmp-/package-phonegap-iOS.90oCAX3m55
+ rm -fR iOS-project/www
+ mkdir iOS-project/www
++ find /Users/siamakhaschemi/Development/src/Espresso/package/../submodules/github/4z3/callback-ios/bin/templates/project/www
++ grep '.*/phonegap[^/]*\.js$'
+ phonegap_js=/Users/siamakhaschemi/Development/src/Espresso/package/../submodules/github/4z3/callback-ios/bin/templates/project/www/phonegap-1.0.0.js
+ cp /Users/siamakhaschemi/Development/src/Espresso/package/../submodules/github/4z3/callback-ios/bin/templates/project/www/phonegap-1.0.0.js iOS-project/www/phonegap.js
+ cp -R src/MProjectHelloWorld_App.js src/bootstrap.js src/cache.manifest src/core.js src/d8-0.2.0.min.js src/index.html src/jquery-1.7.1.min.js src/jquery_mobile.js src/jquery_mobile_plugins.js src/package.log src/theme src/ui.js src/underscore-min.js iOS-project/www
+ rm -f iOS-project/www/config.json
+ rm -f 'iOS-project/www/*.ipa'
+ rm -f iOS-project/www/package.log
+ setup-icons
+ /usr/libexec/PlistBuddy -x -c 'Delete :CFBundleIconFiles' iOS-project/MyActivity/MyActivity-info.plist
+ /usr/libexec/PlistBuddy -x -c 'Add :CFBundleIconFiles array' iOS-project/MyActivity/MyActivity-info.plist
+ read px name
+ test -e src/theme/images/appicon-57.png
+ test true = true
+ test -e src/theme/images/appicon.png
+ convert src/theme/images/appicon.png -resize 57x57 iOS-project/MyActivity/Resources/icons/icon.png
+ /usr/libexec/PlistBuddy -x -c 'Add :CFBundleIconFiles: string icon.png' iOS-project/MyActivity/MyActivity-info.plist
+ read px name
+ test -e src/theme/images/appicon-114.png
+ test true = true
+ test -e src/theme/images/appicon.png
+ convert src/theme/images/appicon.png -resize 114x114 iOS-project/MyActivity/Resources/icons/icon@2x.png
+ /usr/libexec/PlistBuddy -x -c 'Add :CFBundleIconFiles: string icon@2x.png' iOS-project/MyActivity/MyActivity-info.plist
+ read px name
+ test -e src/theme/images/appicon-72.png
+ test true = true
+ test -e src/theme/images/appicon.png
+ convert src/theme/images/appicon.png -resize 72x72 iOS-project/MyActivity/Resources/icons/icon-72.png
+ /usr/libexec/PlistBuddy -x -c 'Add :CFBundleIconFiles: string icon-72.png' iOS-project/MyActivity/MyActivity-info.plist
+ read px name
+ test -e src/theme/images/appicon-29.png
+ test true = true
+ test -e src/theme/images/appicon.png
+ convert src/theme/images/appicon.png -resize 29x29 iOS-project/MyActivity/Resources/icons/icon-Small.png
+ /usr/libexec/PlistBuddy -x -c 'Add :CFBundleIconFiles: string icon-Small.png' iOS-project/MyActivity/MyActivity-info.plist
+ read px name
+ test -e src/theme/images/appicon-50.png
+ test true = true
+ test -e src/theme/images/appicon.png
+ convert src/theme/images/appicon.png -resize 50x50 iOS-project/MyActivity/Resources/icons/icon-Small-50.png
+ /usr/libexec/PlistBuddy -x -c 'Add :CFBundleIconFiles: string icon-Small-50.png' iOS-project/MyActivity/MyActivity-info.plist
+ read px name
+ test -e src/theme/images/appicon-58.png
+ test true = true
+ test -e src/theme/images/appicon.png
+ convert src/theme/images/appicon.png -resize 58x58 iOS-project/MyActivity/Resources/icons/icon-Small@2x.png
+ /usr/libexec/PlistBuddy -x -c 'Add :CFBundleIconFiles: string icon-Small@2x.png' iOS-project/MyActivity/MyActivity-info.plist
+ read px name
+ setup-splash
+ test -e src/theme/images/splash.png
+ test -e src/theme/images/splash@2x.png
+ read orientation
+ test -e src/theme/images/splash-Portrait.png
+ read orientation
+ test -e src/theme/images/splash-PortraitUpsideDown.png
+ read orientation
+ test -e src/theme/images/splash-Landscape.png
+ read orientation
+ test -e src/theme/images/splash-LandscapeLeft.png
+ read orientation
+ test -e src/theme/images/splash-LandscapeRight.png
+ read orientation
+ gsedi iOS-project/www/index.html '
  s|\(\
\
\2|
  }
'
+ add-plugins
+ pbxproj_plist=iOS-project/MyActivity.xcodeproj/project.pbxproj
+ pbxproj_json=iOS-project/MyActivity.xcodeproj/project.pbxproj.json
+ plutil -convert json iOS-project/MyActivity.xcodeproj/project.pbxproj -o iOS-project/MyActivity.xcodeproj/project.pbxproj.json
Unknown format specifier: json
plutil: [command_option] [other_options] file...
The file '-' means stdin
Command options are (-lint is the default):
 -help      show this message and exit
 -lint      check the property list files for syntax errors
 -convert fmt   rewrite property list files in format
        fmt is one of: xml1 binary1
There are some additional optional arguments:
 -s     be silent on success
 -o path    specify alternate file path name for result;
        the -o option is used with -convert, and is only
        useful with one file argument (last file overwrites);
        the path '-' means stdout
 -e extension   specify alternate extension for converted files
 --     specifies that all further arguments are file names
+ cd /Users/siamakhaschemi/Development/src/MProjectHelloWorld/build/1337518765642
+ rm -fR /var/folders/R+/R+4dcmGVEVaq344BlYTdZE+++TI/-Tmp-/package-phonegap-iOS.90oCAX3m55

This might be a reference: https://github.com/keithpitt/vendor/issues/9

My System Info:

Mac OSX X Version 10.6.8 (Snow Leopard) Build 10K549

4z3 commented 12 years ago

It seems like Snow Leopard doesn't support the json format. According to http://cap-lore.com/CapTheory/Entitlements/man_plutil.html OS X 10.7 seems to support it.

IMO we've got two options... either we support only OS X 10.7 and higher, or we go the plist->xml->json path as mentioned in your reference.

Unfortunately I cannot fix the issue at the moment, as I have no access to an OS X development environment.

siamak-haschemi commented 12 years ago

Upgrading to OSX 10.7 might be an option for me, but we are in the middle of several projects ... to risky :-)

I can test your approach and give feedback, if you want.

sebastianwerler commented 12 years ago

We should also support Mac OS X 10.6 in my opinion. Still too many developers are on Snow Leopard, for good reasons. The reference shows a possible way.

dominiklaubach commented 12 years ago

Ok, I think we should try to fix this to not exclude developers that (for whatever reason) didn't update their system.

siamak-haschemi commented 12 years ago

Sorry, I just updated to Lion and cannot serve for testing.

sebastianwerler commented 12 years ago

No Problem, got another machine running snow leopard. we can test on this one!