Skip to content

Commit

Permalink
hopefully docu fix inlc complete list of instance libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
lyuba authored and lyuba committed Mar 27, 2024
1 parent 651c437 commit 047deff
Show file tree
Hide file tree
Showing 4 changed files with 296 additions and 364 deletions.
84 changes: 42 additions & 42 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,59 +18,59 @@
git_pusher = GitPusher()
versions = []

##################################
# A: gather schema specifications
##################################
#####################################################
# Gather schema specifications and instance libraries
#####################################################

# Step 1 - clone central repository in main branch to get the latest sources
schema_loader = SchemaLoader()
instance_loader = InstanceLoader()

for schema_version in schema_loader.get_schema_versions():
for version in schema_loader.get_schema_versions():

# Step 2 - building static structure
copy_static_structures(schema_version)
copy_static_structures(version)

# Step 3 - find all involved schemas for the current version
schemas = schema_loader.find_schemas(schema_version)
relative_path_by_schema = schema_loader.get_relative_path_for_schemas(schemas, schema_version)

for schema in schemas:
# Step 4 - build documentation for version specific schema
SchemaDocBuilder(schema, schema_loader.schemas_sources, relative_path_by_schema).build()

# Step 5 - building toctrees (please note that the implementation requires the schemas to be built already)
create_toc_tree_page(schema_version, ["schema_specifications"])

# Step 6 - checkout version branch in relative "upload" directory (provided by GitHub pipeline), copy files and push
if schema_version not in versions:
versions.append(schema_version)

######################
# B: gather instances
######################

# Step 1 - clone instances repository in main branch to get the latest sources
instance_loader = InstanceLoader()

for instance_version in instance_loader.get_instance_versions():
# Step 2 - find all involved schemas for the current version
instances_paths = instance_loader.find_instances(instance_version)

# Step 3 - gather version specific instance libraries for documentation build
instances = InstancesDocBuilder(instances_paths, instance_version)

# Step 4 - build documentation for version specific schema
instances.build()

# Step 5 - building toctrees (please note that the implementation requires the schemas to be built already)
create_toc_tree_page(instance_version, ["instance_libraries"])
absolute_paths_for_schemas = schema_loader.find_schemas(version)
relative_paths_for_schema_docu = schema_loader.get_relative_paths_for_schema_docu(absolute_paths_for_schemas, version)

# Step 4 - find all involved instances for the current version
relative_paths_for_instancelib_docu = None
instancelib_docu_path_for_schemas = None
if version in instance_loader.get_instance_versions():
absolute_paths_for_instances = instance_loader.find_instances(version)
relative_paths_for_instancelib_docu, instancelib_docu_path_for_schemas = instance_loader.get_relative_paths_and_schemas_for_instancelib_docu(absolute_paths_for_instances, version)

# Step 5 - build documentation page for each version specific schema
for absolute_path_schema in absolute_paths_for_schemas:
# Step 5.1 - retrieve schema name from absolute path
schema_name = schema_loader.get_schema_name(absolute_path_schema)
# Step 5.2 - retrieve path to instance library path if available for schema
if instancelib_docu_path_for_schemas and schema_name in instancelib_docu_path_for_schemas:
instancelib_docu_path_for_schema = instancelib_docu_path_for_schemas[schema_name]
else:
instancelib_docu_path_for_schema = None
# Step 5.3 - build schema documentation page
SchemaDocBuilder(absolute_path_schema, schema_name, version, relative_paths_for_schema_docu, instancelib_docu_path_for_schema).build()

# Step 6 - build toctrees (please note that the implementation requires the schemas to be built already)
create_toc_tree_page(version, ["schema_specifications"])

# Step 7 - build instance library documentation page for each version specific instance list
if relative_paths_for_instancelib_docu:
InstancesDocBuilder(relative_paths_for_instancelib_docu, version, instancelib_docu_path_for_schemas, relative_paths_for_schema_docu).build()

# Step 8 - building toctrees (please note that the implementation requires the instances to be built already)
create_toc_tree_page(version, ["instance_libraries"])

# Step 9 - checkout version branch in relative "upload" directory (provided by GitHub pipeline), copy files and push
if version not in versions:
versions.append(version)

# Step 6 - checkout version branch in relative "upload" directory (provided by GitHub pipeline), copy files and push
if instance_version not in versions:
versions.append(instance_version)

########################################################################################################################
# Step FINAL (A+B) - checkout version branch in relative "upload" directory (provided by GitHub pipeline), copy files and push
# Step FINAL - checkout version branch in relative "upload" directory (provided by GitHub pipeline), copy files and push
########################################################################################################################

for version in versions:
Expand Down
Loading

0 comments on commit 047deff

Please sign in to comment.