Skip to content

Commit b547635

Browse files
authored
Solve the issue of the APIs not being generated (#1010)
* Refs #21777: Change the default branch if not set for python Signed-off-by: Juanjo Garcia <juanjosegarcia@eprosima.com> * Refs #21777: Change the default branch for FastDDs, and mimic 2.10.x format Signed-off-by: Juanjo Garcia <juanjosegarcia@eprosima.com> * Refs #21777: Default Pyhton branch set to 1.1.x Signed-off-by: Juanjo Garcia <juanjosegarcia@eprosima.com> * Refs #21777: Corrected typo Signed-off-by: Juanjo Garcia <juanjosegarcia@eprosima.com> * Refs #21777: include checks like in 2.10.x, as described in PR #799 Signed-off-by: Juanjo Garcia <juanjosegarcia@eprosima.com> --------- Signed-off-by: Juanjo Garcia <juanjosegarcia@eprosima.com>
1 parent b601265 commit b547635

1 file changed

Lines changed: 15 additions & 23 deletions

File tree

docs/conf.py

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -216,22 +216,13 @@ def configure_doxyfile(
216216
fastdds_branch = os.environ.get('FASTDDS_BRANCH', None)
217217

218218
# First try to checkout to ${FASTDDS_BRANCH}
219-
# Else try with current documentation branch
220-
# Else checkout to master
219+
# Else checkout to 2.6.x
221220
if (fastdds_branch and
222221
fastdds.refs.__contains__('origin/{}'.format(fastdds_branch))):
223222
fastdds_branch = 'origin/{}'.format(fastdds_branch)
224-
elif (docs_branch and
225-
fastdds.refs.__contains__('origin/{}'.format(docs_branch))):
226-
fastdds_branch = 'origin/{}'.format(docs_branch)
227223
else:
228-
print(
229-
'Fast DDS does not have either "{}" or "{}" branches'.format(
230-
fastdds_branch,
231-
docs_branch
232-
)
233-
)
234-
fastdds_branch = 'origin/master'
224+
fastdds_branch = 'origin/2.6.x'
225+
print(f'Fast DDS branch is not set by env var. Using "{fastdds_branch}"')
235226

236227
# Actual checkout
237228
print('Checking out Fast DDS branch "{}"'.format(fastdds_branch))
@@ -248,20 +239,14 @@ def configure_doxyfile(
248239
fastdds_python_branch = os.environ.get('FASTDDS_PYTHON_BRANCH', None)
249240

250241
# First try to checkout to ${FASTDDS_PYTHON_BRANCH}
251-
# Else try with current documentation branch
252-
# Else checkout to master
242+
# Else checkout to 1.1.x
253243
if (fastdds_python_branch and
254244
fastdds_python.refs.__contains__(
255245
'origin/{}'.format(fastdds_python_branch))):
256246
fastdds_python_branch = 'origin/{}'.format(fastdds_python_branch)
257-
elif (docs_branch and
258-
fastdds_python.refs.__contains__('origin/{}'.format(docs_branch))):
259-
fastdds_python_branch = 'origin/{}'.format(docs_branch)
260247
else:
261-
print(
262-
'Fast DDS Python does not have either "{}" or "{}" branches'
263-
.format(fastdds_python_branch, docs_branch))
264-
fastdds_python_branch = 'origin/main'
248+
fastdds_python_branch = 'origin/1.1.x'
249+
print(f'Fast DDS Python branch is not set by env var. Using "{fastdds_python_branch}"')
265250

266251
# Actual checkout
267252
print('Checking out Fast DDS Python branch "{}"'.format(
@@ -281,10 +266,13 @@ def configure_doxyfile(
281266
project_source_dir
282267
)
283268
# Generate doxygen documentation
284-
subprocess.call('doxygen {}'.format(doxyfile_out), shell=True)
269+
doxygen_ret = subprocess.call('doxygen {}'.format(doxyfile_out), shell=True)
270+
if doxygen_ret != 0:
271+
print('Doxygen failed with return code {}'.format(doxygen_ret))
272+
sys.exit(doxygen_ret)
285273

286274
# Generate SWIG code.
287-
subprocess.call('swig -python -doxygen -I{}/include \
275+
swig_ret = subprocess.call('swig -python -doxygen -I{}/include \
288276
-outdir {}/fastdds_python/src/swig -c++ -interface \
289277
_fastdds_python -o \
290278
{}/fastdds_python/src/swig/fastddsPYTHON_wrap.cxx \
@@ -294,6 +282,10 @@ def configure_doxyfile(
294282
fastdds_python_repo_name,
295283
fastdds_python_repo_name
296284
), shell=True)
285+
if swig_ret != 0:
286+
print('SWIG failed with return code {}'.format(swig_ret))
287+
sys.exit(swig_ret)
288+
297289
fastdds_python_imported_location = '{}/fastdds_python/src/swig'.format(
298290
fastdds_python_repo_name)
299291
autodoc_mock_imports = ["_fastdds_python"]

0 commit comments

Comments
 (0)