Commit Graph

996 Commits

Author SHA1 Message Date
Grant Paul
a102907642 Update Travis to a more recent macOS image. 2017-01-05 09:07:49 -08:00
Grant Paul
41cb9abd79 Various fixes and additions to PlistBuddy.
- Fix `Exit` command in PlistBuddy to actually exit.
 - Fix `Key:` syntax in PlistBuddy to append to arrays.
 - Fix `Set Key:0` syntax in PlistBuddy to overwrite, not insert.
 - Fix PlistBuddy to correctly initialize new property lists: only
   write to disk on `Save` and start out with a dictionary.
 - Fix crashes with out-of-bounds array indexes in PlistBuddy.
 - Add `Import`, `Copy`, and `Revert` commands to PlistBuddy.
2016-12-14 17:01:15 -08:00
Grant Paul
1f66407788 Don't continue the build if target environment creation fails.
If target environment creation fails, this indicates a serious error
in the build environment. Continuing is likely to end up printing
success despite the build not finishing as expected.
2016-12-14 17:01:15 -08:00
Grant Paul
f609fb944d Avoid returning a default SDK for a platform with no SDKs.
This would crash if a platform name matched, but it had no SDKs.
2016-12-14 17:01:15 -08:00
Grant Paul
b55e87094e Fix rendition serialization to be operating system independent.
When creating a gzip header, zlib adds the current operating system
to one of the fields. Overwrite that with zero to avoid creating
different serializations on different operating systems.
2016-12-14 17:01:15 -08:00
Grant Paul
674da37461 Explicitly reference contents of the current namespace. 2016-12-14 17:01:15 -08:00
Grant Paul
2f87e85363 Correct casts and pointer arithmetic.
Do pointer arithmetic only happen on typed pointers or integer
representations of pointers, not void pointers. Cast integer and
floating point types explicitly when reducing precision.
2016-12-14 17:01:15 -08:00
Grant Paul
133e407ed6 Make compiler attributes more portable. 2016-12-14 17:01:15 -08:00
Grant Paul
73159fa205 Avoid incorrect third parameter for command-line option parsing.
The current option functions don't take an iterator, but do take
an option for supporting duplicate options. Don't pass an iterator
as a boolean.
2016-12-14 17:01:15 -08:00
Grant Paul
d28d8badc6 Perform filesystem path manipulation directly.
Avoids variable using operating system libraries for fixed operations.
2016-12-14 17:01:15 -08:00
Grant Paul
0341195435 Simplify binary property list reading and writing.
- Move from C-style interface to C++-style interface.
 - Remove unnecessary layers of indirection for reading and writing
   buffers. The context is always writing to a buffer, so does not
   need support for generalized input and output.
 - Remove unnecessary layers of indirection for creating and writing
   property list objects.
 - Update test to avoid relying on literal strings using a specific
   encoding. Instead, embed the encoded UTF-8 as a byte sequence.
2016-12-14 17:01:15 -08:00
Grant Paul
9fbec89b04 Use type rather than character contents for specification types.
Simplifies the code significantly and abstracts the type values.
2016-12-14 17:01:15 -08:00
Grant Paul
9df693c86e Include shared specification domains in platform domain list.
Shared domains can include relevant specifications for platforms
and should be searched as well as platform-specific domains.
2016-12-14 17:01:15 -08:00
Onha Choe
0e7eaa08f9 ignore non-directory path in dependency-info-tool 2016-12-12 14:42:53 -08:00
Onha Choe
44c0681afb fix recursive path searching 2016-12-10 01:20:58 -08:00
Grant Paul
2329c45373 Pass correct environment to tools.
- Include all necessary paths in tool search paths.
 - Set `PATH` to match the paths searched for tools.
 - Set `DEVELOPER_DIR` for all invocations to stay self-contained.
 - Pass along process environment to tools rather than clearing.
2016-12-08 20:14:52 -08:00
Onha Choe
80ebf67b1f ibtool storyboard linker xcspec typo fix 2016-12-08 20:14:14 -08:00
Onha Choe
4ad09cc710 add xcspecs for ibtool operations 2016-12-08 10:25:42 -08:00
Onha Choe
b9b6be30cb add include for stdlib.h for abort() 2016-12-08 10:23:40 -08:00
Martin Storsjö
be01a77afc Fix recursive createDirectory for relative paths
A path like "foo/bar/baz" will end up looking for a directory
named "" unless any of the earlier directories already exist.
2016-12-06 22:30:38 -08:00
Onha Choe
5b7615d197 deployment target version env name fix 2016-12-06 21:25:53 -08:00
Grant Paul
f5e6efbba7 Add support for printing specific information with version option.
Implements missing feature from #204.
2016-12-06 21:24:53 -08:00
Martin Storsjö
a869e6746f Resolve the dsymutil tool invocation in the right way
This fixes expanding OutputPath properly for dsymutil, fixing
issue #208.
2016-12-06 21:22:44 -08:00
Martin Storsjö
325247d927 Make fileNameDisambiguator optional in File::ResolveBuildFiles
Previously it was by default always set, but to an empty string.

This avoids having an empty outputBaseName later in ClangResolver,
which caused the output object files be named ".o" for all input
source files.
2016-12-04 20:26:03 -08:00
Grant Paul
bf3c57a44e Support short options in lsbom.
Short options can be combined and used as a single flag. For split
short options, the value can follow in a combined option or in the
next option.
2016-11-28 11:01:52 -08:00
Grant Paul
0dce61fb1b Rename unit test to match name of code being tested. 2016-11-19 02:42:10 -08:00
Grant Paul
ad15b53241 Separate auxiliary files from invocations.
Auxiliary files were attached to invocations but had no relation to
the containing invocation. Collect them separately from invocations.
2016-11-19 02:42:10 -08:00
Grant Paul
f5aad6f42a Separate tool resolution from remainder of build implementation.
- Pass in lower-level types rather than larger wrappers.
 - Make header imports (almost) entirely self-contained.
2016-11-19 02:42:10 -08:00
Grant Paul
9f6e29e627 Always pass in inputs as tool inputs, rather than path strings.
This allows for easily specifying additional information as available.
2016-11-19 02:42:10 -08:00
Grant Paul
dc9e6c725d Remove reference to project objects from tool input.
This allows the tool resolution to be isolated from the project.
2016-11-19 02:42:10 -08:00
Grant Paul
ead6234652 Move tool inputs alongside the rest of the tool code.
Removes the reverse dependency on the phase handling.
2016-11-19 02:42:10 -08:00
Grant Paul
1d20089aa3 Use optionals for potentially missing properties of resolved files. 2016-11-19 02:42:10 -08:00
Stephane Sezer
8d2b9879b7 Fix a typo (copy-paste error?) in xcrun 2016-11-18 00:31:35 -08:00
Matthew Bauer
f94aa30b75 Prevent infinite loop in createDirectory.
createDirectory entered an infinite loop breaking xcbuild.

TODO: add tests for DefaultFilesystem.cpp (only MemoryFilesystem right
now)
2016-11-18 00:31:26 -08:00
Grant Paul
71940e8445 Partially update asset catalog compiler specification and resolver.
Asset catalog compilation now uses a custom variable to pass inputs
to the specification, and a custom grouping method to group inputs.

Does not pass sticker pack translations to asset catalog compiler,
as this seems to require parsing the asset catalog just to determine
which strings files should be used. Left as a future task.
2016-11-17 16:24:58 -08:00
Grant Paul
edf7f0de6c Complete newly added specifications. 2016-11-17 16:23:54 -08:00
Grant Paul
1f9b3c2592 Support loading specifications from a directory symlink. 2016-11-16 11:36:08 -08:00
Grant Paul
88c9f2c55b Use filesystem additions to replace ad-hoc implementations.
This removes the last unsafe use of the process context and launcher
since it was only used to copy files and change file permissions.

Includes a unit test for the copy tool, now that it's self-contained.
2016-11-15 14:56:28 -08:00
Grant Paul
7de697533d Add support for reading and writing filesystem permissions. 2016-11-15 14:56:28 -08:00
Grant Paul
2dd92c6038 Switch to type check filesystem entry types.
Rather than checking booleans, switch on an enumeration.
2016-11-15 14:56:28 -08:00
Grant Paul
5dc60c8c3b Add additional filesystem functionality.
- Creating directories is optionally recursive.
 - Copy files, symlinks, and directories, optionally recursive.
 - Remove files, symlinks, and directories, optionally recursive.
 - Simplify directory traversal API, make recurively optional.
2016-11-15 14:56:28 -08:00
Grant Paul
0ab861abcc Support reading JSON (as well as writing) in property list utility.
Also, fix default output format when performing modifications without
conversion. It would always fail due to not having a target format.
2016-11-15 11:47:26 -08:00
Matthew Bauer
dc2bb1c379 Add more xcspecs.
Adds:

- com.apple.build-tools.nmedit
- com.apple.compilers.lex
- com.apple.compilers.resource-copier
- com.apple.compilers.yacc
2016-11-11 12:35:52 -08:00
Onha Choe
0e9140921a fix builtin pbxcp 2016-11-09 17:20:36 -08:00
Grant Paul
6b73b95757 Fix specification to pass in preprocessor defines. 2016-11-08 23:14:05 -08:00
Grant Paul
70b7e25b0e Add unit test for property list copy built-in utility.
Tests basic functionality of copying multiple property lists while
converting them to a standard format.
2016-11-07 15:55:41 -08:00
Grant Paul
b892b152e1 Improve JSON parsing to handle more edge cases.
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.
2016-11-07 14:32:19 -08:00
Grant Paul
3f4520da4b Fix builtin tool execution in simple executor. Add unit test.
The success check was inverted for builtin tools. The correct behavior
can be tested using a series of in-memory resource implementations.
2016-11-07 13:06:49 -08:00
Grant Paul
234c1761aa Add null output formatter to print no additional output.
This is useful for quiet builds or for unit tests of execution.
2016-11-07 13:06:49 -08:00
Matthew Justin Bauer
0095088227 Add copy-{tiff,png}-file.xcspec to CMakeFiles.txt 2016-11-07 11:33:14 -08:00