Skip to content

Commit

Permalink
Basic idea of building OpenZwave
Browse files Browse the repository at this point in the history
This is for a basic idea, I have not tested this code as of yet;
  • Loading branch information
kdschlosser committed Aug 27, 2018
1 parent f6b99de commit 0d58df0
Show file tree
Hide file tree
Showing 3 changed files with 690 additions and 479 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.o
*.pyc
*.log
.idea
/openzwave/
build/
dists/
Expand Down
49 changes: 16 additions & 33 deletions pyozw_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,42 +291,25 @@ def printer():
log.error('{0}\n'.format(line))

if sys.platform.startswith("win"):
from pyozw_win import get_vsproject_upgrade_command, get_vsproject_build_command, get_vsproject_prebuild_command
if 'vsproject_upgrade' in self.os_options and self.os_options['vsproject_upgrade']:
log.info("Upgrade openzwave project ... be patient ...")
proc = Popen(get_vsproject_upgrade_command(self.os_options),
stdout=PIPE, stderr=PIPE, cwd='{0}'.format(self.os_options['vsproject']))
Thread(target=stream_watcher, name='stdout-watcher',
args=('STDOUT', proc.stdout)).start()
Thread(target=stream_watcher, name='stderr-watcher',
args=('STDERR', proc.stderr)).start()

tprinter = Thread(target=printer, name='printer')
tprinter.start()
while tprinter.is_alive():
time.sleep(1)
tprinter.join()
#~ proc.wait()
from pyozw_win import get_clean_command, get_build_command

if 'vsproject_prebuild' in self.os_options and self.os_options['vsproject_prebuild']:
log.info("Update configuration of openzwave project ... be patient ...")
proc = Popen(get_vsproject_prebuild_command(self.os_options),
stdout=PIPE, stderr=PIPE, cwd='{0}'.format(self.os_options['vsproject']))
Thread(target=stream_watcher, name='stdout-watcher',
args=('STDOUT', proc.stdout)).start()
Thread(target=stream_watcher, name='stderr-watcher',
args=('STDERR', proc.stderr)).start()

tprinter = Thread(target=printer, name='printer')
tprinter.start()
while tprinter.is_alive():
time.sleep(1)
tprinter.join()
#~ proc.wait()
cwd = self.os_options['solution_path']
clean_command = get_clean_command(**self.os_options)
build_command = get_build_command(**self.os_options)

log.info("Cleaning openzwave project ... be patient ...")
proc = Popen(clean_command, stdout=PIPE, stderr=PIPE, cwd=cwd)
Thread(target=stream_watcher, name='stdout-watcher', args=('STDOUT', proc.stdout)).start()
Thread(target=stream_watcher, name='stderr-watcher', args=('STDERR', proc.stderr)).start()

tprinter = Thread(target=printer, name='printer')
tprinter.start()
while tprinter.is_alive():
time.sleep(1)
tprinter.join()

log.info("Build openzwave ... be patient ...")
proc = Popen(get_vsproject_build_command(self.os_options),
stdout=PIPE, stderr=PIPE, cwd='{0}'.format(self.os_options['vsproject']))
proc = Popen(build_command, stdout=PIPE, stderr=PIPE, cwd=cwd)

elif sys.platform.startswith("cygwin"):
log.info("Build openzwave ... be patient ...")
Expand Down
Loading

0 comments on commit 0d58df0

Please sign in to comment.