{"id":19313830,"url":"https://github.com/geektree0101/iosbuckexample","last_synced_at":"2025-10-20T03:59:36.711Z","repository":{"id":141412616,"uuid":"162385256","full_name":"GeekTree0101/iOSBuckExample","owner":"GeekTree0101","description":"iOS Buckbuild example https://buckbuild.com/setup/getting_started.html","archived":false,"fork":false,"pushed_at":"2020-01-11T14:37:34.000Z","size":210,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-21T20:54:27.595Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GeekTree0101.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-12-19T05:02:57.000Z","updated_at":"2020-01-11T14:37:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"8431db3b-1b3a-46b1-b29a-3c85da85a2ce","html_url":"https://github.com/GeekTree0101/iOSBuckExample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GeekTree0101/iOSBuckExample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekTree0101%2FiOSBuckExample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekTree0101%2FiOSBuckExample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekTree0101%2FiOSBuckExample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekTree0101%2FiOSBuckExample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GeekTree0101","download_url":"https://codeload.github.com/GeekTree0101/iOSBuckExample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekTree0101%2FiOSBuckExample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272988919,"owners_count":25026961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T00:41:17.508Z","updated_at":"2025-10-20T03:59:31.666Z","avatar_url":"https://github.com/GeekTree0101.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iOS Buck Example\n\n- homepage: https://buckbuild.com/setup/getting_started.html\n- article: https://hackernoon.com/7-reasons-to-use-buck-build-5b44d7413585\n\n## Install\n\n```sh\nbrew tap facebook/fb\nbrew install buck\nbrew install ant python git watchman\npod install\n```\n\n\u003e Java 1.8\n```sh\nbrew cask install adoptopenjdk/openjdk/adoptopenjdk8\nexport JAVA_HOME=$(/usr/libexec/java_home -v 1.8)\n```\n\n[DEPRECATED] you don't needs more caskroom on brew\ncask is already integrated onto brew as default :]\n\n```sh\nbrew tap caskroom/cask\nbrew tap caskroom/versions\n```\n\n## Run\n\n```sh\nmake build\n```\n\n## How does it work? \n\n\u003e ## STEP1: install pod and file utility will deploy Pod Buck files from buck-files dir\n```ruby\nuse_frameworks!\n\ntarget 'iOSBuckExample' do\n    pod 'RxSwift'\nend\n\npost_install do |installer|\n  require 'fileutils'\n\n  # Assuming we're at the root dir\n  buck_files_dir = 'buck-files'\n  if File.directory?(buck_files_dir)\n    installer.pod_targets.flat_map do |pod_target|\n      pod_name = pod_target.pod_name\n      # Copy the file at buck-files/BUCK_pod_name to Pods/pod_name/BUCK,\n      # override existing file if needed\n      buck_file = buck_files_dir + '/BUCK_' + pod_name\n      bridging_file_name =  pod_name + \"-Bridging-Header.h\"\n      bridging_header_File = buck_files_dir + \"/\" + bridging_file_name\n\n      # move BUCK file\n      if File.file?(buck_file)\n        FileUtils.cp(buck_file, 'Pods/' + pod_name + '/BUCK', :preserve =\u003e false)\n      end\n\n      # move briding header file\n      if File.file?(bridging_header_File)\n        FileUtils.cp(bridging_header_File, 'Pods/' + pod_name + '/' + bridging_file_name, :preserve =\u003e false)\n      end\n    end\n  end\nend\n```\n\u003e ## STEP2: buck build \n\n```sh\nmake build\n```\n\nis equal with\n\n```sh\nbuck build //iOSBuckExample:iOSBuckExampleBundle\n```\n\n\u003e ## STEP3: .buckconfig\n```bzl\n[cxx]\n  default_platform = iphonesimulator-x86_64\n  combined_preprocess_and_compile = true\n\n[apple]\n  iphonesimulator_target_sdk_version = 9.0\n  iphoneos_target_sdk_version = 9.0\n  xctool_default_destination_specifier = platform=iOS Simulator, name=iPhone 7, OS=12.0\n\n[alias]\n  app = //iOSBuckExample:iOSBuckExampleBundle\n\n[httpserver]\n  port = 8000\n\n[project]\n  ide = xcode\n  ignore = .buckd, \\\n           .hg, \\\n           .git, \\\n           buck-out, \\\n\n```\n- [cxx]: platform enviorment\n- [apple]: apple platfrom enviorment\n- [alias]: buck interface shortcut\n- [httpserver]: buck build trace visual log \n- [project]: project enviorment\n\n\n\u003e ## STEP4: Project BUCK file \n```bzl\n\n# Convenicen Config \u0026 Mecro file (copyright: https://github.com/airbnb/BuckSample)\nload(\"//Config:configs.bzl\", \"binary_configs\", \"library_configs\", \"pod_library_configs\", \"info_plist_substitutions\")\n\n# Asset\napple_asset_catalog(\n    name = \"iOSBuckExampleAssets\",\n    visibility = [\"PUBLIC\"],\n    dirs = [\"Assets.xcassets\"],\n)\n\n# Resource (such as xib, storyboard, launchscreen and so on)\napple_resource(\n    name = \"iOSBuckExampleResource\",\n    visibility = [\"PUBLIC\"],\n    files = glob([\"**/*.storyboard\"]),\n)\n\n# Binary Srouce (Your soruce code, Pod libary, Apple platform frameworks etc)\napple_binary(\n  name = \"iOSBuckExampleBinary\",\n  visibility = [\"PUBLIC\"],\n  swift_version = \"4.2\",\n  configs = binary_configs(\"iOSBuckExample\"),\n  srcs = glob([\n    \"main.m\",\n    \"**/*.swift\"\n  ]),\n  deps = [\n    \":iOSBuckExampleAssets\",\n    \":iOSBuckExampleResource\",\n    \"//Pods/RxSwift:RxSwift\"\n  ],\n  frameworks = [\n    '$SDKROOT/System/Library/Frameworks/Foundation.framework',\n    '$SDKROOT/System/Library/Frameworks/UIKit.framework'\n  ],\n)\n\n# workspace project file configuration\nxcode_workspace_config(\n    name = \"workspace\",\n    visibility = [\"PUBLIC\"],\n    workspace_name = \"iOSBuckExample\",\n    src_target = \":iOSBuckExampleBundle\",\n    additional_scheme_actions = {\n        \"Build\": {\n            \"PRE_SCHEME_ACTIONS\": [\"echo 'Started Building'\"],\n            \"POST_SCHEME_ACTIONS\": [\"echo 'Finished Building'\"],\n        },\n    },\n    action_config_names = {\"profile\": \"Profile\"},\n)\n\n# Bundle\napple_bundle(\n    name = \"iOSBuckExampleBundle\",\n    visibility = [\"PUBLIC\"],\n    extension = \"app\",\n    binary = \":iOSBuckExampleBinary\",\n    product_name = \"iOSBuckExample\",\n    info_plist = \"Info.plist\",\n    info_plist_substitutions = info_plist_substitutions(\"iOSBuckExample\"),\n)\n\n# Packgage\napple_package(\n  name = \"iOSBuckExamplePackage\",\n  bundle = \":iOSBuckExampleBundle\",\n)\n\n```\n\n\u003e ## STEP5: CocoaPod BUCK file (ref: buck-files dir)\n\nRxSwift\n```bzl\napple_library(\n    name = \"RxSwift\",        # \u003c---------- Podname\n    modular = True,          # \u003c---------- Moduler\n    preprocessor_flags = [   \n        \"-fobjc-arc\"\n    ],\n    visibility = [\"PUBLIC\"], # \u003c---------- Recommend!\n    swift_version = \"4.2\",  \n     srcs = glob([\n      \"**/*.m\",\n      \"**/*.mm\",\n      \"**/*.swift\",\n    ]),\n    exported_headers = glob([\n      \"**/*.h\",\n    ]),\n    frameworks = [\n        \"$SDKROOT/System/Library/Frameworks/Foundation.framework\",   # \u003c----- Frameworks!\n        \"$SDKROOT/System/Library/Frameworks/UIKit.framework\"\n    ] \n)\n\n```\n\nRxAtomic\n```bzl\napple_library(\n    name = \"RxAtomic\",\n    visibility = [\"PUBLIC\"],\n    modular = True,\n    swift_version = \"4.2\",\n    exported_headers = glob([\n        \"**/*.h\",\n    ]),\n    srcs = glob([\n        \"**/*.c\",\n    ])\n)\n```\n\n\u003e ## STEP6: Bridging header file need pod\n\nRxCocoa\n```bzl\napple_library(\n    name = \"RxCocoa\",\n    preprocessor_flags = [\n        \"-fobjc-arc\"\n    ],\n    visibility = [\"PUBLIC\"],\n    bridging_header = \"RxCocoa-Bridging-Header.h\",\n    swift_version = \"4.2\",\n     srcs = glob([\n      \"**/*.m\",\n      \"**/*.mm\",\n      \"**/*.swift\",\n    ]),\n    exported_headers = glob([\n      \"**/*.h\",\n    ]),\n    deps = [\n        \"//Pods/RxSwift:RxSwift\"\n    ],\n    frameworks = [\n        \"$SDKROOT/System/Library/Frameworks/Foundation.framework\",\n        \"$SDKROOT/System/Library/Frameworks/UIKit.framework\"\n    ] \n)\n\n```\n\n\u003e ## STEP7: Trace build result \n\n.buckconfig\n```sh\n\n[httpserver]\n  port = 8000 #\u003c------ trace local server port\n```\n\n\u003cimg src=\"https://github.com/GeekTree0101/iOSBuckExample/blob/master/res/trace_example.jpg\" /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeektree0101%2Fiosbuckexample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeektree0101%2Fiosbuckexample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeektree0101%2Fiosbuckexample/lists"}