diff --git a/submodules/AsyncDisplayKit/BUILD b/submodules/AsyncDisplayKit/BUILD index 0a335db311..725364d30b 100644 --- a/submodules/AsyncDisplayKit/BUILD +++ b/submodules/AsyncDisplayKit/BUILD @@ -7,14 +7,39 @@ ASYNCDISPLAYKIT_EXPORTED_HEADERS = glob([ "Source/Debug/AsyncDisplayKit+Debug.h", "Source/TextKit/ASTextNodeTypes.h", "Source/TextKit/ASTextKitComponents.h" -]) +], exclude = ["Source/AsyncDisplayKit.h"]) ASYNCDISPLAYKIT_PRIVATE_HEADERS = glob([ "Source/**/*.h" ], - exclude = ASYNCDISPLAYKIT_EXPORTED_HEADERS, + exclude = ASYNCDISPLAYKIT_EXPORTED_HEADERS + ["Source/AsyncDisplayKit.h"], ) +exported_headers_rule_name = "AsyncDisplayKit_ExportedHeaders" +private_headers_rule_name = "AsyncDisplayKit_PrivateHeaders" +exported_headers_path = "includedir" +private_headers_path = "privateincludedir" +name = "AsyncDisplayKit" +headers = ASYNCDISPLAYKIT_EXPORTED_HEADERS + +genrule( + name = exported_headers_rule_name, + srcs = headers, + # Headers can be nested multiple levels, so we use `x.split('/')[::-1][0] for x in headers` to get their basenames + outs = [exported_headers_path + "/" + name + "/" + x.split('/')[::-1][0] for x in headers], + # Finally we copy all headers to the `exported_headers_path` directory + cmd = "cp $(SRCS) $(RULEDIR)" + "/" + exported_headers_path + "/" + name, +) +exported_headers = [":" + exported_headers_rule_name] + +genrule( + name = private_headers_rule_name, + srcs = ASYNCDISPLAYKIT_PRIVATE_HEADERS, + outs = [private_headers_path + "/" + name + "/" + x.split('/')[::-1][0] for x in ASYNCDISPLAYKIT_PRIVATE_HEADERS], + cmd = "cp $(SRCS) $(RULEDIR)" + "/" + private_headers_path + "/" + name, +) +private_headers = [":" + private_headers_rule_name] + objc_library( name = "AsyncDisplayKit", enable_modules = True, @@ -23,11 +48,18 @@ objc_library( "Source/**/*.m", "Source/**/*.mm", "Source/Base/*.m", - ]) + ASYNCDISPLAYKIT_PRIVATE_HEADERS, - hdrs = ASYNCDISPLAYKIT_EXPORTED_HEADERS, + ]) + private_headers, + hdrs = exported_headers, defines = [ "MINIMAL_ASDK", ], + copts = [ + #"-I$(locations :AsyncDisplayKit_PrivateHeaders)", + ], + includes = [ + exported_headers_path, + private_headers_path, + ], sdk_frameworks = [ "QuartzCore", "CoreMedia", diff --git a/submodules/AsyncDisplayKit/Source/ASButtonNode+Yoga.mm b/submodules/AsyncDisplayKit/Source/ASButtonNode+Yoga.mm index 4666475560..0b96f07264 100644 --- a/submodules/AsyncDisplayKit/Source/ASButtonNode+Yoga.mm +++ b/submodules/AsyncDisplayKit/Source/ASButtonNode+Yoga.mm @@ -6,7 +6,7 @@ // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // -#import +#import "AsyncDisplayKit/ASAvailability.h" #import "ASButtonNode+Yoga.h" #import #import diff --git a/submodules/AsyncDisplayKit/Source/Private/ASInternalHelpers.h b/submodules/AsyncDisplayKit/Source/Private/ASInternalHelpers.h index 8bc53fa0e6..22391b1b2f 100644 --- a/submodules/AsyncDisplayKit/Source/Private/ASInternalHelpers.h +++ b/submodules/AsyncDisplayKit/Source/Private/ASInternalHelpers.h @@ -7,7 +7,7 @@ // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // -#import "ASAvailability.h" +#import #import diff --git a/submodules/AsyncDisplayKit/Source/Private/ASTip.mm b/submodules/AsyncDisplayKit/Source/Private/ASTip.mm index af1d299221..bfabd5e1e7 100644 --- a/submodules/AsyncDisplayKit/Source/Private/ASTip.mm +++ b/submodules/AsyncDisplayKit/Source/Private/ASTip.mm @@ -7,10 +7,10 @@ // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // -#import - #if AS_ENABLE_TIPS +#import + #import @implementation ASTip