-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate.py
More file actions
34 lines (26 loc) · 1.39 KB
/
Copy pathgenerate.py
File metadata and controls
34 lines (26 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from helpers import env, unreal, click
from helpers.util import *
@click.command()
@click.option('-n', '--name', envvar="CI_NAME", help="Name of the project (without .uproject/.uplugin)")
@click.option('-p', '--path', envvar="CI_PATH", type=click.Path(exists=True), help=f"{colors.OKCYAN}(default: current path){colors.ENDC} Path that contains all project files")
@click.option('-e', '--engine-path', envvar="CI_ENGINE_PATH", type=click.Path(exists=True), help=f"{colors.OKCYAN}(default: auto-discovered){colors.ENDC}")
@click.option('-i', '--ide', envvar="CI_IDE", type=click.Choice(unreal.IDE, case_sensitive=False), help=f"{colors.OKCYAN}(default: VisualStudio){colors.ENDC}")
def generate_project(name, path, engine_path, ide):
"""Generates project files for the desired IDE. """
if not ide:
ide = unreal.IDE.VisualStudio
project = env.Project(name, path)
ue = unreal.Unreal.from_project(project, engine_path)
config = unreal.GenerateProjectConfig()
config.ide = ide
print("-- Generating Project Files")
if ue.generate_project(project, config) != 0:
print("-- Failed to generate project files")
sys.exit(-1)
print("-- Generating Clang database")
if ue.generate_clang_db(project, config) != 0:
print("-- Failed to generate clang database")
sys.exit(-1)
print("-- Succeeded")
if __name__ == '__main__':
generate_project()