Skip to content

Commit

Permalink
3.1.1 (beryllium) RC2
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleteti committed Jan 29, 2019
1 parent 10f36ca commit 73573c0
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 57 deletions.
38 changes: 24 additions & 14 deletions dodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,30 +129,40 @@ def copy_sources():
copy2(file, output_folder + "\\ideexpert\\")


def copy_libs():
def copy_libs(ctx):
global output_folder

# loggerpro
header("Copying libraries: LoggerPro...")
curr_folder = output_folder + "\\lib\\loggerpro"
os.makedirs(curr_folder, exist_ok=True)
src = glob.glob("lib\\loggerpro\\*.pas")
for file in src:
print("Copying " + file + " to " + curr_folder)
copy2(file, curr_folder)
copy2("lib\\loggerpro\\LICENSE", curr_folder)
copy2("lib\\loggerpro\\VERSION.TXT", curr_folder)
if not ctx.run(rf"xcopy lib\loggerpro\*.* {curr_folder}\*.* /E /Y /R /V /F"):
raise Exception("Cannot copy loggerpro")

# dmustache
header("Copying libraries: dmustache...")
curr_folder = output_folder + "\\lib\\dmustache"
os.makedirs(curr_folder, exist_ok=True)
src = glob.glob("lib\\dmustache\\*.pas") + \
glob.glob("lib\\dmustache\\*.inc")
for file in src:
print("Copying " + file + " to " + curr_folder)
copy2(file, curr_folder)
copy2("lib\\dmustache\\README.md", curr_folder)
if not ctx.run(rf"xcopy lib\dmustache\*.* {curr_folder}\*.* /E /Y /R /V /F"):
raise Exception("Cannot copy dmustache")


# src = glob.glob("lib\\loggerpro\\*.pas")
# for file in src:
# print("Copying " + file + " to " + curr_folder)
# copy2(file, curr_folder)
# copy2("lib\\loggerpro\\LICENSE", curr_folder)
# copy2("lib\\loggerpro\\VERSION.TXT", curr_folder)
#
# # dmustache
# header("Copying libraries: dmustache...")
# curr_folder = output_folder + "\\lib\\dmustache"
# os.makedirs(curr_folder, exist_ok=True)
# src = glob.glob("lib\\dmustache\\*.pas") + \
# glob.glob("lib\\dmustache\\*.inc")
# for file in src:
# print("Copying " + file + " to " + curr_folder)
# copy2(file, curr_folder)
# copy2("lib\\dmustache\\README.md", curr_folder)


def init_build(version):
Expand Down
11 changes: 5 additions & 6 deletions samples/activerecord_crud/activerecord_crud.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<DCC_RemoteDebug>false</DCC_RemoteDebug>
<DCC_ExeOutput>D:\CORSI\ITDEVCON9 Testing Delphi With Python\samples\SUT\bin\</DCC_ExeOutput>
<VerInfo_Locale>1033</VerInfo_Locale>
<Manifest_File>(None)</Manifest_File>
<DCC_MapFile>3</DCC_MapFile>
<Debugger_RunParams>/mysql</Debugger_RunParams>
</PropertyGroup>
Expand Down Expand Up @@ -148,10 +146,11 @@
<Source Name="MainSource">activerecord_crud.dpr</Source>
</Source>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k250.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp250.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcboffice2k250.bpl">Embarcadero C++Builder Office 2000 Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcbofficexp250.bpl">Embarcadero C++Builder Office XP Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\DataExplorerDBXPluginEnt260.bpl">DBExpress Enterprise Data Explorer Integration</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k260.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp260.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcboffice2k260.bpl">Embarcadero C++Builder Office 2000 Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcbofficexp260.bpl">Embarcadero C++Builder Office XP Servers Package</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Deployment Version="3">
Expand Down
2 changes: 1 addition & 1 deletion sources/dmvcframeworkbuildconsts.inc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
const
DMVCFRAMEWORK_VERSION = '3.1.1 (beryllium) RC1';
DMVCFRAMEWORK_VERSION = '3.1.1 (beryllium) RC2';
129 changes: 93 additions & 36 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import glob
from shutil import copy2, rmtree
from datetime import datetime
import pathlib

# import markdown
# from markdown.extensions.tables import TableExtension
Expand All @@ -26,7 +27,7 @@

def get_delphi_projects_to_build(which='', delphi_version=DEFAULT_DELPHI_VERSION):
projects = []
dversion = 'd' + delphi_version.replace('.','')
dversion = 'd' + delphi_version.replace('.', '')
if not which or which == 'core':
projects += glob.glob(r"packages\{dversion}\*.groupproj".format(dversion=dversion))
if not which or which == 'tests':
Expand All @@ -38,9 +39,9 @@ def get_delphi_projects_to_build(which='', delphi_version=DEFAULT_DELPHI_VERSION

def build_delphi_project(ctx: context.Context, project_filename, config='DEBUG', delphi_version=DEFAULT_DELPHI_VERSION):
delphi_versions = {
"10.1": {"path": "18.0", "desc":"Delphi 10.1 Seattle"},
"10.2": {"path": "19.0", "desc":"Delphi 10.2 Tokyo"},
"10.3": {"path": "20.0", "desc":"Delphi 10.3 Rio"},
"10.1": {"path": "18.0", "desc": "Delphi 10.1 Seattle"},
"10.2": {"path": "19.0", "desc": "Delphi 10.2 Tokyo"},
"10.3": {"path": "20.0", "desc": "Delphi 10.3 Rio"},
}

assert delphi_version in delphi_versions, "Invalid Delphi version: " + delphi_version
Expand Down Expand Up @@ -97,52 +98,71 @@ def copy_sources():
print("Copying " + file + " to " + g_output_folder + "\\ideexpert")
copy2(file, g_output_folder + "\\ideexpert\\")

# copying packages
print("Copying DMVCFramework Delphi 10.1 Seattle packages...")
os.makedirs(g_output_folder + "\\packages\\d101", exist_ok=True)
copy2(r"packages\d101\dmvcframeworkRT.dpk", g_output_folder + "\\packages\\d101")
copy2(r"packages\d101\dmvcframeworkRT.dproj", g_output_folder + "\\packages\\d101")
files = [
"dmvcframeworkDTResource.rc",
"dmvcframework_group.groupproj",
"dmvcframeworkRT.dproj",
"dmvcframeworkRT.dpk",
"dmvcframeworkDT.dproj",
"dmvcframeworkDT.dpk"
]

# copying packages
print("Copying DMVCFramework Delphi 10.2 Tokyo packages...")
os.makedirs(g_output_folder + "\\packages\\d102", exist_ok=True)
copy2(r"packages\d102\dmvcframeworkRT.dpk", g_output_folder + "\\packages\\d102")
copy2(r"packages\d102\dmvcframeworkRT.dproj", g_output_folder + "\\packages\\d102")
folders = [
"d101",
"d102",
"d103"
]

print("Copying DMVCFramework Delphi 10.3 Rio packages...")
os.makedirs(g_output_folder + "\\packages\\d103", exist_ok=True)
copy2(r"packages\d103\dmvcframeworkRT.dpk", g_output_folder + "\\packages\\d103")
copy2(r"packages\d103\dmvcframeworkRT.dproj", g_output_folder + "\\packages\\d103")
for folder in folders:
print(f"Copying DMVCFramework Delphi {folder} packages...")
for file in files:
os.makedirs(g_output_folder + f"\\packages\\{folder}", exist_ok=True)
copy2(rf"packages\{folder}\{file}", g_output_folder + rf"\packages\{folder}")


def copy_libs():
def copy_libs(ctx):
global g_output_folder

# loggerpro
print("Copying libraries: LoggerPro...")
curr_folder = g_output_folder + "\\lib\\loggerpro"
os.makedirs(curr_folder, exist_ok=True)
src = glob.glob("lib\\loggerpro\\*.pas")
for file in src:
print("Copying " + file + " to " + curr_folder)
copy2(file, curr_folder)
copy2("lib\\loggerpro\\License.txt", curr_folder)
copy2("lib\\loggerpro\\VERSION.TXT", curr_folder)
if not ctx.run(rf"xcopy lib\loggerpro\*.* {curr_folder}\*.* /E /Y /R /V /F"):
raise Exception("Cannot copy loggerpro")

# dmustache
print("Copying libraries: dmustache...")
curr_folder = g_output_folder + "\\lib\\dmustache"
os.makedirs(curr_folder, exist_ok=True)
src = glob.glob("lib\\dmustache\\*.pas") + \
glob.glob("lib\\dmustache\\*.inc")
for file in src:
print("Copying " + file + " to " + curr_folder)
copy2(file, curr_folder)
copy2("lib\\dmustache\\README.md", curr_folder)
if not ctx.run(rf"xcopy lib\dmustache\*.* {curr_folder}\*.* /E /Y /R /V /F"):
raise Exception("Cannot copy dmustache")

# # loggerpro
# print("Copying libraries: LoggerPro...")
# curr_folder = g_output_folder + "\\lib\\loggerpro"
# os.makedirs(curr_folder, exist_ok=True)
# src = glob.glob("lib\\loggerpro\\*.pas")
# for file in src:
# print("Copying " + file + " to " + curr_folder)
# copy2(file, curr_folder)
# copy2("lib\\loggerpro\\License.txt", curr_folder)
# copy2("lib\\loggerpro\\VERSION.TXT", curr_folder)
#
#
#
# # dmustache
# print("Copying libraries: dmustache...")
# curr_folder = g_output_folder + "\\lib\\dmustache"
# os.makedirs(curr_folder, exist_ok=True)
# src = glob.glob("lib\\dmustache\\*.pas") + \
# glob.glob("lib\\dmustache\\*.inc")
# for file in src:
# print("Copying " + file + " to " + curr_folder)
# copy2(file, curr_folder)
# copy2("lib\\dmustache\\README.md", curr_folder)


def printkv(key, value):
print(Fore.RESET + (key + ': ').ljust(50) + Fore.GREEN + value + Fore.RESET)
print(Fore.RESET + key + ': ' + Fore.GREEN + value.rjust(50) + Fore.RESET)


def init_build(version):
Expand All @@ -152,8 +172,9 @@ def init_build(version):
global g_releases_path
g_version = version
g_output_folder = g_releases_path + "\\" + g_version
printkv("BUILD VERSION", g_version)
printkv('Output path', g_output_folder)
print(Fore.RESET + "BUILD VERSION".ljust(70) + g_version)
print(Fore.RESET + "OUTPUT PATH".ljust(70) + g_output_folder)

rmtree(g_output_folder, True)
os.makedirs(g_output_folder, exist_ok=True)
f = open(g_output_folder + "\\version.txt", "w")
Expand Down Expand Up @@ -212,6 +233,41 @@ def tests(ctx, delphi_version=DEFAULT_DELPHI_VERSION):
return res


@task
def clean(ctx):
global g_output_folder
import os
import glob
print(f"Cleaning from {g_output_folder}...")

output = pathlib.Path(g_output_folder)

rmtree(g_output_folder + r"\lib\loggerpro\Win32", True)
rmtree(g_output_folder + r"\lib\loggerpro\packages\d101\__history", True)
rmtree(g_output_folder + r"\lib\loggerpro\packages\d101\Win32\Debug", True)
rmtree(g_output_folder + r"\lib\loggerpro\packages\d102\__history", True)
rmtree(g_output_folder + r"\lib\loggerpro\packages\d102\Win32\Debug", True)
rmtree(g_output_folder + r"\lib\loggerpro\packages\d103\__history", True)
rmtree(g_output_folder + r"\lib\loggerpro\packages\d103\Win32\Debug", True)
rmtree(g_output_folder + r"\lib\dmustache\.git", True)

to_delete = []
to_delete += glob.glob(g_output_folder + r"\**\*.dcu", recursive=True)
to_delete += glob.glob(g_output_folder + r"\**\*.stat", recursive=True)
to_delete += glob.glob(g_output_folder + r"\**\*.res", recursive=True)
to_delete += glob.glob(g_output_folder + r"\**\*.map", recursive=True)
to_delete += glob.glob(g_output_folder + r"\**\*.~*", recursive=True)
to_delete += glob.glob(g_output_folder + r"\**\*.rsm", recursive=True)
to_delete += glob.glob(g_output_folder + r"\**\*.drc", recursive=True)
to_delete += glob.glob(g_output_folder + r"\**\*.log", recursive=True)
to_delete += glob.glob(g_output_folder + r"\**\*.local", recursive=True)
to_delete += glob.glob(g_output_folder + r"\**\*.gitignore", recursive=True)
to_delete += glob.glob(g_output_folder + r"\**\*.gitattributes", recursive=True)

for f in to_delete:
os.remove(f)


@task(pre=[tests])
def release(ctx, version="DEBUG", delphi_version=DEFAULT_DELPHI_VERSION, skip_build=False):
"""Builds all the projects, executes integration tests and prepare the release"""
Expand All @@ -220,7 +276,8 @@ def release(ctx, version="DEBUG", delphi_version=DEFAULT_DELPHI_VERSION, skip_bu
delphi_projects = get_delphi_projects_to_build('', delphi_version)
build_delphi_project_list(ctx, delphi_projects, version, '', delphi_version)
copy_sources()
copy_libs()
copy_libs(ctx)
clean(ctx)
zip_samples(version)
create_zip(ctx, version)

Expand Down

0 comments on commit 73573c0

Please sign in to comment.