Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
plugin_dbui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
w2pext
plugin_dbui
Commits
a2d2967e
Commit
a2d2967e
authored
11 years ago
by
LE GAC Renaud
Browse files
Options
Downloads
Patches
Plain Diff
Introduce the Sencha Cmd in the build process.
parent
7b97e902
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
buildVersion.py
+70
-3
70 additions, 3 deletions
buildVersion.py
with
70 additions
and
3 deletions
buildVersion.py
+
70
−
3
View file @
a2d2967e
...
...
@@ -22,7 +22,6 @@
EXAMPLES
> buildVersion -h
> buildVersion 0.4.3
AUTHOR
R. Le Gac, renaud.legac@free.fr
...
...
@@ -60,6 +59,7 @@ PACK_PLUGIN_URL = 'http://localhost:8000/%s/default/pack_plugin' % APP
EPYDOC
=
'
/usr/bin/epydoc
'
GIT
=
'
/usr/bin/git
'
JSDUCK
=
os
.
path
.
expandvars
(
"
$HOME/bin/jsduck
"
)
SENCHA
=
os
.
path
.
expandvars
(
"
$HOME/bin/sencha
"
)
YUICOMPRESSOR
=
os
.
path
.
expandvars
(
"
$HOME/lib/yuicompressor-2.4.8.jar
"
)
MSG_VERSION
=
'
Enter the new version:
'
...
...
@@ -112,6 +112,64 @@ def epydoc():
print
"
HTML documentation in
"
,
PYDOC
def
compile
():
"""
compile the javascript code and generate the debug version
as well as the minified version of the dbui library.
The compiler verify that the code complied with the class model
and order the file in the proper way.
The minified library can be build in several ways, including
the Ext JS class required by the applications. In the
current version, the library contains only the dbui classes and
the Ext JS ones have to be loaded separately. In that sense
this command is very similar to the yuicompressor one.
Several compressor can be used yui, closure compiler, ....
In the current version, the default yui compressor is used?
This operation relies on the Sencha Cmd:
http://www.sencha.com/products/sencha-cmd/download
The details documantation can be found:
http://docs.sencha.com/extjs/4.2.2/#!/guide/command
"""
if
not
os
.
path
.
exists
(
SENCHA
):
print
'
\n\t
The application sencha is missing !
'
print
'
\t
See: http://www.sencha.com/products/sencha-cmd/download
'
print
'
\t
Skip this step.
\n
'
return
# clean previous version
for
el
in
(
JSLIBDEBUG
,
JSLIBMIN
):
if
os
.
path
.
exists
(
el
):
os
.
remove
(
el
)
print
'
Remove javascript library
'
,
el
# debug version of the javascript library
print
'
Debug version of the javascript library
'
,
JSLIBDEBUG
cwd
=
os
.
getcwd
()
cmd
=
[
"
sencha
"
,
"
-sdk
"
,
os
.
path
.
join
(
cwd
,
EXTJSSRC
),
"
compile
"
,
"
-class
"
,
os
.
path
.
join
(
cwd
,
JSLIBSRC
),
"
exclude
"
,
"
--namespace
"
,
"
Ext
"
,
"
and
"
,
"
concat
"
,
os
.
path
.
join
(
cwd
,
JSLIBDEBUG
)]
subprocess
.
call
(
cmd
)
# Minified version of the javascript library
print
'
Minified version of the javascript library
'
,
JSLIBMIN
cmd
=
[
"
sencha
"
,
"
-sdk
"
,
os
.
path
.
join
(
cwd
,
EXTJSSRC
),
"
compile
"
,
"
-class
"
,
os
.
path
.
join
(
cwd
,
JSLIBSRC
),
"
exclude
"
,
"
--namespace
"
,
"
Ext
"
,
"
and
"
,
"
concat
"
,
"
--yui
"
,
os
.
path
.
join
(
cwd
,
JSLIBMIN
)]
subprocess
.
call
(
cmd
)
def
get_version
():
"""
Get the current version identifier.
...
...
@@ -299,6 +357,11 @@ if __name__ == '__main__':
dest
=
"
all
"
,
help
=
"
run all steps.
"
)
ops
.
add_option
(
"
-c
"
,
"
--compile
"
,
action
=
"
store_true
"
,
dest
=
"
compile
"
,
help
=
"
compile the minimal library using sencha command.
"
)
ops
.
add_option
(
"
-e
"
,
"
--epydoc
"
,
action
=
"
store_true
"
,
dest
=
"
epydoc
"
,
...
...
@@ -335,6 +398,7 @@ if __name__ == '__main__':
help
=
"
pack the web2py plugin.
"
)
ops
.
set_defaults
(
all
=
False
,
compile
=
False
,
epydoc
=
False
,
get
=
False
,
git
=
False
,
...
...
@@ -365,13 +429,16 @@ if __name__ == '__main__':
if
opt
.
jsduck
:
jsduck
()
if
opt
.
compile
:
compile
()
if
opt
.
yuicompressor
:
yuicompressor
()
if
opt
.
web2py
:
epydoc
()
jsduck
()
yui
comp
ressor
()
comp
ile
()
web2py
()
# run all steps
...
...
@@ -386,7 +453,7 @@ if __name__ == '__main__':
git
()
epydoc
()
jsduck
()
yui
comp
ressor
()
comp
ile
()
web2py
()
print
'
Exit buidVersion
\n
'
...
...
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