Commit 9f40276a authored by carlosperate's avatar carlosperate

Add package build documentation, update project README.

parent 8a85db39
...@@ -76,13 +76,15 @@ ServerCompilerSettings.ini ...@@ -76,13 +76,15 @@ ServerCompilerSettings.ini
# Anything starting with this is created as a unit/module testing temporal file # Anything starting with this is created as a unit/module testing temporal file
TestTemp_* TestTemp_*
# CEF log files # CEF cacbe and log files
/webcache
cef_error.log cef_error.log
cef_debug.log cef_debug.log
# Miscellaneous files that should not get revisioned # Miscellaneous files that should not get revisioned
/ignore /ignore
# Packaged python build folders # Packaged python build folders and files
/win /win
/webcache /package/build
/ardublockly_run.bat
# Ardublockly # Ardublockly
"Ardublockly" is a fork of [Blockly](https://developers.google.com/blockly/), a web-based graphical programming editor, that has been updated to generate [Arduino](http://www.arduino.cc/) code. Ardublockly is a visual programming editor for Arduino. It is based on Google's [Blockly][1], which has been forked to generate [Arduino](http://www.arduino.cc/) code.
The "ArdublocklyServer" python package initialises a local server to be able to compile and load the Arduino code using the [Arduino IDE](http://arduino.cc/en/main/software). The "ArdublocklyServer" Python package initialises a local server to be able to compile and load the Arduino code using the [Arduino IDE][2].
This project has been influenced by BlocklyDuino. This is all packaged in a self contained executable:
![Ardublockly desktop program screenshot][desktop_screeshot]
## Features ## Features
* Generate Arduino code with visual drag-and-drop blocks * Generate Arduino code with visual drag-and-drop blocks
...@@ -13,39 +14,39 @@ This project has been influenced by BlocklyDuino. ...@@ -13,39 +14,39 @@ This project has been influenced by BlocklyDuino.
* Compatible with a wide range of official Arduino Boards * Compatible with a wide range of official Arduino Boards
* Runs on Windows / Linux / Mac OS X * Runs on Windows / Linux / Mac OS X
Ardublockly is still under development and a few features are not yet implemented. A to-do list can be found in the [TODO.md file](https://github.com/carlosperate/ardublockly/blob/master/TODO.md). Ardublockly is still under development and a few features are not yet implemented. A to-do list can be found in the [TODO.md][3] file.
Currently tested under Windows and Linux with python 2, but developed for portability. Will soon be tested on all platforms. Currently tested under Windows with Python 2.7 and 3.4 and in Linux and MacOS X with Python 2.7.
## Demo ## Online Demos
A demo of the current state of Ardublockly can be found in the following two links (to load the code into an Arduino requires Ardublockly to be executed locally): A demo of the current state of Ardublockly can be found in the following two links (to load the code into an Arduino requires Ardublockly to be executed locally):
#### [Ardublockly with responsive design](http://carlosperate.github.io/ardublockly/ardublockly/apps/arduino/index.html) #### [Ardublockly][10] (with responsive design)
![WebApp screenshot responsive design](http://carlosperate.github.io/ardublockly/images/screenshot_material_all_small.jpg "Ardublockly with responsive design") ![WebApp screenshot responsive design][web_screenshot_responsive]
#### [Ardublockly classic](http://carlosperate.github.io/ardublockly/ardublockly/apps/arduino_classic/index.html) #### [Ardublockly classic][11]
![WebApp screenshot](http://carlosperate.github.io/ardublockly/images/screenshot_1.png "Ardublockly") ![WebApp screenshot][web_screenshot_classic]
## Installing ## Installing
Installation instructions can be found in [this Github repository Wiki](https://github.com/carlosperate/ardublockly/wiki/Installing-Ardublockly). There is a packaged version for Windows that runs as a stand-alone executable and can be downloaded from the [Ardublockly repository releases page][4].
Alternatively, there is a packaged version for Windows that runs as a stand-alone executable and can be downloaded from the [Ardublockly-package repository](https://github.com/carlosperate/ardublockly-package) or directly as a zip file [clicking here](https://github.com/carlosperate/ardublockly-package/archive/master.zip). Installation instructions for developers can be found in [this Github repository Wiki][5]. This will work on Windows, Linux and MacOS X.
It also needs the [Arduino IDE version 1.6 or higher](http://arduino.cc/en/main/software). It also needs the [Arduino IDE version 1.6 or higher](http://arduino.cc/en/main/software).
## Running ## Running
1. [Install Ardublockly](https://github.com/carlosperate/ardublockly/wiki/Installing-Ardublockly) or [Ardublockly-package](https://github.com/carlosperate/ardublockly-package) 1. [Install Ardublockly][5].
2. Install the [Arduino IDE version 1.6 or higher](http://arduino.cc/en/main/software) 2. Install the [Arduino IDE][2] version 1.6 or higher.
3. Run the `start.py` python script (for Ardublockly) or `ardublockly_win.bat` package file (for Ardublockly-package) 3. Run Ardublockly as defined in your installation method.
3. Configure Ardublockly to locate the Arduino IDE [following these instructions](https://github.com/carlosperate/ardublockly/wiki/Configure-Ardublockly) 3. Configure Ardublockly to locate the Arduino IDE [following these instructions][6].
## Documentation ## Documentation
The documentation, including installation instructions, configuration instructions, and developer information can be found in [this Github repository Wiki](https://github.com/carlosperate/ardublockly/wiki). The documentation, including installation instructions, configuration instructions, and developer information can be found in the [Ardublockly GitHub repository Wiki][7].
To download the documentation you can git clone the wiki data: To download the documentation you can git clone the wiki data:
``` ```
...@@ -54,15 +55,35 @@ git clone https://github.com/carlosperate/ardublockly.wiki.git ...@@ -54,15 +55,35 @@ git clone https://github.com/carlosperate/ardublockly.wiki.git
## Credit ## Credit
Blockly original source is Copyright of Google Inc. [https://developers.google.com/blockly/](https://developers.google.com/blockly/) This project has been influenced by BlocklyDuino.
#### Significant changes Blockly original source is Copyright of Google Inc. [https://developers.google.com/blockly/][1]
Added Arduino code generator, Arduino web-apps, and Python server to utilise the Arduino IDE.
All changes to the original source code can be reviewed [here](https://github.com/carlosperate/ardublockly/compare/blockly-original...master). ##### Significant changes to Blockly
Added Arduino code generator, static typing and additional code warnings.
All changes to the original source code can be reviewed [here][8].
## License ## License
Licensed under the Apache License, Version 2.0 (the "License"). Licensed under the Apache License, Version 2.0 (the "License").
The full document can be found in the [COPYING](https://github.com/carlosperate/ardublockly/blob/master/COPYING) file. The full document can be found in the [LICENSE][9] file.
[1]: https://developers.google.com/blockly/
[2]: http://arduino.cc/en/main/software/
[3]: TODO.md
[4]: https://github.com/carlosperate/ardublockly/releases/
[5]: https://github.com/carlosperate/ardublockly/wiki/Installing-Ardublockly
[6]: https://github.com/carlosperate/ardublockly/wiki/Configure-Ardublockly
[7]: https://github.com/carlosperate/ardublockly/wiki
[8]: https://github.com/carlosperate/ardublockly/compare/blockly-original...master
[9]: https://github.com/carlosperate/ardublockly/blob/master/LICENSE
[10]: http://carlosperate.github.io/ardublockly/ardublockly/index.html
[11]: http://carlosperate.github.io/ardublockly/ardublockly/classic/index.html
[desktop_screeshot]: http://carlosperate.github.io/ardublockly/images/screenshot_desktop_1.png
[web_screenshot_responsive]: http://carlosperate.github.io/ardublockly/images/screenshot_material_all_small.jpg
[web_screenshot_classic]: http://carlosperate.github.io/ardublockly/images/screenshot_1.png
# Ardublockly package
This folder contains the Python scripts required to package Ardublockly into a standalone executable. This way it can be distributed without any dependencies other than having the Arduino IDE.
Currently it is only built for Windows, but it could be updated to be built for Linux and Mac OS X (a move from py2exe to Pyinstaller is planned).
__Downloading the packaged Ardublockly__: The binaries will be hosted in GitHub as part of the [repository releases][1].
## Building Ardublockly from source
These scripts are currently built and tested using Python 2.7.
While it is possible to maintain compatibility with other Python versions (the ArdublocklyServer Python package used in the developer installation has been tested on Python 2.7 and 3.4), due to the multiple individual perks of the python libraries used here, it has been decided to target a single build environment.
If you are using Python virtual environments on Windows this [collection of Python extensions binaries][2] is highly recommended.
### Python dependencies
The specific version of the Python dependencies can be found in the [requirements.txt][3] file.
#### wxPython
wxPython provides python bindings for the wxWidgets, the cross-platform GUI toolkit.
You can download wxPython from their [official website][4].
#### cefpython3
CEF Python provides python bindings for the Chromium Embedded Framework. This is used in Ardublockly to create a webview of the Ardublockly web app without requiring any specific browser installation. This is specially useful for the project because the frameworks used work best on the Chrome engine.
[Install cefpython following their project installation instructions][5]
#### py2exe
py2exe is a Distutils extension to build Python scripts into Windows executable programs.
There is a plan to migrate from py2exe to Pyinstaller, but for now this is the main library used to create the Windows build.
You can download py2exe from their [official website][6].
## Build steps
Download and initialise this project repository:
```
git clone https://github.com/carlosperate/ardublockly.git
git submodule init
git submodule update
cd closure-library
git pull origin master
```
Now navigate to the `package` folder in the project directory:
```
cd ../package
```
To build Ardublockly all you have to do is execute the `build_windows.py` file:
```
python build_windows.py
```
This will remove any previous build directory (`/win` directory in project root), rebuild, and create the `ardublockly_run.bat` file into the project root.
To run Ardublockly then just execute the `ardublockly_run.bat` file.
[1]: https://github.com/carlosperate/ardublockly/releases/
[2]: http://www.lfd.uci.edu/~gohlke/pythonlibs/
[3]: requirements.txt
[4]: http://www.wxpython.org/download.php
[5]: https://code.google.com/p/cefpython/
[6]: http://www.py2exe.org/
@echo off
start win/start.exe
\ No newline at end of file
...@@ -3,13 +3,13 @@ import os ...@@ -3,13 +3,13 @@ import os
import sys import sys
import shutil import shutil
import fnmatch import fnmatch
from distutils.core import setup
from glob import glob from glob import glob
try: try:
from cefpython3 import cefpython from cefpython3 import cefpython
from distutils.core import setup
import py2exe import py2exe
except ImportError: except ImportError:
print("You need to have cefpython3, distutils, and py2exe installed!") print("You need to have cefpython3, and py2exe installed!")
sys.exit(1) sys.exit(1)
# set up directories # set up directories
...@@ -43,15 +43,15 @@ def get_data_files(): ...@@ -43,15 +43,15 @@ def get_data_files():
""" Collects the required redistributable dlls. """ """ Collects the required redistributable dlls. """
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,
'%s/d3dcompiler_43.dll' % cef_path, "%s/d3dcompiler_43.dll" % cef_path,
'%s/devtools_resources.pak' % cef_path, "%s/devtools_resources.pak" % cef_path,
'%s/ffmpegsumo.dll' % cef_path, "%s/ffmpegsumo.dll" % cef_path,
'%s/libEGL.dll' % cef_path, "%s/libEGL.dll" % cef_path,
'%s/libGLESv2.dll' % cef_path, "%s/libGLESv2.dll" % cef_path,
'%s/subprocess.exe' % cef_path]), "%s/subprocess.exe" % cef_path]),
('locales', glob(r'%s/locales/*.*' % cef_path)), ("locales", glob(r"%s/locales/*.*" % cef_path)),
("Microsoft.VC90.CRT", glob(r'msvcm90\*.*'))] ("Microsoft.VC90.CRT", glob(r"msvcm90\*.*"))]
return data_files return data_files
...@@ -84,6 +84,7 @@ def get_py_files(): ...@@ -84,6 +84,7 @@ def get_py_files():
def build_exe(args): def build_exe(args):
""" Sets up the disutils for py2exe and runs it to build project. """
setup(data_files=get_data_files(), setup(data_files=get_data_files(),
#windows=get_py_files(), #windows=get_py_files(),
console=get_py_files(), console=get_py_files(),
...@@ -91,13 +92,28 @@ def build_exe(args): ...@@ -91,13 +92,28 @@ def build_exe(args):
script_args=args) script_args=args)
def create_run_batch_file():
"""
Creates a batch file into the project root to be able to easily launch the
Ardublockly software.
"""
root_dir = os.path.realpath(this_file_parent + os.sep + os.sep + os.sep)
batch_text = "@echo off\n" + \
("start %s\win\start_cef.exe %s" % (root_dir, root_dir))
try:
batch_file = open(("%s/ardublockly_run.bat" % root_dir), 'w')
batch_file.write(batch_text)
batch_file.close()
except Exception as e:
print('%s\nArduino sketch could not be created!!!' % e)
if __name__ == "__main__": if __name__ == "__main__":
remove_build_dir() remove_build_dir()
remove_install_dir() remove_install_dir()
if len(sys.argv) <= 1: if len(sys.argv) <= 1:
build_exe(['py2exe']) build_exe(['py2exe'])
else: else:
build_exe() build_exe()
remove_build_dir() remove_build_dir()
create_run_batch_file()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment