Skip to content

Commit 171e960

Browse files
authored
Merge pull request #1 from ARMmbed/plugins
language plugins
2 parents e06216c + 54c36ab commit 171e960

File tree

98 files changed

+804
-349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+804
-349
lines changed

Pipfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ pyfakefs = "*"
1717
pytest-cov = "*"
1818
wheel = "*"
1919
continuous-delivery-scripts = {editable = true, path = "."}
20-
mbed-tools-ci-scripts = "*"
2120
pre-commit = "*"
2221

2322
[pipenv]

azure-pipelines/build-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ stages:
121121
- template: steps/install-development-dependencies.yml
122122

123123
- script: |
124-
assert-news -b $(current_branch)
124+
cd-assert-news -b $(current_branch)
125125
displayName: 'Run check'
126126
127127
- stage: DocBuild
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
steps:
22
- bash: |
3-
echo "##vso[task.setvariable variable=temp_docs_path]`get-config --key DOCUMENTATION_PRODUCTION_OUTPUT_PATH`"
3+
echo "##vso[task.setvariable variable=temp_docs_path]`cd-get-config --key DOCUMENTATION_PRODUCTION_OUTPUT_PATH`"
44
displayName: 'Set variable for temporary docs dir'
55
66
- script: |
7-
generate-docs --output_dir $(temp_docs_path)
7+
cd-generate-docs --output_dir $(temp_docs_path)
88
displayName: 'Generate documentation'
99
1010
- script: |
11-
license-files
11+
cd-license-files
1212
displayName: 'Add copyright/licence notice.'

azure-pipelines/steps/generate-spdx-documents.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ steps:
55
66
- bash: |
77
mkdir -p $(temp_spdx_reports_path)
8-
generate-spdx --output-dir $(temp_spdx_reports_path)
8+
cd-generate-spdx --output-dir $(temp_spdx_reports_path)
99
displayName: 'Generate SPDX documents'
1010
1111
- script: |
12-
license-files
12+
cd-license-files
1313
displayName: 'Add copyright/licence notice.'
1414
1515
- publish: $(temp_spdx_reports_path)

azure-pipelines/steps/tag-and-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ parameters:
44
currentBranch: ''
55

66
steps:
7-
- bash: tag-and-release -b ${{ parameters.currentBranch }} --release-type=${{ parameters.releaseType }} -vv
7+
- bash: cd-tag-and-release -b ${{ parameters.currentBranch }} --release-type=${{ parameters.releaseType }} -vv
88
displayName: ${{ parameters.message }}
99
env:
1010
GIT_TOKEN: $(GIT_TOKEN)

continuous_delivery_scripts/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2020 Arm Mbed. All rights reserved.
2+
# Copyright (C) 2020 Arm. All rights reserved.
33
# SPDX-License-Identifier: Apache-2.0
44
#
55
"""Scripts and utilities used by the CI pipeline."""

continuous_delivery_scripts/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2020 Arm Mbed. All rights reserved.
2+
# Copyright (C) 2020 Arm. All rights reserved.
33
# SPDX-License-Identifier: Apache-2.0
44
#
55
"""The version number is based on semantic versioning.

continuous_delivery_scripts/assert_news.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2020 Arm Mbed. All rights reserved.
2+
# Copyright (C) 2020 Arm. All rights reserved.
33
# SPDX-License-Identifier: Apache-2.0
44
#
55
"""Checks if valid news files are created for changes in the project."""

continuous_delivery_scripts/create_news_file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2020 Arm Mbed. All rights reserved.
2+
# Copyright (C) 2020 Arm. All rights reserved.
33
# SPDX-License-Identifier: Apache-2.0
44
#
55
"""Easy news files generation.
@@ -61,7 +61,7 @@ def _write_file(file_path: pathlib.Path, text: str) -> None:
6161

6262

6363
def _determine_todays_news_file_name() -> str:
64-
return datetime.now().strftime("%Y%m%d%H%M%S")
64+
return datetime.now().strftime("%Y%m%d%H%M")
6565

6666

6767
def main() -> int:

continuous_delivery_scripts/generate_docs.py

Lines changed: 7 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
#
2-
# Copyright (C) 2020 Arm Mbed. All rights reserved.
2+
# Copyright (C) 2020 Arm. All rights reserved.
33
# SPDX-License-Identifier: Apache-2.0
44
#
5-
"""Generates documentation using Pdoc."""
5+
"""Generates documentation."""
6+
import argparse
7+
import logging
68
import os
79
import shutil
810
import sys
9-
10-
import argparse
11-
import logging
1211
from pathlib import Path
13-
from subprocess import check_call
14-
from typing import List
1512

13+
from continuous_delivery_scripts.language_specifics import get_language_specifics
1614
from continuous_delivery_scripts.utils.configuration import configuration, ConfigurationVariable
17-
from continuous_delivery_scripts.utils.filesystem_helpers import TemporaryDirectory
1815
from continuous_delivery_scripts.utils.logging import log_exception
1916

2017
logger = logging.getLogger(__name__)
@@ -26,40 +23,11 @@ def _clear_previous_docs(output_directory: Path) -> None:
2623
shutil.rmtree(str(output_directory))
2724

2825

29-
def _generate_pdoc_command_list(output_directory: Path, module: str) -> List[str]:
30-
return [
31-
"pdoc",
32-
"--html",
33-
f"{module}",
34-
"--output-dir",
35-
f"{str(output_directory)}",
36-
"--force",
37-
"--config",
38-
"show_type_annotations=True",
39-
]
40-
41-
4226
def generate_documentation(output_directory: Path, module_to_document: str) -> None:
43-
"""Ensures the documentation is in the correct location.
44-
45-
Pdoc nests its docs output in a folder with the module's name.
46-
This process removes this unwanted folder.
47-
"""
27+
"""Generates the documentation."""
4828
_clear_previous_docs(output_directory)
4929
os.makedirs(str(output_directory), exist_ok=True)
50-
with TemporaryDirectory() as temp_dir:
51-
_call_pdoc(temp_dir, module_to_document)
52-
docs_contents_dir = temp_dir.joinpath(module_to_document)
53-
if docs_contents_dir.exists() and docs_contents_dir.is_dir():
54-
for element in docs_contents_dir.iterdir():
55-
shutil.move(str(element), str(output_directory))
56-
57-
58-
def _call_pdoc(output_directory: Path, module: str) -> None:
59-
"""Calls Pdoc for generating the docs."""
60-
logger.info("Creating Pdoc documentation.")
61-
command_list = _generate_pdoc_command_list(output_directory, module)
62-
check_call(command_list)
30+
get_language_specifics().generate_code_documentation(output_directory, module_to_document)
6331

6432

6533
def generate_docs(output_directory: Path, module: str) -> int:

0 commit comments

Comments
 (0)