diff --git a/.buckconfig b/.buckconfig deleted file mode 100644 index 821cb2c82..000000000 --- a/.buckconfig +++ /dev/null @@ -1,22 +0,0 @@ -[cxx] - default_platform = iphonesimulator-x86_64 - combined_preprocess_and_compile = true - -[apple] - iphonesimulator_target_sdk_version = 8.0 - iphoneos_target_sdk_version = 8.0 - xctool_default_destination_specifier = platform=iOS Simulator, name=iPhone 6, OS=10.2 - -[alias] - lib = //:AsyncDisplayKit - tests = //:Tests - -[httpserver] - port = 8080 - -[project] - ide = xcode - ignore = .buckd, \ - .hg, \ - .git, \ - buck-out, \ diff --git a/.buckversion b/.buckversion deleted file mode 100644 index 437aedac0..000000000 --- a/.buckversion +++ /dev/null @@ -1 +0,0 @@ -f399f484bf13b47bcc2bf0f2e092ab5d8de9f6e6 diff --git a/.gitignore b/.gitignore index 93c83ce98..b678ebdd4 100644 --- a/.gitignore +++ b/.gitignore @@ -27,11 +27,6 @@ build timeline.xctimeline playground.xcworkspace -# Buck -/buck-out -/.buckconfig.local -/.buckd - # Carthage Carthage/Checkouts Carthage/Build diff --git a/BUCK b/BUCK deleted file mode 100755 index 9a3ad37a7..000000000 --- a/BUCK +++ /dev/null @@ -1,194 +0,0 @@ -##################################### -# Defines -##################################### -COMMON_PREPROCESSOR_FLAGS = [ - '-fobjc-arc', - '-DDEBUG=1', - '-fno-exceptions', - '-fno-objc-arc-exceptions' -] - -COMMON_LANG_PREPROCESSOR_FLAGS = { - 'C': ['-std=gnu99'], - 'CXX': ['-std=c++11', '-stdlib=libc++'], - 'OBJCXX': ['-std=c++11', '-stdlib=libc++'], -} - -COMMON_LINKER_FLAGS = ['-ObjC++'] - -ASYNCDISPLAYKIT_EXPORTED_HEADERS = glob([ - 'Source/*.h', - 'Source/Details/**/*.h', - 'Source/Layout/*.h', - 'Source/Base/*.h', - 'Source/Debug/AsyncDisplayKit+Debug.h', - # Most TextKit components are not public because the C++ content - # in the headers will cause build errors when using - # `use_frameworks!` on 0.39.0 & Swift 2.1. - # See https://github.com/facebook/AsyncDisplayKit/issues/1153 - 'Source/TextKit/ASTextNodeTypes.h', - 'Source/TextKit/ASTextKitComponents.h' -]) - -ASYNCDISPLAYKIT_PRIVATE_HEADERS = glob([ - 'Source/**/*.h' - ], - excludes = ASYNCDISPLAYKIT_EXPORTED_HEADERS, -) - -def asyncdisplaykit_library( - name, - additional_preprocessor_flags = [], - deps = [], - additional_frameworks = []): - - apple_library( - name = name, - prefix_header = 'Source/AsyncDisplayKit-Prefix.pch', - header_path_prefix = 'AsyncDisplayKit', - exported_headers = ASYNCDISPLAYKIT_EXPORTED_HEADERS, - headers = ASYNCDISPLAYKIT_PRIVATE_HEADERS, - srcs = glob([ - 'Source/**/*.m', - 'Source/**/*.mm', - 'Source/Base/*.m' - ]), - preprocessor_flags = COMMON_PREPROCESSOR_FLAGS + additional_preprocessor_flags, - lang_preprocessor_flags = COMMON_LANG_PREPROCESSOR_FLAGS, - linker_flags = COMMON_LINKER_FLAGS + [ - '-weak_framework', - 'Photos', - '-weak_framework', - 'MapKit', - ], - deps = deps, - frameworks = [ - '$SDKROOT/System/Library/Frameworks/Foundation.framework', - '$SDKROOT/System/Library/Frameworks/UIKit.framework', - - '$SDKROOT/System/Library/Frameworks/QuartzCore.framework', - '$SDKROOT/System/Library/Frameworks/CoreMedia.framework', - '$SDKROOT/System/Library/Frameworks/CoreText.framework', - '$SDKROOT/System/Library/Frameworks/CoreGraphics.framework', - '$SDKROOT/System/Library/Frameworks/CoreLocation.framework', - '$SDKROOT/System/Library/Frameworks/AVFoundation.framework', - - # TODO somehow AssetsLibrary can't be weak_framework - '$SDKROOT/System/Library/Frameworks/AssetsLibrary.framework', - ] + additional_frameworks, - visibility = ['PUBLIC'], - ) - -##################################### -# AsyncDisplayKit targets -##################################### -asyncdisplaykit_library( - name = 'AsyncDisplayKit-Core', -) - -# (Default) AsyncDisplayKit and AsyncDisplayKit-PINRemoteImage targets are basically the same library with different names -for name in ['AsyncDisplayKit', 'AsyncDisplayKit-PINRemoteImage']: - asyncdisplaykit_library( - name = name, - deps = [ - '//Pods/PINRemoteImage:PINRemoteImage-PINCache', - ], - additional_frameworks = [ - '$SDKROOT/System/Library/Frameworks/MobileCoreServices.framework', - ] - ) - -##################################### -# Test Host -# TODO: Split to smaller BUCK files and parse in parallel -##################################### -apple_resource( - name = 'TestHostResources', - files = ['Tests/TestHost/Default-568h@2x.png'], - dirs = [], - ) - -apple_bundle( - name = 'TestHost', - binary = ':TestHostBinary', - extension = 'app', - info_plist = 'Tests/TestHost/Info.plist', - info_plist_substitutions = { - 'PRODUCT_BUNDLE_IDENTIFIER': 'com.facebook.AsyncDisplayKitTestHost', - }, - tests = [':Tests'], -) - -apple_binary( - name = 'TestHostBinary', - headers = glob(['Tests/TestHost/*.h']), - srcs = glob(['Tests/TestHost/*.m']), - lang_preprocessor_flags = COMMON_LANG_PREPROCESSOR_FLAGS, - linker_flags = COMMON_LINKER_FLAGS, - deps = [ - ':TestHostResources', - ':AsyncDisplayKit-Core', - ], - frameworks = [ - '$SDKROOT/System/Library/Frameworks/Photos.framework', - '$SDKROOT/System/Library/Frameworks/MapKit.framework', - ], -) - -apple_package( - name = 'TestHostPackage', - bundle = ':TestHost', -) - -##################################### -# Tests -##################################### -apple_resource( - name = 'TestsResources', - files = ['Tests/en.lproj/InfoPlist.strings'], - dirs = ['Tests/TestResources'], -) - -apple_test( - name = 'Tests', - test_host_app = ':TestHost', - info_plist = 'Tests/AsyncDisplayKitTests-Info.plist', - info_plist_substitutions = { - 'PRODUCT_BUNDLE_IDENTIFIER': 'com.facebook.AsyncDisplayKitTests', - }, - prefix_header = 'Tests/AsyncDisplayKitTests-Prefix.pch', - header_path_prefix = 'AsyncDisplayKit', - # Expose all ASDK headers to tests - headers = ASYNCDISPLAYKIT_EXPORTED_HEADERS + ASYNCDISPLAYKIT_PRIVATE_HEADERS + glob(['Tests/*.h']), - srcs = glob([ - 'Tests/*.m', - 'Tests/*.mm' - ], - # ASTextNodePerformanceTests are excluded (#2173) - excludes = ['Tests/ASTextNodePerformanceTests.m*'] - ), - snapshot_reference_images_path='Tests/ReferenceImages', - preprocessor_flags = COMMON_PREPROCESSOR_FLAGS + [ - '-Wno-implicit-function-declaration', - '-Wno-deprecated-declarations', - ], - lang_preprocessor_flags = COMMON_LANG_PREPROCESSOR_FLAGS, - linker_flags = COMMON_LINKER_FLAGS, - deps = [ - ':TestsResources', - '//Pods/OCMock:OCMock', - '//Pods/FBSnapshotTestCase:FBSnapshotTestCase', - '//Pods/JGMethodSwizzler:JGMethodSwizzler', - ], - frameworks = [ - '$SDKROOT/System/Library/Frameworks/Foundation.framework', - '$SDKROOT/System/Library/Frameworks/UIKit.framework', - - '$SDKROOT/System/Library/Frameworks/CoreMedia.framework', - '$SDKROOT/System/Library/Frameworks/CoreText.framework', - '$SDKROOT/System/Library/Frameworks/CoreGraphics.framework', - '$SDKROOT/System/Library/Frameworks/AVFoundation.framework', - - '$PLATFORM_DIR/Developer/Library/Frameworks/XCTest.framework', - ], -) diff --git a/Podfile b/Podfile index 98479737e..e21de4288 100644 --- a/Podfile +++ b/Podfile @@ -6,26 +6,4 @@ target :'AsyncDisplayKitTests' do pod 'OCMock', '=3.4.1' # 3.4.2 currently has issues. pod 'FBSnapshotTestCase/Core', '~> 2.1' pod 'JGMethodSwizzler', :git => 'https://github.com/JonasGessner/JGMethodSwizzler', :branch => 'master' - - # Only for buck build - pod 'PINRemoteImage', '3.0.0-beta.14' -end - -#TODO CocoaPods plugin instead? -post_install do |installer| - require 'fileutils' - - # Assuming we're at the root dir - buck_files_dir = 'buck-files' - if File.directory?(buck_files_dir) - installer.pod_targets.flat_map do |pod_target| - pod_name = pod_target.pod_name - # Copy the file at buck-files/BUCK_pod_name to Pods/pod_name/BUCK, - # override existing file if needed - buck_file = buck_files_dir + '/BUCK_' + pod_name - if File.file?(buck_file) - FileUtils.cp(buck_file, 'Pods/' + pod_name + '/BUCK', :preserve => false) - end - end - end end diff --git a/buck-files/BUCK_FBSnapshotTestCase b/buck-files/BUCK_FBSnapshotTestCase deleted file mode 100755 index c8b969639..000000000 --- a/buck-files/BUCK_FBSnapshotTestCase +++ /dev/null @@ -1,12 +0,0 @@ -apple_library( - name = 'FBSnapshotTestCase', - exported_headers = glob(['FBSnapshotTestCase' + '/**/*.h']), - srcs = glob(['FBSnapshotTestCase' + '/**/*.m']), - frameworks = [ - '$SDKROOT/System/Library/Frameworks/Foundation.framework', - '$SDKROOT/System/Library/Frameworks/UIKit.framework', - '$SDKROOT/System/Library/Frameworks/QuartzCore.framework', - '$PLATFORM_DIR/Developer/Library/Frameworks/XCTest.framework', - ], - visibility = ['PUBLIC'], -) diff --git a/buck-files/BUCK_FLAnimatedImage b/buck-files/BUCK_FLAnimatedImage deleted file mode 100755 index f04abd396..000000000 --- a/buck-files/BUCK_FLAnimatedImage +++ /dev/null @@ -1,18 +0,0 @@ -apple_library( - name = 'FLAnimatedImage', - exported_headers = glob(['FLAnimatedImage/*.h']), - srcs = glob(['FLAnimatedImage/*.m']), - preprocessor_flags = ['-fobjc-arc', '-Wno-deprecated-declarations'], - lang_preprocessor_flags = { - 'C': ['-std=gnu99'], - 'CXX': ['-std=gnu++11', '-stdlib=libc++'], - }, - frameworks = [ - '$SDKROOT/System/Library/Frameworks/Foundation.framework', - '$SDKROOT/System/Library/Frameworks/UIKit.framework', - '$SDKROOT/System/Library/Frameworks/ImageIO.framework', - '$SDKROOT/System/Library/Frameworks/MobileCoreServices.framework', - '$SDKROOT/System/Library/Frameworks/QuartzCore.framework', - ], - visibility = ['PUBLIC'], -) diff --git a/buck-files/BUCK_JGMethodSwizzler b/buck-files/BUCK_JGMethodSwizzler deleted file mode 100755 index 169cfa1e0..000000000 --- a/buck-files/BUCK_JGMethodSwizzler +++ /dev/null @@ -1,9 +0,0 @@ -apple_library( - name = 'JGMethodSwizzler', - exported_headers = ['JGMethodSwizzler' + '/JGMethodSwizzler.h'], - srcs = ['JGMethodSwizzler' + '/JGMethodSwizzler.m'], - frameworks = [ - '$SDKROOT/System/Library/Frameworks/Foundation.framework', - ], - visibility = ['PUBLIC'], -) diff --git a/buck-files/BUCK_OCMock b/buck-files/BUCK_OCMock deleted file mode 100755 index 666f84458..000000000 --- a/buck-files/BUCK_OCMock +++ /dev/null @@ -1,9 +0,0 @@ -apple_library( - name = 'OCMock', - exported_headers = glob(['Source/OCMock' + '/*.h']), - srcs = glob(['Source/OCMock' + '/*.m']), - frameworks = [ - '$SDKROOT/System/Library/Frameworks/Foundation.framework', - ], - visibility = ['PUBLIC'], -) diff --git a/buck-files/BUCK_PINCache b/buck-files/BUCK_PINCache deleted file mode 100755 index 660b69f71..000000000 --- a/buck-files/BUCK_PINCache +++ /dev/null @@ -1,23 +0,0 @@ -apple_library( - name = 'PINCache', - exported_headers = glob(['PINCache/*.h']), - # PINDiskCache.m should be compiled with '-fobjc-arc-exceptions' (#105) - srcs = - glob(['PINCache/*.m'], excludes = ['PINCache/PINDiskCache.m']) + - [('PINCache/PINDiskCache.m', ['-fobjc-arc-exceptions'])], - preprocessor_flags = ['-fobjc-arc'], - lang_preprocessor_flags = { - 'C': ['-std=gnu99'], - 'CXX': ['-std=gnu++11', '-stdlib=libc++'], - }, - linker_flags = [ - '-weak_framework', - 'UIKit', - '-weak_framework', - 'AppKit', - ], - frameworks = [ - '$SDKROOT/System/Library/Frameworks/Foundation.framework', - ], - visibility = ['PUBLIC'], -) diff --git a/buck-files/BUCK_PINRemoteImage b/buck-files/BUCK_PINRemoteImage deleted file mode 100755 index 95825e4d9..000000000 --- a/buck-files/BUCK_PINRemoteImage +++ /dev/null @@ -1,93 +0,0 @@ -##################################### -# Defines -##################################### -COMMON_PREPROCESSOR_FLAGS = ['-fobjc-arc'] - -COMMON_LANG_PREPROCESSOR_FLAGS = { - 'C': ['-std=gnu99'], - 'CXX': ['-std=gnu++11', '-stdlib=libc++'], -} - -FLANIMATEDIMAGE_HEADER_FILES = ['Pod/Classes/Image Categories/FLAnimatedImageView+PINRemoteImage.h'] -FLANIMATEDIMAGE_SOURCE_FILES = ['Pod/Classes/Image Categories/FLAnimatedImageView+PINRemoteImage.m'] - -PINCACHE_HEADER_FILES = glob(['Pod/Classes/PINCache/**/*.h']) -PINCACHE_SOURCE_FILES = glob(['Pod/Classes/PINCache/**/*.m']) - -##################################### -# PINRemoteImage core targets -##################################### -apple_library( - name = 'PINRemoteImage-Core', - header_path_prefix = 'PINRemoteImage', - exported_headers = glob([ - 'Pod/Classes/**/*.h', - ], - excludes = FLANIMATEDIMAGE_HEADER_FILES + PINCACHE_HEADER_FILES - ), - srcs = glob([ - 'Pod/Classes/**/*.m', - ], - excludes = FLANIMATEDIMAGE_SOURCE_FILES + PINCACHE_SOURCE_FILES - ), - preprocessor_flags = COMMON_PREPROCESSOR_FLAGS + [ - '-DPIN_TARGET_IOS=(TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR || TARGET_OS_TV)', - '-DPIN_TARGET_MAC=(TARGET_OS_MAC)', - ], - lang_preprocessor_flags = COMMON_LANG_PREPROCESSOR_FLAGS, - linker_flags = [ - '-weak_framework', - 'UIKit', - '-weak_framework', - 'MobileCoreServices', - '-weak_framework', - 'Cocoa', - '-weak_framework', - 'CoreServices', - ], - frameworks = [ - '$SDKROOT/System/Library/Frameworks/ImageIO.framework', - '$SDKROOT/System/Library/Frameworks/Accelerate.framework', - ], - visibility = ['PUBLIC'], -) - -apple_library( - name = 'PINRemoteImage', - deps = [ - ':PINRemoteImage-FLAnimatedImage', - ':PINRemoteImage-PINCache' - ], - visibility = ['PUBLIC'], -) - -##################################### -# Other PINRemoteImage targets -##################################### -apple_library( - name = 'PINRemoteImage-FLAnimatedImage', - header_path_prefix = 'PINRemoteImage', - exported_headers = FLANIMATEDIMAGE_HEADER_FILES, - srcs = FLANIMATEDIMAGE_SOURCE_FILES, - preprocessor_flags = COMMON_PREPROCESSOR_FLAGS, - deps = [ - ':PINRemoteImage-Core', - '//Pods/FLAnimatedImage:FLAnimatedImage' - ], - visibility = ['PUBLIC'], -) - -apple_library( - name = 'PINRemoteImage-PINCache', - header_path_prefix = 'PINRemoteImage', - exported_headers = PINCACHE_HEADER_FILES, - srcs = PINCACHE_SOURCE_FILES, - preprocessor_flags = COMMON_PREPROCESSOR_FLAGS, - deps = [ - ':PINRemoteImage-Core', - '//Pods/PINCache:PINCache' - ], - visibility = ['PUBLIC'], -) - -#TODO WebP variants