For example, is there a way to call the constructor of File class to create an instance of it?
Asked
Active
Viewed 357 times
1 Answers
2
Generally it just depends on the thing you want. Some things like File you have to go through an API, for example to create a file object in a rule function, you would use ctx.actions.declare_file(filename)
See this for examples: https://docs.bazel.build/versions/master/skylark/lib/actions.html#declare_file
Other things you can create directly, like depset
has depset()
. See global functions here https://docs.bazel.build/versions/master/skylark/lib/skylark-overview.html

ahumesky
- 4,203
- 8
- 12
-
I guess I made a bad example of my question. Can I create an File object? – xiay Jun 08 '20 at 23:16
-
gotcha, I edited my answer to reflect your edits to the question – ahumesky Jun 09 '20 at 02:43