2121# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
2222# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2323
24- """Rule to start Config 5 from Bazel"""
24+ """Rules to use DaVinci Configurator 5 from Bazel"""
2525
2626load ("//rules/common:create_davinci_tool_workspace.bzl" , "create_davinci_tool_workspace" )
27- load ("//rules/vtt:toolchains.bzl" , "generate_tools_vtt" )
27+ # load("//rules/vtt:toolchains.bzl", "generate_tools_vtt")
2828
2929_CFG5_GENERATE_TEMPLATE_WINDOWS = """
3030start-process -WorkingDirectory {dpa_folder} -PassThru -NoNewWindow -RedirectStandardOutput {dpa_folder}/daVinciCfg5.log -Wait {cfg5cli_path} -ArgumentList '-p {dpa_path} -g {genargs} --verbose'
@@ -134,9 +134,9 @@ def _cfg5_generate_workspace_impl(ctx, additional_genargs, tools = []):
134134 inputs .extend (ctx .attr .sip .files .to_list ())
135135 return _cfg5_generate (ctx , dpa_path , dpa_folder , dpa_copy , inputs , template , True , additional_genargs , tools )
136136
137- def _cfg5_generate_vtt_workspace_impl (ctx ):
138- tools = generate_tools_vtt (ctx )
139- return _cfg5_generate_workspace_impl (ctx , ["--genType=VTT" , "--buildVTTProject" ], tools )
137+ # def _cfg5_generate_vtt_workspace_impl(ctx):
138+ # tools = generate_tools_vtt(ctx)
139+ # return _cfg5_generate_workspace_impl(ctx, ["--genType=VTT", "--buildVTTProject"], tools)
140140
141141cfg5_generate_workspace_attrs = {
142142 "dpa_file" : attr .label (allow_single_file = [".dpa" ], doc = "Dpa project file to start the cfg5 with" ),
@@ -148,35 +148,35 @@ cfg5_generate_workspace_attrs = {
148148 "config_folders" : attr .string_list (doc = "(Optional) List of config folders that the path will be checked for in each file to create a nested Config folder structure, default is [\" Config\" ]" , default = ["Config" ]),
149149}
150150
151- cfg5_generate_vtt_workspace_def = rule (
152- implementation = _cfg5_generate_vtt_workspace_impl ,
153- attrs = cfg5_generate_workspace_attrs ,
154- doc = """
155- Creates a separate cfg5 workspace containing all the given config files and run the cfg5 in this created directory inside the bazel-bin.
156- This rule is wrapped with private_is_windows attribute to separate between OS differences.
157- Used specifically for the vtt use case, as this adds the correct vtt flags to the Cfg5 call automatically.
158- """ ,
159- toolchains = ["//rules/cfg5:toolchain_type" , "//rules/vtt:toolchain_type" ],
160- )
161-
162- def cfg5_generate_vtt_workspace (name , ** kwargs ):
163- """Wraps the cfg5_generate_vtt_workspace with the private_is_windows select statement in place
164-
165- Args:
166- name: The unique name of this target
167- **kwargs: All of the attrs of the cfg5_generate_vtt_workspace rule
168-
169- Returns:
170- A cfg5_generate_vtt_workspace_def rule that contains the actual implementation
171- """
172- cfg5_generate_vtt_workspace_def (
173- name = name ,
174- private_is_windows = select ({
175- "@bazel_tools//src/conditions:host_windows" : True ,
176- "//conditions:default" : False ,
177- }),
178- ** kwargs
179- )
151+ # cfg5_generate_vtt_workspace_def = rule(
152+ # implementation = _cfg5_generate_vtt_workspace_impl,
153+ # attrs = cfg5_generate_workspace_attrs,
154+ # doc = """
155+ # Creates a separate cfg5 workspace containing all the given config files and run the cfg5 in this created directory inside the bazel-bin.
156+ # This rule is wrapped with private_is_windows attribute to separate between OS differences.
157+ # Used specifically for the vtt use case, as this adds the correct vtt flags to the Cfg5 call automatically.
158+ # """,
159+ # toolchains = ["//rules/cfg5:toolchain_type", "//rules/vtt:toolchain_type"],
160+ # )
161+
162+ # def cfg5_generate_vtt_workspace(name, **kwargs):
163+ # """Wraps the cfg5_generate_vtt_workspace with the private_is_windows select statement in place
164+
165+ # Args:
166+ # name: The unique name of this target
167+ # **kwargs: All of the attrs of the cfg5_generate_vtt_workspace rule
168+
169+ # Returns:
170+ # A cfg5_generate_vtt_workspace_def rule that contains the actual implementation
171+ # """
172+ # cfg5_generate_vtt_workspace_def(
173+ # name = name,
174+ # private_is_windows = select({
175+ # "@bazel_tools//src/conditions:host_windows": True,
176+ # "//conditions:default": False,
177+ # }),
178+ # **kwargs
179+ # )
180180
181181def _cfg5_generate_rt_workspace_impl (ctx ):
182182 return _cfg5_generate_workspace_impl (ctx , ["--genType=REAL" ])
@@ -211,23 +211,23 @@ def cfg5_generate_rt_workspace(name, **kwargs):
211211 ** kwargs
212212 )
213213
214- def _cfg5_generate_vtt_impl (ctx ):
215- info_vtt = ctx .toolchains ["//rules/vtt:toolchain_type" ]
214+ # def _cfg5_generate_vtt_impl(ctx):
215+ # info_vtt = ctx.toolchains["//rules/vtt:toolchain_type"]
216216
217- if not ctx .attr .private_is_windows and not info_vtt .vtt_cmd_path and not info_vtt .vtt_cmd_label :
218- fail ("vttcmd_path is not set in the 'vtt_toolchain', but is necessary for the generation under Linux." )
219- inputs = depset (ctx .files .input_arxmls , transitive = [ctx .attr .dpa_linux .files ])
220- dpa_path = ctx .file .dpa_windows .basename
221- dpa_folder = ctx .file .dpa_windows .dirname
222- dpa_file = ctx .file .dpa_linux
223- template = _CFG5_GENERATE_TEMPLATE_LINUX
224- if ctx .attr .private_is_windows :
225- dpa_file = ctx .file .dpa_windows
226- template = _CFG5_GENERATE_TEMPLATE_WINDOWS
217+ # if not ctx.attr.private_is_windows and not info_vtt.vtt_cmd_path and not info_vtt.vtt_cmd_label:
218+ # fail("vttcmd_path is not set in the 'vtt_toolchain', but is necessary for the generation under Linux.")
219+ # inputs = depset(ctx.files.input_arxmls, transitive = [ctx.attr.dpa_linux.files])
220+ # dpa_path = ctx.file.dpa_windows.basename
221+ # dpa_folder = ctx.file.dpa_windows.dirname
222+ # dpa_file = ctx.file.dpa_linux
223+ # template = _CFG5_GENERATE_TEMPLATE_LINUX
224+ # if ctx.attr.private_is_windows:
225+ # dpa_file = ctx.file.dpa_windows
226+ # template = _CFG5_GENERATE_TEMPLATE_WINDOWS
227227
228- tools = generate_tools_vtt (ctx )
228+ # tools = generate_tools_vtt(ctx)
229229
230- return _cfg5_generate (ctx , dpa_path , dpa_folder , dpa_file , inputs , template , False , ["--genType=VTT" , "--buildVTTProject" ], tools )
230+ # return _cfg5_generate(ctx, dpa_path, dpa_folder, dpa_file, inputs, template, False, ["--genType=VTT", "--buildVTTProject"], tools)
231231
232232def _cfg5_generate_rt_impl (ctx ):
233233 inputs = depset (ctx .files .input_arxmls , transitive = [ctx .attr .dpa_linux .files ])
@@ -250,35 +250,35 @@ cfg5_generate_attrs = {
250250 "private_is_windows" : attr .bool (mandatory = True , doc = "Set automatically to the correct OS value" ),
251251}
252252
253- cfg5_generate_vtt_def = rule (
254- implementation = _cfg5_generate_vtt_impl ,
255- attrs = cfg5_generate_attrs ,
256- doc = """
257- Run the cfg5 directly in the project.
258- This rule is wrapped with private_is_windows attribute to separate between OS differences.
259- Used specifically for the vtt use case, as this adds the correct vtt flags to the Cfg5 call automatically.
260- """ ,
261- toolchains = ["//rules/cfg5:toolchain_type" , "//rules/vtt:toolchain_type" ],
262- )
263-
264- def cfg5_generate_vtt (name , ** kwargs ):
265- """Wraps the cfg5_generate_vtt with the private_is_windows select statement in place
266-
267- Args:
268- name: The unique name of this target
269- **kwargs: All of the attrs of the cfg5_generate_vtt rule
270-
271- Returns:
272- A cfg5_generate_vtt_def rule that contains the actual implementation
273- """
274- cfg5_generate_vtt_def (
275- name = name ,
276- private_is_windows = select ({
277- "@bazel_tools//src/conditions:host_windows" : True ,
278- "//conditions:default" : False ,
279- }),
280- ** kwargs
281- )
253+ # cfg5_generate_vtt_def = rule(
254+ # implementation = _cfg5_generate_vtt_impl,
255+ # attrs = cfg5_generate_attrs,
256+ # doc = """
257+ # Run the cfg5 directly in the project.
258+ # This rule is wrapped with private_is_windows attribute to separate between OS differences.
259+ # Used specifically for the vtt use case, as this adds the correct vtt flags to the Cfg5 call automatically.
260+ # """,
261+ # toolchains = ["//rules/cfg5:toolchain_type", "//rules/vtt:toolchain_type"],
262+ # )
263+
264+ # def cfg5_generate_vtt(name, **kwargs):
265+ # """Wraps the cfg5_generate_vtt with the private_is_windows select statement in place
266+
267+ # Args:
268+ # name: The unique name of this target
269+ # **kwargs: All of the attrs of the cfg5_generate_vtt rule
270+
271+ # Returns:
272+ # A cfg5_generate_vtt_def rule that contains the actual implementation
273+ # """
274+ # cfg5_generate_vtt_def(
275+ # name = name,
276+ # private_is_windows = select({
277+ # "@bazel_tools//src/conditions:host_windows": True,
278+ # "//conditions:default": False,
279+ # }),
280+ # **kwargs
281+ # )
282282
283283cfg5_generate_rt_def = rule (
284284 implementation = _cfg5_generate_rt_impl ,
0 commit comments