2015-04-01 17:01:23 +02:00
|
|
|
# coding: latin-1
|
|
|
|
import subprocess
|
|
|
|
import os
|
|
|
|
import glob
|
2016-01-01 23:00:22 +01:00
|
|
|
from colorama import *
|
|
|
|
|
|
|
|
init()
|
2015-04-01 17:01:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
#################################################################################
|
2017-01-18 21:53:53 +01:00
|
|
|
def buildProject(project, platform = 'Win32'):
|
2016-11-18 14:09:54 +01:00
|
|
|
print(Fore.YELLOW + "Building " + project)
|
|
|
|
p = project.replace('.dproj', '.cfg')
|
|
|
|
if os.path.isfile(p):
|
|
|
|
if os.path.isfile(p + '.unused'):
|
|
|
|
os.remove(p + '.unused')
|
|
|
|
os.rename(p, p + '.unused')
|
|
|
|
# print os.system("msbuild /t:Build /p:Config=Debug \"" + project + "\"")
|
2017-01-18 21:53:53 +01:00
|
|
|
return subprocess.call("rsvars.bat & msbuild /t:Build /p:Config=Debug /p:Platform=" + platform + " \"" + project + "\"", shell=True) == 0
|
2015-04-01 17:01:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
def summaryTable(builds):
|
2016-11-18 14:09:54 +01:00
|
|
|
print(ansi.clear_screen())
|
|
|
|
dmvc_copyright()
|
|
|
|
print(Fore.WHITE + "PROJECT NAME".ljust(80) + "STATUS".ljust(10))
|
|
|
|
print(Fore.YELLOW + "=" * 90)
|
|
|
|
good = bad = 0
|
|
|
|
for item in builds:
|
2017-01-18 21:53:53 +01:00
|
|
|
if item['status'].startswith('ok'):
|
2016-11-18 14:09:54 +01:00
|
|
|
good += 1
|
|
|
|
else:
|
|
|
|
bad += 1
|
2017-01-18 21:53:53 +01:00
|
|
|
print(Fore.BLUE + item['project'].ljust(80) + (Fore.WHITE if item['status'].startswith('ok') else Fore.RED) + item['status'].ljust(4))
|
2016-01-01 23:00:22 +01:00
|
|
|
|
2016-11-18 14:09:54 +01:00
|
|
|
print(Fore.YELLOW + "=" * 90)
|
|
|
|
print(Fore.WHITE + "GOOD :".rjust(80) + str(good).rjust(10, '.'))
|
|
|
|
print(Fore.RED + "BAD :".rjust(80) + str(bad).rjust(10, '.'))
|
2015-04-01 17:01:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
#################################################################################
|
|
|
|
|
2016-01-01 23:00:22 +01:00
|
|
|
def main(projects):
|
|
|
|
dmvc_copyright()
|
|
|
|
builds = []
|
|
|
|
for project in projects:
|
|
|
|
filename = '\\'.join(project.split('\\')[-3:])
|
2017-01-18 21:53:53 +01:00
|
|
|
list = {'project': filename}
|
2016-11-18 14:09:54 +01:00
|
|
|
if project.find('delphistompclient') > -1 or project.find('contribsamples') > -1:
|
|
|
|
list['status'] = 'skip'
|
|
|
|
continue
|
|
|
|
|
2016-01-01 23:00:22 +01:00
|
|
|
list = {'project': filename}
|
|
|
|
if buildProject(project):
|
|
|
|
list["status"] = "ok"
|
|
|
|
else:
|
|
|
|
list["status"] = "ko"
|
|
|
|
builds.append(list)
|
2017-01-18 21:53:53 +01:00
|
|
|
|
|
|
|
if (os.path.exists(project + '.android')):
|
|
|
|
list = {'project': filename}
|
|
|
|
if buildProject(project, 'Android'):
|
|
|
|
list["status"] = "okandroid"
|
|
|
|
else:
|
|
|
|
list["status"] = "koandroid"
|
|
|
|
builds.append(list)
|
2016-01-01 23:00:22 +01:00
|
|
|
summaryTable(builds)
|
2015-04-01 17:01:23 +02:00
|
|
|
|
|
|
|
# Store current attribute settings
|
2016-01-01 23:00:22 +01:00
|
|
|
#old_setting = WConio.gettextinfo()[4] & 0x00FF
|
2015-04-01 17:01:23 +02:00
|
|
|
|
2016-01-01 23:00:22 +01:00
|
|
|
def dmvc_copyright():
|
|
|
|
print(Style.BRIGHT + Fore.WHITE + "----------------------------------------------------------------------------------------")
|
|
|
|
print(Fore.RED + " ** Delphi MVC Framework Building System **")
|
2017-01-05 12:44:34 +01:00
|
|
|
print(Fore.WHITE + "Delphi MVC Framework is CopyRight (2010-2017) of Daniele Teti and the DMVCFramework TEAM")
|
2016-01-01 23:00:22 +01:00
|
|
|
print(Fore.RESET + "----------------------------------------------------------------------------------------\n")
|
2015-04-01 17:01:23 +02:00
|
|
|
|
2016-01-01 23:00:22 +01:00
|
|
|
## MAIN ##
|
2016-11-13 20:59:21 +01:00
|
|
|
projects = glob.glob("ideexpert\*.dproj")
|
|
|
|
projects += glob.glob("unittests\**\*.dproj")
|
|
|
|
projects += glob.glob("*\**\*.dproj")
|
2016-11-18 14:09:54 +01:00
|
|
|
projects += glob.glob("*\**\**\*.dproj")
|
2016-01-01 23:00:22 +01:00
|
|
|
main(projects)
|
|
|
|
print(Style.RESET_ALL)
|