Using a JSON parser test suite, refine number and key parsing to match
the JSON specification. Remaining issues are related to Unicode support,
escape sequences, and trailing commas.
The last of those is intentionally non-conforming for compatibility.
Rather than looking at the filesystem to find an executable path at
configuration time, find the executable at execution time. This allows
different executors to handle searching for paths differently (for
example, using internal or external builtin tools), and avoids using
the filesystem during configuration.
- Complete strip and product validation specification options.
- Fix typo in specification property and file type listing.
- Minor formatting adjustments to a few specifications.
Before, each asset type handled loading assets independently. This
caused inconsistencies in when assets were loaded, and didn't handle
more complex asset linking scenarios correctly.
Instead, unconditionally load all child assets. When specific child
assets are needed, search for them within the loaded children rather
than on disk. Additionally, provide convenience APIs to reference
single-child assets in types that reference those.
A future enhancement will support asset types that contain specific
types of child assets but do not list the asset filenames explicitly
in other asset properties.
Asset catalogs form a tree, not a graph, so there is no requirement
for reference counting. Simplify the possibility space by removing
reference counting in favor of direct ownership of child assets.
The extra metadata section stores a string with contextual info
on how the asset archive was compiled, especially when the archive
is stripped to target certain devices or platforms.
Other new fields correspond to new asset document format fields.
- Warn about missing keys when parsing; add currently missing keys.
- Use optionals to avoid unsafely assuming parsed values always exist.
- Update style to match other libraries.
Summary: For each of the PlistBuddy subcommands, on false, return '1' exit code.
Test Plan:
Ran PlistBuddy -c "Print :BogusKeyThatDoesntExist" /tmp/app.plist
echo $? returns 1
Ran PlistBuddy -c "Print :CFBundleShortVersionString" /tmp/app.plist
echo $? returns 0
Using `__attribute__((constructor))` doesn't seem to get argc and argv
as arguments with certain versions of the libc. On the other hand, using
the `.init_array` section works so use that as a workaround until we can
find a cleaner fix.
h/t to @sas for this fix. This is a minimal fix for my problems when
using xcbuild tools on my Linux machine.
Fixes issue#138.
When build xcbuild with -NDEBUG, assert() is compiled out and, to the compiler,
the 'algorithm' variable has the potential to be uninitialized. Refactor the code
so it compiles cleanly.