-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now able to build and run under Windows
- Loading branch information
1 parent
1f709f9
commit d2201e1
Showing
6 changed files
with
216 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env python | ||
''' | ||
Create a user readable changelog | ||
Requires the gitpython package via pip install gitpython | ||
Stephen Dade | ||
November 2016 | ||
''' | ||
|
||
from git import Repo | ||
import os | ||
import time | ||
|
||
#Get the parent (..\) directory. ie the root cuav dir | ||
path = os.path.abspath(os.path.join(os.getcwd(), os.pardir)) | ||
repo = Repo(path) | ||
assert not repo.bare | ||
|
||
#get list of all commits | ||
all_commits = list(repo.iter_commits('master')) | ||
|
||
#open the changelog for writing | ||
f = open("changelog.txt","w") | ||
|
||
#go through all the commits | ||
for comm in all_commits: | ||
#if it's a version raise, add a special message | ||
if "raise version" in comm.message: | ||
commit_date = time.strftime("%d-%m-%Y", time.gmtime(comm.committed_date)) | ||
tree = comm.tree | ||
#get setup.py and grab the version number from the file | ||
blob = tree['setup.py'] | ||
data = blob.data_stream.read() | ||
curversion = "" | ||
for line in data.split('\n'): | ||
if "version = " in line: | ||
curversion = line[11:len(line)-1] | ||
break | ||
|
||
f.write("\n") | ||
f.write("CUAV " + curversion + " (" + commit_date + ")\n") | ||
else: | ||
#just print the summary (1st line) of the commit message | ||
comm.message.split('\n', 1)[0] | ||
f.write("-" + comm.summary + "\n") | ||
|
||
f.close() | ||
print("Done") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# -*- mode: python -*- | ||
# spec file for pyinstaller to build cuav for windows | ||
geotagAny = Analysis(['.\\cuav\\tools\\geotag.py'], | ||
pathex=[os.path.abspath('.')], | ||
# for some unknown reason these hidden imports don't pull in | ||
# all the needed pieces, so we also import them in mavproxy.py | ||
hiddenimports=['UserList', 'UserString', | ||
'pymavlink.mavwp', 'pymavlink.mavutil', 'pymavlink.dialects.v20.ardupilotmega', | ||
'pymavlink.dialects.v10.ardupilotmega', | ||
'pymavlink.dialects.v20.common', 'pymavlink.dialects.v10.common', | ||
'pymavlink.dialects.v20.ASLUAV', 'pymavlink.dialects.v10.ASLUAV', | ||
'pymavlink.dialects.v20.autoquad', 'pymavlink.dialects.v10.autoquad', | ||
'pymavlink.dialects.v20.matrixpilot', 'pymavlink.dialects.v10.matrixpilot', | ||
'pymavlink.dialects.v20.minimal', 'pymavlink.dialects.v10.minimal', | ||
'pymavlink.dialects.v20.paparazzi', 'pymavlink.dialects.v10.paparazzi', | ||
'pymavlink.dialects.v20.slugs', 'pymavlink.dialects.v10.slugs', | ||
'pymavlink.dialects.v20.standard', 'pymavlink.dialects.v10.standard', | ||
'pymavlink.dialects.v20.ualberta', 'pymavlink.dialects.v10.ualberta', | ||
'pymavlink.dialects.v20.uAvionix', 'pymavlink.dialects.v10.uAvionix'], | ||
excludes=['tcl', 'tk', 'Tkinter', 'tkinter', '_tkinter'], | ||
hookspath=None, | ||
runtime_hooks=None) | ||
pgmconvertAny = Analysis(['.\\cuav\\tools\\pgm_convert.py'], | ||
pathex=[os.path.abspath('.')], | ||
# for some unknown reason these hidden imports don't pull in | ||
# all the needed pieces, so we also import them in mavproxy.py | ||
hiddenimports=['UserList', 'UserString'], | ||
excludes=['tcl', 'tk', 'Tkinter', 'tkinter', '_tkinter'], | ||
hookspath=None, | ||
runtime_hooks=None) | ||
geosearchAny = Analysis(['.\\cuav\\tools\\geosearch.py'], | ||
pathex=[os.path.abspath('.')], | ||
# for some unknown reason these hidden imports don't pull in | ||
# all the needed pieces, so we also import them in mavproxy.py | ||
hiddenimports=['UserList', 'UserString', | ||
'pymavlink.mavwp', 'pymavlink.mavutil', 'pymavlink.dialects.v20.ardupilotmega', | ||
'pymavlink.dialects.v10.ardupilotmega', | ||
'pymavlink.dialects.v20.common', 'pymavlink.dialects.v10.common', | ||
'pymavlink.dialects.v20.ASLUAV', 'pymavlink.dialects.v10.ASLUAV', | ||
'pymavlink.dialects.v20.autoquad', 'pymavlink.dialects.v10.autoquad', | ||
'pymavlink.dialects.v20.matrixpilot', 'pymavlink.dialects.v10.matrixpilot', | ||
'pymavlink.dialects.v20.minimal', 'pymavlink.dialects.v10.minimal', | ||
'pymavlink.dialects.v20.paparazzi', 'pymavlink.dialects.v10.paparazzi', | ||
'pymavlink.dialects.v20.slugs', 'pymavlink.dialects.v10.slugs', | ||
'pymavlink.dialects.v20.standard', 'pymavlink.dialects.v10.standard', | ||
'pymavlink.dialects.v20.ualberta', 'pymavlink.dialects.v10.ualberta', | ||
'pymavlink.dialects.v20.uAvionix', 'pymavlink.dialects.v10.uAvionix'], | ||
excludes=[], | ||
hookspath=None, | ||
runtime_hooks=None) | ||
|
||
MERGE( (geotagAny, 'geotag', 'geotag'), (pgmconvertAny, 'pgmconvert', 'pgmconvert'), (geosearchAny, 'geosearch', 'geosearch') ) | ||
|
||
geotag_pyz = PYZ(geotagAny.pure) | ||
geotag_exe = EXE(geotag_pyz, | ||
geotagAny.scripts, | ||
exclude_binaries=True, | ||
name='geotag.exe', | ||
debug=False, | ||
strip=None, | ||
upx=True, | ||
console=True ) | ||
geotag_coll = COLLECT(geotag_exe, | ||
geotagAny.binaries, | ||
geotagAny.zipfiles, | ||
geotagAny.datas, | ||
strip=None, | ||
upx=True, | ||
name='geotag') | ||
|
||
pgmconvert_pyz = PYZ(pgmconvertAny.pure) | ||
pgmconvert_exe = EXE(pgmconvert_pyz, | ||
pgmconvertAny.scripts, | ||
exclude_binaries=True, | ||
name='pgmconvert.exe', | ||
debug=False, | ||
strip=None, | ||
upx=True, | ||
console=True ) | ||
pgmconvert_coll = COLLECT(pgmconvert_exe, | ||
pgmconvertAny.binaries, | ||
pgmconvertAny.zipfiles, | ||
pgmconvertAny.datas, | ||
strip=None, | ||
upx=True, | ||
name='pgmconvert') | ||
|
||
geosearch_pyz = PYZ(geosearchAny.pure) | ||
geosearch_exe = EXE(geosearch_pyz, | ||
geosearchAny.scripts, | ||
exclude_binaries=True, | ||
name='geosearch.exe', | ||
debug=False, | ||
strip=None, | ||
upx=True, | ||
console=True ) | ||
geosearch_coll = COLLECT(geosearch_exe, | ||
geosearchAny.binaries, | ||
geosearchAny.zipfiles, | ||
geosearchAny.datas, | ||
strip=None, | ||
upx=True, | ||
name='geosearch') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
rem build the standalone Cuav tools for Windows. | ||
rem This assumes Python is installed in C:\Python27 | ||
rem If it is not, change the PYTHON_LOCATION environment variable accordingly | ||
rem This assumes InnoSetup is installed in C:\Program Files (x86)\Inno Setup 5 | ||
rem If it is not, change the INNOSETUP environment variable accordingly | ||
rem This requires the MinGW compiler and libjpeg-turbo development files (libjpeg-turbo-1.5.1-gcc.exe) | ||
rem This requires Pyinstaller==2.1, setuptools==19.2 and packaging==14.2 | ||
rem also requires pyexiv2 - https://launchpad.net/pyexiv2 | ||
SETLOCAL enableextensions | ||
|
||
if "%PYTHON_LOCATION%" == "" (set "PYTHON_LOCATION=C:\Python27") | ||
if "%INNOSETUP%" == "" (set "INNOSETUP=C:\Program Files (x86)\Inno Setup 5") | ||
|
||
rem get the version | ||
for /f "tokens=*" %%a in ( | ||
'"%PYTHON_LOCATION%\python" returnVersion.py' | ||
) do ( | ||
set VERSION=%%a | ||
) | ||
|
||
rem -----build the changelog----- | ||
"%PYTHON_LOCATION%\python" createChangelog.py | ||
|
||
rem -----Build CUAV----- | ||
cd ..\ | ||
"%PYTHON_LOCATION%\python" setup.py clean build --compiler=mingw32 install | ||
"%PYTHON_LOCATION%\Scripts\pyinstaller" -y --clean .\windows\cuav.spec | ||
|
||
rem ----Copy the files and scanner.pyd---- | ||
mkdir .\dist\cuav | ||
xcopy .\dist\pgmconvert\* .\dist\cuav /Y /E | ||
xcopy .\dist\geotag\* .\dist\cuav /Y /E | ||
xcopy .\dist\geosearch\* .\dist\cuav /Y /E | ||
xcopy .\build\lib.win32-2.7\cuav\image\scanner.pyd .\dist\cuav\cuav.image.scanner.pyd /Y | ||
|
||
rem -----Create version Info----- | ||
@echo off | ||
@echo %VERSION%> .\windows\version.txt | ||
@echo on | ||
|
||
|
||
|
||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This script reads the setup.py and returns the current version number | ||
# Used as part of building the WIndows setup file (cuavWinBuild.bat) | ||
# It assumes there is a line like this: | ||
# version = "12344" | ||
|
||
# glob supports Unix style pathname extensions | ||
with open("../setup.py") as f: | ||
searchlines = f.readlines() | ||
for i, line in enumerate(searchlines): | ||
if "version = " in line: | ||
print line[11:len(line)-2] | ||
break |