Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Odoo scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XCG
Odoo scripts
Commits
635c0ccad6dc
Commit
635c0ccad6dc
authored
5 years ago
by
Vincent Hatakeyama
Browse files
Options
Downloads
Patches
Plain Diff
copy module documentations into superproject documentation
parent
59ae1a8fa329
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
create_documentation
+70
-58
70 additions, 58 deletions
create_documentation
with
70 additions
and
58 deletions
create_documentation
+
70
−
58
View file @
635c0cca
...
...
@@ -43,28 +43,6 @@
fi
echo
"
${
YELLOW
}
INFO
${
RESET
}
- Branch name:
$branch
"
for
doc_dir
in
doc docs
;
do
if
[[
-d
"
$doc_dir
"
]]
;
then
pushd
$doc_dir
for
language
in
$languages
;
do
make
-e
SPHINXOPTS
=
-Dlanguage
=
${
language
}
$format
if
[[
$?
-eq
0
]]
;
then
# TODO read value from Makefile
builddir
=
_build
dest_dir
=
$out_dir
/
$project_name
/
$language
/
$branch
echo
"
${
YELLOW
}
INFO
${
RESET
}
- Documentation generation done for
$doc_dir
(superproject), copy to
$dest_dir
"
mkdir
-p
$dest_dir
cp
-r
$builddir
/
$format
/.
$dest_dir
else
echo
"
${
RED
}
ERROR
${
RESET
}
- Documentation generation failed for
$doc_dir
(superproject)"
((
error++
))
fi
done
popd
fi
done
if
type
"python3"
>
/dev/null
;
then
odoo_modules
=
"
$(
python3
-B
-c
"import configparser ; c = configparser.ConfigParser() ; c.read('
${
project_home
}
/setup.cfg') ; print (c.has_option('odoo_scripts', 'modules') and ' '.join(c.get('odoo_scripts', 'modules').split()) or '')"
)
"
...
...
@@ -72,9 +50,18 @@
odoo_modules
=
"
$(
python2
-B
-c
"import ConfigParser ; c = ConfigParser.SafeConfigParser() ; c.read('
${
project_home
}
/setup.cfg') ; print (c.has_option('odoo_scripts', 'modules') and ' '.join(c.get('odoo_scripts', 'modules').split()) or '')"
)
"
fi
# search where to copy modules documentation
for
doc_dir
in
doc docs
;
do
if
[[
-d
"
$doc_dir
"
]]
;
then
superproject_modules_doc
=
$project_home
/
$doc_dir
/modules
mkdir
$superproject_modules_doc
fi
done
# modules documentation
for
module_path
in
$(
eval echo
$odoo_modules
)
;
do
if
[[
-d
"
$module_path
"
]]
;
then
pushd
$module_path
module
=
$(
basename
$module_path
)
has_doc
=
""
...
...
@@ -75,45 +62,70 @@
for
module_path
in
$(
eval echo
$odoo_modules
)
;
do
if
[[
-d
"
$module_path
"
]]
;
then
pushd
$module_path
module
=
$(
basename
$module_path
)
has_doc
=
""
if
[
-e
".git"
]
;
then
branch
=
"
$(
git rev-parse
--abbrev-ref
HEAD
)
"
elif
[
-e
".hg"
]
;
then
branch
=
"
$(
hg identify
--branch
)
"
else
echo
"
${
RED
}
WARN
${
RESET
}
- Branch name not found"
branch
=
"default"
fi
for
doc_dir
in
doc docs
;
do
if
[[
-d
$doc_dir
&&
-e
$doc_dir
/Makefile
]]
;
then
echo
"
${
YELLOW
}
INFO
${
RESET
}
- Branch name:
$branch
"
has_doc
=
True
echo
${
YELLOW
}
INFO
${
RESET
}
- Makefile found
in
$dir
/
$module_path
/
$doc_dir
pushd
$doc_dir
# TODO read value from Makefile
for
language
in
$languages
;
do
make
-e
SPHINXOPTS
=
-Dlanguage
=
${
language
}
$format
if
[[
$?
-eq
0
]]
;
then
# TODO read value from Makefile
builddir
=
_build
dest_dir
=
$out_dir
/
$module
/
$language
/
$branch
echo
${
YELLOW
}
INFO
${
RESET
}
- Documentation generation
done for
$dir
/
$module_path
/
$doc_dir
, copy to
$dest_dir
mkdir
-p
$dest_dir
cp
-r
$builddir
/
$format
/.
$dest_dir
else
echo
${
RED
}
ERROR
${
RESET
}
- Documentation generation failed
for
$dir
/
$module_path
/
$doc_dir
((
error++
))
fi
done
popd
fi
done
if
[[
-z
"
$has_doc
"
]]
;
then
echo
${
RED
}
ERROR
${
RESET
}
- Missing documentation
for
$dir
/
$module_path
fi
popd
if
[
-e
".git"
]
;
then
branch
=
"
$(
git rev-parse
--abbrev-ref
HEAD
)
"
elif
[
-e
".hg"
]
;
then
branch
=
"
$(
hg identify
--branch
)
"
else
echo
"
${
RED
}
WARN
${
RESET
}
- Branch name not found"
branch
=
"default"
fi
for
doc_dir
in
doc docs
;
do
if
[[
-d
$doc_dir
&&
-e
$doc_dir
/Makefile
]]
;
then
echo
"
${
YELLOW
}
INFO
${
RESET
}
- Branch name:
$branch
"
has_doc
=
True
echo
${
YELLOW
}
INFO
${
RESET
}
- Makefile found
in
$dir
/
$module_path
/
$doc_dir
pushd
$doc_dir
# TODO read value from Makefile
for
language
in
$languages
;
do
make
-e
SPHINXOPTS
=
-Dlanguage
=
${
language
}
$format
if
[[
$?
-eq
0
]]
;
then
# TODO read value from Makefile
builddir
=
_build
dest_dir
=
$out_dir
/
$module
/
$language
/
$branch
echo
${
YELLOW
}
INFO
${
RESET
}
- Documentation generation
done for
$dir
/
$module_path
/
$doc_dir
, copy to
$dest_dir
mkdir
-p
$dest_dir
cp
-r
$builddir
/
$format
/.
$dest_dir
else
echo
${
RED
}
ERROR
${
RESET
}
- Documentation generation failed
for
$dir
/
$module_path
/
$doc_dir
((
error++
))
fi
done
popd
# copy documentation in super project
rsync
-rLptgoD
$doc_dir
$superproject_modules_doc
/
$module
# TODO translation will not work when copying like that.
fi
done
if
[[
-z
"
$has_doc
"
]]
;
then
echo
${
RED
}
ERROR
${
RESET
}
- Missing documentation
for
$dir
/
$module_path
fi
popd
fi
done
# super project documentation
for
doc_dir
in
doc docs
;
do
if
[[
-d
"
$doc_dir
"
]]
;
then
pushd
$doc_dir
for
language
in
$languages
;
do
make
-e
SPHINXOPTS
=
-Dlanguage
=
${
language
}
$format
if
[[
$?
-eq
0
]]
;
then
# TODO read value from Makefile
builddir
=
_build
dest_dir
=
$out_dir
/
$project_name
/
$language
/
$branch
echo
"
${
YELLOW
}
INFO
${
RESET
}
- Documentation generation done for
$doc_dir
(superproject), copy to
$dest_dir
"
mkdir
-p
$dest_dir
cp
-r
$builddir
/
$format
/.
$dest_dir
else
echo
"
${
RED
}
ERROR
${
RESET
}
- Documentation generation failed for
$doc_dir
(superproject)"
((
error++
))
fi
done
popd
fi
done
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment