Skip to content

Commit

Permalink
remove two framework_info.json changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rachguo authored and rachguo committed Nov 8, 2023
1 parent 74a8b35 commit 85e9a69
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 19 deletions.
7 changes: 1 addition & 6 deletions tools/ci_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1749,12 +1749,7 @@ def run_ios_tests(args, source_dir, config, cwd):

if args.build_apple_framework:
package_test_py = os.path.join(source_dir, "tools", "ci_build", "github", "apple", "test_ios_packages.py")
framework_info_file_path = os.path.join(cwd, "framework_info.json")
framework_info_file = ""
if os.path.exists(framework_info_file_path):
framework_info_file = os.path.join(cwd, "framework_info.json")
else:
framework_info_file = os.path.join(cwd, "framework_info_macos.json")
framework_info_file = os.path.join(cwd, "framework_info.json")
dynamic_framework_dir = os.path.join(cwd, config + "-" + args.ios_sysroot)
static_framework_dir = os.path.join(cwd, config + "-" + args.ios_sysroot, "static_framework")
# test dynamic framework
Expand Down
7 changes: 0 additions & 7 deletions tools/ci_build/github/apple/build_and_assemble_ios_pods.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def parse_args():
)

build_framework_group.add_argument("--include-ops-by-config")

build_framework_group.add_argument(
"--build-settings-file", required=True, help="The positional argument of build_ios_framework.py."
)
Expand Down Expand Up @@ -115,11 +114,6 @@ def main():
if args.include_ops_by_config is not None:
build_ios_framework_args += ["--include_ops_by_config", args.include_ops_by_config]

framework_info_macos_file = None
if args.build_for_macosx:
framework_info_macos_file = build_dir / "framework_info_macos.json"
build_ios_framework_args += ["--build_for_macosx"]

build_ios_framework_args += ["--build_dir", str(build_dir), args.build_settings_file]

run(build_ios_framework_args)
Expand Down Expand Up @@ -154,7 +148,6 @@ def main():
framework_dir=build_dir / "framework_out" / "onnxruntime.xcframework",
public_headers_dir=build_dir / "framework_out" / "Headers",
package_variant=package_variant,
framework_info_macos_file=framework_info_macos_file,
)

if args.test:
Expand Down
7 changes: 3 additions & 4 deletions tools/ci_build/github/apple/build_ios_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def _parse_build_settings(args):
build_settings_data = json.load(f)

build_settings = {}

build_settings["build_osx_archs"] = build_settings_data.get("build_osx_archs", DEFAULT_BUILD_OSX_ARCHS)

if "build_params" in build_settings_data:
Expand Down Expand Up @@ -81,10 +82,9 @@ def _build_for_ios_sysroot(
ort_libs.append(os.path.join(framework_dir, "onnxruntime"))

# We only need to copy Info.plist, framework_info.json, and headers once since they are the same
framework_info_json_file_name = "framework_info_macos.json" if sysroot == "macosx" else "framework_info.json"
if not info_plist_path:
info_plist_path = os.path.join(build_dir_current_arch, build_config, "Info.plist")
framework_info_path = os.path.join(build_dir_current_arch, build_config, framework_info_json_file_name)
framework_info_path = os.path.join(build_dir_current_arch, build_config, "framework_info.json")
headers = glob.glob(os.path.join(framework_dir, "Headers", "*.h"))

# manually create the fat framework
Expand Down Expand Up @@ -144,8 +144,7 @@ def _build_package(args):
framework_dirs.append(framework_dir)
# podspec and headers for each sysroot are the same, pick one of them
if not framework_info_path:
framework_info_json_file_name = "framework_info_macos.json" if sysroot == "macosx" else "framework_info.json"
framework_info_path = os.path.join(os.path.dirname(framework_dir), framework_info_json_file_name)
framework_info_path = os.path.join(os.path.dirname(framework_dir), "framework_info.json")
public_headers_path = os.path.join(os.path.dirname(framework_dir), "onnxruntime.framework", "Headers")

# create the folder for xcframework and copy the LICENSE and podspec file
Expand Down
3 changes: 1 addition & 2 deletions tools/ci_build/github/apple/c/assemble_c_pod_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def assemble_c_pod_package(
:param public_headers_dir Path to the public headers directory to include in the pod.
:param framework_dir Path to the onnxruntime framework directory to include in the pod.
:param package_variant The pod package variant.
:param Optional framework_info_macos_file Path to the framework_info_macos.json file containing additional values for the podspec.
:return Tuple of (package name, path to the podspec file).
"""
staging_dir = staging_dir.resolve()
Expand Down Expand Up @@ -87,7 +86,7 @@ def assemble_c_pod_package(
"ORT_C_HEADERS_DIR": public_headers_dir.name,
"SUMMARY": pod_config["summary"],
"VERSION": pod_version,
"WEAK_FRAMEWORK": framework_info["macosx"]["WEAK_FRAMEWORK"],
"WEAK_FRAMEWORK": framework_info["iphoneos"]["WEAK_FRAMEWORK"],
}

podspec_template = _script_dir / "c.podspec.template"
Expand Down

0 comments on commit 85e9a69

Please sign in to comment.