[ios] Moved SDK from gyp into Xcode project

Added a new Cocoa Touch dynamic framework target and Cocoa Touch static library target to the main iOS Xcode project. The targets are based on the templates provided by Xcode. They contain headers and source files in the darwin/ and ios/ subdirectories. Headers are explicitly marked public or project-internal instead of implicitly by subdirectory.

The SDK targets have a few dependencies that are managed by mason. Transform the config.gypi generated by configure into an .xcconfig file that Xcode uses to fill in compiler and linker flags.

Removed the iossdk target from platform.gypi and pared down the platform-lib target. make iproj opens the overall Xcode workspace instead of just the core project.

Resolved some warnings that are only now appearing because we’re using the standard warning and error flags instead of the pedantic and somewhat inappropriate flags that were forced by the gyp configuration files. Removed a console message informing developers of a long-ago deleted delegate method; the message was triggering a “selector not found” warning. Conditionalized some deprecated symbol usage that’s still needed for the static framework but not the dynamic framework, due to differing minimum deployment targets.

Added a build phase to the static library target that copies headers for use with the static library itself. This would allow us to potentially include a header in the dynamic framework but not the static library and vice-versa.

Updated the changelog to note that unused SVG files have been removed from the distribution.
This commit is contained in:
Minh Nguyễn
2016-04-10 22:23:14 -07:00
committed by Minh Nguyễn
parent 1549b2b249
commit b8c39667ff
15 changed files with 1091 additions and 188 deletions

20
scripts/export-xcconfig.py Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env python
import sys, ast, re
ILLEGAL_CHAR_RE = re.compile(r"\W")
def main():
with open(sys.argv[1], "r") as in_file, open(sys.argv[2], "w") as out_file:
config = ast.literal_eval(in_file.read())
variables = ["// Do not edit -- generated by export-xcconfig.py\n"]
assert(type(config) is dict)
assert(type(config["variables"]) is dict)
for variable, flags in config["variables"].iteritems():
variable = ILLEGAL_CHAR_RE.sub("_", variable.rstrip("%"))
flags = " ".join('"%s"' % flag for flag in flags)
variables.append("%s = %s\n" % (variable, flags))
out_file.writelines(variables)
if __name__ == '__main__':
main()

View File

@@ -79,6 +79,8 @@ Makefile/__project__: $(PLATFORM_CONFIG_OUTPUT)
.PHONY: Xcode/__project__
Xcode/__project__: $(PLATFORM_CONFIG_OUTPUT)
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Exporting gyp variables to xcconfig...$(FORMAT_END)\n"
$(ENV) ./scripts/export-xcconfig.py $(PLATFORM_CONFIG_OUTPUT) $(PLATFORM_OUTPUT)/mbgl.xcconfig
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Recreating project...$(FORMAT_END)\n"
$(ENV) deps/run_gyp platform/$(PLATFORM)/platform.gyp $(GYP_FLAGS) -f xcode$(GYP_FLAVOR_SUFFIX)