diff --git a/extension/training/pybindings/test/TARGETS b/extension/training/pybindings/test/BUCK similarity index 70% rename from extension/training/pybindings/test/TARGETS rename to extension/training/pybindings/test/BUCK index 34a324dc50e..746c222ce85 100644 --- a/extension/training/pybindings/test/TARGETS +++ b/extension/training/pybindings/test/BUCK @@ -1,8 +1,9 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") -runtime.python_test( +fbcode_target(_kind = runtime.python_test, name = "test", srcs = ["test.py"], visibility = ["//executorch/extension/training/pybindings/test/..."], diff --git a/extension/training/test/BUCK b/extension/training/test/BUCK index 1e8cc179228..ba8c6b08fa0 100644 --- a/extension/training/test/BUCK +++ b/extension/training/test/BUCK @@ -1,8 +1,19 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") +oncall("executorch") # Any targets that should be shared between fbcode and xplat must be defined in # targets.bzl. This file can contain xplat-only targets. load(":targets.bzl", "define_common_targets") -oncall("executorch") -define_common_targets() +non_fbcode_target(_kind = define_common_targets,) + +# !!!! fbcode/executorch/extension/training/test/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!! + +# Any targets that should be shared between fbcode and xplat must be defined in +# targets.bzl. This file can contain fbcode-only targets. + +load(":targets.bzl", "define_common_targets") + + +fbcode_target(_kind = define_common_targets,is_fbcode = True) diff --git a/extension/training/test/TARGETS b/extension/training/test/TARGETS deleted file mode 100644 index a6c52d105f6..00000000000 --- a/extension/training/test/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets(is_fbcode = True) diff --git a/extension/wasm/test/BUCK b/extension/wasm/test/BUCK index d7a8959984b..d5c29e0e24a 100644 --- a/extension/wasm/test/BUCK +++ b/extension/wasm/test/BUCK @@ -1,9 +1,10 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load("@fbsource//tools/build_defs:fb_xplat_cxx_binary.bzl", "fb_xplat_cxx_binary") oncall("executorch") -runtime.genrule( +non_fbcode_target(_kind = runtime.genrule, name = "unittests_full", srcs = [ "unittests.js", @@ -13,7 +14,7 @@ runtime.genrule( cmd = "cat $SRCS > $OUT", ) -runtime.genrule( +non_fbcode_target(_kind = runtime.genrule, name = "unittests_full_etdump", srcs = [ "unittests.js", @@ -23,7 +24,7 @@ runtime.genrule( cmd = "cat $SRCS > $OUT", ) -fb_xplat_cxx_binary( +non_fbcode_target(_kind = fb_xplat_cxx_binary, name = "wasm.test.js", linker_flags = [ "-lembind", @@ -45,7 +46,7 @@ fb_xplat_cxx_binary( ], ) -fb_xplat_cxx_binary( +non_fbcode_target(_kind = fb_xplat_cxx_binary, name = "wasm_etdump.test.js", linker_flags = [ "-lembind", @@ -66,3 +67,49 @@ fb_xplat_cxx_binary( ":unittests_full_etdump", ], ) + +# !!!! fbcode/executorch/extension/wasm/test/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!! + +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + + +export_genrule_cmd = [ + "$(exe //executorch/examples/portable/scripts:export)", + "--model_name={model_name}", + "--output_dir=$OUT", +] + +fbcode_target(_kind = runtime.python_binary, + name = "test_model", + srcs = [ + "test_model.py", + ], + main_module = "executorch.extension.wasm.test.test_model", + deps = [ + "//executorch/extension/export_util:export_util", + ], +) + +test_pte_genrule_cmd = [ + "$(exe :test_model)", + "$OUT/test.pte", +] + +models_genrule_cmd = [ + "mkdir -p $OUT &&", + " ".join(export_genrule_cmd).format(model_name="add_mul"), + "&&", + " ".join(export_genrule_cmd).format(model_name="add"), + "&&", + " ".join(test_pte_genrule_cmd), +] + +fbcode_target(_kind = runtime.genrule, + name = "models", + outs = { + "add.pte": ["add.pte"], + "add_mul.pte": ["add_mul.pte"], + "test.pte": ["test.pte"], + }, + cmd = " ".join(models_genrule_cmd), +) diff --git a/extension/wasm/test/TARGETS b/extension/wasm/test/TARGETS deleted file mode 100644 index b85312a4c87..00000000000 --- a/extension/wasm/test/TARGETS +++ /dev/null @@ -1,44 +0,0 @@ -load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") - -oncall("executorch") - -export_genrule_cmd = [ - "$(exe //executorch/examples/portable/scripts:export)", - "--model_name={model_name}", - "--output_dir=$OUT", -] - -runtime.python_binary( - name = "test_model", - srcs = [ - "test_model.py", - ], - main_module = "executorch.extension.wasm.test.test_model", - deps = [ - "//executorch/extension/export_util:export_util", - ], -) - -test_pte_genrule_cmd = [ - "$(exe :test_model)", - "$OUT/test.pte", -] - -models_genrule_cmd = [ - "mkdir -p $OUT &&", - " ".join(export_genrule_cmd).format(model_name="add_mul"), - "&&", - " ".join(export_genrule_cmd).format(model_name="add"), - "&&", - " ".join(test_pte_genrule_cmd), -] - -runtime.genrule( - name = "models", - outs = { - "add.pte": ["add.pte"], - "add_mul.pte": ["add_mul.pte"], - "test.pte": ["test.pte"], - }, - cmd = " ".join(models_genrule_cmd), -) diff --git a/kernels/aten/BUCK b/kernels/aten/BUCK index 1e8cc179228..c89edb78b18 100644 --- a/kernels/aten/BUCK +++ b/kernels/aten/BUCK @@ -1,8 +1,19 @@ +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") +oncall("executorch") # Any targets that should be shared between fbcode and xplat must be defined in # targets.bzl. This file can contain xplat-only targets. load(":targets.bzl", "define_common_targets") -oncall("executorch") -define_common_targets() +non_fbcode_target(_kind = define_common_targets,) + +# !!!! fbcode/executorch/kernels/aten/TARGETS was merged into this file, see https://fburl.com/workplace/xl8l9yuo for more info !!!! + +# Any targets that should be shared between fbcode and xplat must be defined in +# targets.bzl. This file can contain fbcode-only targets. + +load(":targets.bzl", "define_common_targets") + + +fbcode_target(_kind = define_common_targets,) diff --git a/kernels/aten/TARGETS b/kernels/aten/TARGETS deleted file mode 100644 index 2341af9282f..00000000000 --- a/kernels/aten/TARGETS +++ /dev/null @@ -1,8 +0,0 @@ -# Any targets that should be shared between fbcode and xplat must be defined in -# targets.bzl. This file can contain fbcode-only targets. - -load(":targets.bzl", "define_common_targets") - -oncall("executorch") - -define_common_targets()