File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ Ubuntu/Debian:
5353``` bash
5454$ cd my_project
5555$ cd UnigineEditorPlugin_Python3Scripting
56- $ ./build_plugin_linux.sh
56+ $ python3 build_plugin.py
5757```
5858
5959### step 5: run editor
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ # -*- coding: utf-8 -*-
3+
4+ import sys
5+ import os
6+ import platform
7+
8+
9+ _platform = platform .platform ().lower ()
10+ is_linux = False
11+ is_windows = False
12+ if _platform .startswith ("linux" ):
13+ _platform = "linux"
14+ is_linux = True
15+ elif _platform .startswith ("windows" ):
16+ _platform = "windows"
17+ is_windows = True
18+ else :
19+ sys .exit ("Unknown platform" )
20+
21+
22+
23+ build_commands = [
24+ {
25+ "name" : "cmake configure release" ,
26+ "command" : "cmake -H. -Bjunk/release -DCMAKE_BUILD_TYPE=Release \
27+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
28+ -DCMAKE_INSTALL_PREFIX=../bin" ,
29+ },
30+ {
31+ "name" : "cmake build release" ,
32+ "command" : "cmake --build junk/release --parallel 8 --config Release" ,
33+ },
34+ {
35+ "name" : "cmake configure debug" ,
36+ "command" : "cmake -H. -Bjunk/debug -DCMAKE_BUILD_TYPE=Debug \
37+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
38+ -DCMAKE_INSTALL_PREFIX=../bin" ,
39+ },
40+ {
41+ "name" : "cmake build debug" ,
42+ "command" : "cmake --build junk/debug --parallel 8 --config Debug" ,
43+ },
44+ ]
45+
46+ os .chdir ("UnigineEditorPlugin_Python3Scripting" )
47+
48+ for _cmd in build_commands :
49+ ret = os .system (_cmd ["command" ])
50+ if ret != 0 :
51+ sys .exit (- 1 )
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1919else :
2020 sys .exit ("Unknown platform" )
2121
22-
23- if is_linux :
24- ret = os .system ("./build_plugin_linux.sh" )
25-
26- if is_windows :
27- ret = os .system ("./build_plugin_windows.bat" )
28-
22+ ret = os .system ("python3 build_plugin.py" )
2923if ret != 0 :
3024 sys .exit ("Could not build..." )
3125
3529 _version = content .strip ()
3630
3731folder_inside = "UnigineEditorPlugin_Python3Scripting_" + _version
38- _zip_filename = _platform + "_UnigineEditorPlugin_Python3Scripting_ " + _version + ".zip"
32+ _zip_filename = _platform + "_ " + folder_inside + ".zip"
3933
4034if os .path .isfile (_zip_filename ):
4135 os .remove (_zip_filename )
You can’t perform that action at this time.
0 commit comments