Skip to content

Commit

Permalink
fixed 4.17
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeioris committed Nov 28, 2018
1 parent b0dc3e5 commit c87bacf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
8 changes: 4 additions & 4 deletions Source/UnrealEnginePython/Private/UEPyModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3195,7 +3195,7 @@ UFunction *unreal_engine_add_function(UClass *u_class, char *name, PyObject *py_
prop_struct->Struct = TBaseStructure<FTransform>::Get();
prop = prop_struct;
}
#if ENGINE_MINOR_VERSION > 16
#if ENGINE_MINOR_VERSION > 17
else if ((PyTypeObject *)value == &ue_PyFQuatType)
{
UStructProperty *prop_struct = NewObject<UStructProperty>(function, UTF8_TO_TCHAR(p_name), RF_Public);
Expand Down Expand Up @@ -3248,7 +3248,7 @@ UFunction *unreal_engine_add_function(UClass *u_class, char *name, PyObject *py_
prop_base->SetPropertyClass(p_u_class);
prop = prop_base;
}
#if ENGINE_MINOR_VERSION > 16
#if ENGINE_MINOR_VERSION > 17
else if (py_obj->ue_object->IsA<UEnum>())
{
UEnumProperty *prop_enum = NewObject<UEnumProperty>(function, UTF8_TO_TCHAR(p_name), RF_Public);
Expand Down Expand Up @@ -3338,7 +3338,7 @@ UFunction *unreal_engine_add_function(UClass *u_class, char *name, PyObject *py_
prop_struct->Struct = TBaseStructure<FTransform>::Get();
prop = prop_struct;
}
#if ENGINE_MINOR_VERSION > 16
#if ENGINE_MINOR_VERSION > 17
else if ((PyTypeObject *)py_return_value == &ue_PyFQuatType)
{
UStructProperty *prop_struct = NewObject<UStructProperty>(function, UTF8_TO_TCHAR(p_name), RF_Public);
Expand Down Expand Up @@ -3391,7 +3391,7 @@ UFunction *unreal_engine_add_function(UClass *u_class, char *name, PyObject *py_
prop_base->SetPropertyClass(p_u_class);
prop = prop_base;
}
#if ENGINE_MINOR_VERSION > 16
#if ENGINE_MINOR_VERSION > 17
else if (py_obj->ue_object->IsA<UEnum>())
{
UEnumProperty *prop_enum = NewObject<UEnumProperty>(function, UTF8_TO_TCHAR(p_name), RF_Public);
Expand Down
26 changes: 14 additions & 12 deletions tools/release_win64.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
import shutil
import zipfile

UE_VERSIONS = ['4.15', '4.16', '4.17', '4.18', '4.19', '4.20']
PYTHON_VERSIONS = ["C:/Program Files/Python36", "C:/Program Files/Python37", "C:/Python27"]
UE_VERSIONS = ['4.15', '4.16', '4.17', '4.18', '4.19', '4.20', '4.21']
PYTHON_VERSIONS = ["C:/Program Files/Python37", "C:/Program Files/Python36", "C:/Python27"]
MSBUILD = 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/MSBuild/15.0/Bin/MSBuild.exe'
UE_PATH = 'C:/Program Files/Epic Games'
PROJECTS_PATH = 'C:/Users/rober/Documents/Unreal Projects'

RELEASE_DIR = sys.argv[1].rstrip('/')

Expand All @@ -20,28 +23,27 @@ def msbuild(project, python_version):
base_environ = os.environ
base_environ.update({'PYTHONHOME': python_version})
base_environ.update({'UEP_ENABLE_UNITY_BUILD': '1'})
#vs = '"C:/Program Files (x86)/MSBuild/14.0/Bin/MSBuild.exe"'
vs = '"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/MSBuild/15.0/Bin/MSBuild.exe"'
process = subprocess.Popen('{0} {1} /m /t:Rebuild /p:Configuration="Development Editor" /p:Platform=Win64'.format(vs, project), env=base_environ)
vs = '"{}"'.format(MSBUILD)
process = subprocess.Popen('{0} "{1}" /m /t:Rebuild /p:Configuration="Development Editor" /p:Platform=Win64'.format(vs, project), env=base_environ)
while process.poll() is None:
time.sleep(0.5)
if process.returncode != 0:
sys.exit(process.returncode)

def commandlet(version, project):
ue_editor = os.path.join('D:/', 'UE_{0}'.format(version), 'Engine/Binaries/Win64/UE4Editor-Cmd.exe')
process = subprocess.Popen('{0} D:/{1}/{2}.uproject -run=PyCommandlet D:/{3}/Plugins/UnrealEnginePython/tools/release_check.py'.format(ue_editor, project, project, project))
ue_editor = os.path.join(UE_PATH, 'UE_{0}'.format(version), 'Engine/Binaries/Win64/UE4Editor-Cmd.exe')
process = subprocess.Popen('{0} {1}/{2}/{3}.uproject -run=PyCommandlet {1}/{4}/Plugins/UnrealEnginePython/tools/release_check.py'.format(ue_editor, PROJECTS_PATH, project, project, project))
while process.poll() is None:
time.sleep(0.5)
# ignore return code, has too much different meanings for commandlets

def git(project):
process = subprocess.Popen('git checkout master', cwd='D:/{0}/Plugins/UnrealEnginePython'.format(project))
process = subprocess.Popen('git checkout master', cwd='{0}/{1}/Plugins/UnrealEnginePython'.format(PROJECTS_PATH, project))
while process.poll() is None:
time.sleep(0.5)
if process.returncode != 0:
sys.exit(process.returncode)
process = subprocess.Popen('git pull', cwd='D:/{0}/Plugins/UnrealEnginePython'.format(project))
process = subprocess.Popen('git pull', cwd='{0}/{1}/Plugins/UnrealEnginePython'.format(PROJECTS_PATH, project))
while process.poll() is None:
time.sleep(0.5)
if process.returncode != 0:
Expand All @@ -51,7 +53,7 @@ def git(project):
main_start = time.time()
for ue_version in UE_VERSIONS:
project = 'PyTest{0}'.format(ue_version.replace('.', ''))
sln = os.path.join('D:/', project, '{0}.sln'.format(project))
sln = os.path.join(PROJECTS_PATH, project, '{0}.sln'.format(project))
git(project)
for python_version in PYTHON_VERSIONS:
python_sanitized = os.path.basename(python_version).lower()
Expand All @@ -62,9 +64,9 @@ def git(project):
commandlet(ue_version, project)
end = time.time()
for item in ('UE4Editor.modules', 'UE4Editor-UnrealEnginePython.dll', 'UE4Editor-PythonConsole.dll', 'UE4Editor-PythonEditor.dll', 'UE4Editor-PythonAutomation.dll'):
shutil.copyfile('D:/{0}/Plugins/UnrealEnginePython/Binaries/Win64/{1}'.format(project, item), '{0}/UnrealEnginePython/Binaries/Win64/{1}'.format(RELEASE_DIR, item))
shutil.copyfile('{0}/{1}/Plugins/UnrealEnginePython/Binaries/Win64/{2}'.format(PROJECTS_PATH, project, item), '{0}/UnrealEnginePython/Binaries/Win64/{1}'.format(RELEASE_DIR, item))
if python_sanitized == 'python36':
shutil.copyfile('D:/{0}/Plugins/UnrealEnginePython/Binaries/Win64/{1}'.format(project, item), '{0}/Embedded/UnrealEnginePython/Binaries/Win64/{1}'.format(RELEASE_DIR, item))
shutil.copyfile('{0}/{1}/Plugins/UnrealEnginePython/Binaries/Win64/{2}'.format(PROJECTS_PATH, project, item), '{0}/Embedded/UnrealEnginePython/Binaries/Win64/{1}'.format(RELEASE_DIR, item))
filename = 'UnrealEnginePython_{0}_{1}_{2}_win64.zip'.format(os.path.basename(RELEASE_DIR), ue_version.replace('.','_'), python_sanitized)
zh = zipfile.ZipFile(os.path.join(RELEASE_DIR, filename), 'w', zipfile.ZIP_DEFLATED)
zipdir(os.path.join(RELEASE_DIR, 'UnrealEnginePython'), zh, RELEASE_DIR)
Expand Down

0 comments on commit c87bacf

Please sign in to comment.