Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ardublockly
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
ardublockly
Commits
665ccf54
Commit
665ccf54
authored
Jun 04, 2015
by
carlosperate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update build_windows script to be run correctly from project root directory.
parent
c5bb8343
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
18 deletions
+44
-18
package/build_linux.py
package/build_linux.py
+3
-0
package/build_windows.py
package/build_windows.py
+36
-16
package/pack_ardublockly.py
package/pack_ardublockly.py
+5
-2
No files found.
package/build_linux.py
View file @
665ccf54
...
@@ -17,6 +17,9 @@
...
@@ -17,6 +17,9 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
#
#
# IMPORTANT: This script is designed to be located one directory level under the
# project root folder.
#
# This script file uses PyInstaller to create a self contained executable
# This script file uses PyInstaller to create a self contained executable
# build of the Ardublockly application.
# build of the Ardublockly application.
# It will remove the build folders left from PyInstaller and move the folder
# It will remove the build folders left from PyInstaller and move the folder
...
...
package/build_windows.py
View file @
665ccf54
...
@@ -17,6 +17,9 @@
...
@@ -17,6 +17,9 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
#
#
# IMPORTANT: This script is designed to be located one directory level under the
# project root folder.
#
import
os
import
os
import
sys
import
sys
import
shutil
import
shutil
...
@@ -27,20 +30,22 @@ try:
...
@@ -27,20 +30,22 @@ try:
from
cefpython3
import
cefpython
from
cefpython3
import
cefpython
import
py2exe
import
py2exe
except
ImportError
:
except
ImportError
:
print
(
"You need to have cefpython3, and py2exe installed!"
)
raise
SystemExit
(
"You need to have cefpython3, and py2exe installed!"
)
sys
.
exit
(
1
)
# set up directories
# set up directories
this_file_dir
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
sys
.
argv
[
0
]))
project_root_dir
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)))
this_file_parent
=
os
.
path
.
dirname
(
this_file_dir
)
# Enable the ArdublocklyServer package access the sys path for py2exe to find
# Enable the ArdublocklyServer package access the sys path for py2exe to find
sys
.
path
.
append
(
this_file_parent
)
sys
.
path
.
append
(
project_root_dir
)
exec_folder_name
=
"arduexec"
script_tag
=
"[Ardublockly build] "
script_tab
=
" "
def
get_install_folder
():
def
get_install_folder
():
""" Install directory will be folder
'win' on
root directory. """
""" Install directory will be folder
a folder on project
root directory. """
return
os
.
path
.
join
(
this_file_parent
,
"win"
)
return
os
.
path
.
join
(
project_root_dir
,
exec_folder_name
)
def
remove_install_dir
():
def
remove_install_dir
():
...
@@ -52,13 +57,13 @@ def remove_install_dir():
...
@@ -52,13 +57,13 @@ def remove_install_dir():
def
remove_build_dir
():
def
remove_build_dir
():
""" Removes the build folder. """
""" Removes the build folder. """
build_folder
=
os
.
path
.
join
(
this_file_dir
,
"build"
)
build_folder
=
os
.
path
.
join
(
os
.
getcwd
()
,
"build"
)
if
os
.
path
.
exists
(
build_folder
):
if
os
.
path
.
exists
(
build_folder
):
shutil
.
rmtree
(
build_folder
)
shutil
.
rmtree
(
build_folder
)
def
get_data_files
():
def
get_data_files
():
""" Collects the required redistributable dlls. """
""" Collects the required redistributable dlls
and CEF files
. """
cef_path
=
os
.
path
.
dirname
(
cefpython
.
__file__
)
cef_path
=
os
.
path
.
dirname
(
cefpython
.
__file__
)
data_files
=
[
data_files
=
[
(
""
,
[
"%s/icudt.dll"
%
cef_path
,
(
""
,
[
"%s/icudt.dll"
%
cef_path
,
...
@@ -96,8 +101,11 @@ def get_options():
...
@@ -96,8 +101,11 @@ def get_options():
def
get_py_files
():
def
get_py_files
():
""" Returns the scripts to package, only needs the CEF entry point. """
"""
start_file
=
os
.
path
.
join
(
this_file_parent
,
"start_cef.py"
)
Returns the scripts to package, Ardublockly only needs the CEF entry
point to work, everything else is imported.
"""
start_file
=
os
.
path
.
join
(
project_root_dir
,
"start_cef.py"
)
return
[
start_file
]
return
[
start_file
]
...
@@ -113,25 +121,37 @@ def build_exe(args):
...
@@ -113,25 +121,37 @@ def build_exe(args):
def
create_run_batch_file
():
def
create_run_batch_file
():
"""
"""
Creates a batch file into the project root to be able to easily launch the
Creates a batch file into the project root to be able to easily launch the
Ardublockly
software
.
Ardublockly
application
.
"""
"""
root_dir
=
os
.
path
.
realpath
(
this_file_parent
+
os
.
sep
+
os
.
sep
+
os
.
sep
)
batch_text
=
"@echo off
\n
"
+
\
batch_text
=
"@echo off
\n
"
+
\
(
"start %s\win\start_cef.exe %s"
%
(
root_dir
,
root_dir
))
"start %s\start_cef.exe %s"
%
\
(
get_install_folder
(),
project_root_dir
)
try
:
try
:
batch_file
=
open
((
"%s/ardublockly_run.bat"
%
root_dir
),
'w'
)
batch_file
=
open
((
"%s/ardublockly_run.bat"
%
project_
root_dir
),
'w'
)
batch_file
.
write
(
batch_text
)
batch_file
.
write
(
batch_text
)
batch_file
.
close
()
batch_file
.
close
()
except
Exception
as
e
:
except
Exception
as
e
:
print
(
'%s
\n
Arduino sketch could not be created!!!'
%
e
)
print
(
"%s
\n
"
%
e
+
script_tab
+
"Batch file to run Ardublockly could not be created !"
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
print
(
script_tag
+
"Building Ardublockly for Windows."
)
print
(
script_tag
+
"Removing old build directory."
)
remove_build_dir
()
remove_build_dir
()
print
(
script_tag
+
"Removing old executable directory."
)
remove_install_dir
()
remove_install_dir
()
print
(
script_tag
+
"Building Ardublockly for Linux."
)
if
len
(
sys
.
argv
)
<=
1
:
if
len
(
sys
.
argv
)
<=
1
:
build_exe
([
'py2exe'
])
build_exe
([
'py2exe'
])
else
:
else
:
build_exe
()
build_exe
()
print
(
script_tag
+
"Removing recent build directory."
)
remove_build_dir
()
remove_build_dir
()
print
(
script_tag
+
"Creating a batch file to launch Ardublockly."
)
create_run_batch_file
()
create_run_batch_file
()
package/pack_ardublockly.py
View file @
665ccf54
...
@@ -17,9 +17,12 @@
...
@@ -17,9 +17,12 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
#
#
# IMPORTANT: This script is designed to be located one directory level under the
# project root folder.
#
# This script file will create a copy of the project folder in its parent folder
# This script file will create a copy of the project folder in its parent folder
# So if project folder is located in ~/project/ardublockly it will create a
# So if project folder is located in ~/project
s
/ardublockly it will create a
# copy in ~/project
/ardublockly_zip
.
# copy in ~/project
s/ardublockly_<tag>
.
# It will then delete unnecessary files for a working version of the self
# It will then delete unnecessary files for a working version of the self
# executable application and zip the contents of the folder.
# executable application and zip the contents of the folder.
#
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment