-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Xavrax <[email protected]>
- Loading branch information
1 parent
e9692e9
commit d4e72e9
Showing
3 changed files
with
112 additions
and
3 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Visual Studio 2015 user specific files | ||
.vs/ | ||
|
||
# Compiled Object files | ||
*.slo | ||
*.lo | ||
*.o | ||
*.obj | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
|
||
# Fortran module files | ||
*.mod | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
*.ipa | ||
|
||
# These project files can be generated by the engine | ||
*.xcodeproj | ||
*.xcworkspace | ||
*.sln | ||
*.suo | ||
*.opensdf | ||
*.sdf | ||
*.VC.db | ||
*.VC.opendb | ||
|
||
# Precompiled Assets | ||
SourceArt/**/*.png | ||
SourceArt/**/*.tga | ||
|
||
# Binary Files | ||
Binaries/* | ||
|
||
# Compiled source files for the engine to use | ||
Intermediate/* |
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,67 @@ | ||
import os | ||
import glob | ||
import itertools | ||
import shutil | ||
import json | ||
import zipfile | ||
|
||
print("Creating packages for Unreal Engine chat") | ||
supported_ue_versions = ["5.0.0", "5.1.0", "5.2.0", "5.3.0", "5.4.0"] | ||
|
||
print("Preparing files") | ||
|
||
current_dir = os.path.dirname(os.path.realpath(__file__)) | ||
temporary_dir = current_dir + "/../Pubnub/" | ||
|
||
shutil.copytree(current_dir, temporary_dir) | ||
|
||
os.remove(temporary_dir + "/LICENSE") | ||
os.remove(temporary_dir + "/make_packages.py") | ||
os.remove(temporary_dir + "/.gitignore") | ||
os.remove(temporary_dir + "/README.md") | ||
|
||
shutil.rmtree(temporary_dir + "/.github", ignore_errors=True) | ||
shutil.rmtree(temporary_dir + "/.git", ignore_errors=True) | ||
shutil.rmtree(temporary_dir + "/readme_content", ignore_errors=True) | ||
|
||
cpp_files = itertools.chain( | ||
glob.glob(temporary_dir + "/**/*.cpp", recursive=True), | ||
glob.glob(temporary_dir + "/**/*.hpp", recursive=True), | ||
glob.glob(temporary_dir + "/**/*.c", recursive=True), | ||
glob.glob(temporary_dir + "/**/*.h", recursive=True), | ||
) | ||
|
||
for version in supported_ue_versions: | ||
print("Creating package for Unreal Engine " + version) | ||
with open(temporary_dir + "/PubnubChat.uplugin", "r") as uplugin_file: | ||
uplugin = json.load(uplugin_file) | ||
uplugin["EngineVersion"] = version | ||
plugin_version = uplugin["VersionName"] | ||
with open( | ||
temporary_dir + "/PubnubChat.uplugin", "w" | ||
) as uplugin_file_write: | ||
json.dump(uplugin, uplugin_file_write, indent=4) | ||
|
||
zipf = zipfile.ZipFile( | ||
temporary_dir | ||
+ "../Pubnub-chat-" | ||
+ plugin_version | ||
+ "-ue" | ||
+ version | ||
+ ".zip", | ||
"w", | ||
zipfile.ZIP_DEFLATED, | ||
) | ||
|
||
for root, dirs, inner_files in os.walk(temporary_dir): | ||
for file in inner_files: | ||
zipf.write( | ||
os.path.join(root, file), | ||
os.path.relpath( | ||
os.path.join(root, file), os.path.join(temporary_dir, "..") | ||
), | ||
) | ||
|
||
zipf.close() | ||
|
||
shutil.rmtree(temporary_dir, ignore_errors=True) |