Skip to content

Commit

Permalink
put generated julia component files in src/jl
Browse files Browse the repository at this point in the history
- so that their paths never conflict with the julia module file
  in case-insensitive filesystems
- this also makes the src directory less noisy (especially for
  devs that do not care about julia)
  • Loading branch information
etpinard committed Apr 1, 2021
1 parent 6e36c9a commit 90dfd9f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dash/development/_jl_components_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"DashBase": "0.1",
}

jl_component_include_string = 'include("{name}.jl")'
jl_component_include_string = 'include("jl/{name}.jl")'

jl_resource_tuple_string = """DashBase.Resource(
relative_package_path = {relative_package_path},
Expand Down Expand Up @@ -500,7 +500,11 @@ def generate_struct_file(name, props, description, project_shortname, prefix):

file_name = format_fn_name(prefix, name) + ".jl"

file_path = os.path.join("src", file_name)
# put component files in src/jl subdir
if not os.path.exists("src/jl"):
os.makedirs("src/jl")

file_path = os.path.join("src", "jl", file_name)
with open(file_path, "w") as f:
f.write(import_string)
f.write(class_string)
Expand Down

0 comments on commit 90dfd9f

Please sign in to comment.