Mercurial > vim-unreal
annotate plugin/unreal.vim @ 8:5cd58b3fd93d
Clean-up project name before setting it, and do proper error reporting.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 26 Jan 2021 12:00:31 -0800 |
parents | 9235d8341a18 |
children | b5040cfea052 |
rev | line source |
---|---|
0 | 1 " unreal.vim - Work with the Unreal Engine in Vim |
2 " Maintainer: Ludovic Chabant <https://ludovic.chabant.com> | |
3 | |
4 " Globals {{{ | |
5 | |
6 if !(has('job') || (has('nvim') && exists('*jobwait'))) | |
7 echoerr "unreal: this plugin requires the job API from Vim8 or Neovim." | |
8 finish | |
9 endif | |
10 | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
11 let g:unreal_trace = get(g:, 'unreal_trace', 0) |
0 | 12 |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
13 let g:unreal_branch_dir_marker = get(g:, 'unreal_branch_dir_marker', '*.uprojectdirs') |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
14 let g:unreal_branch_dir_finder = get(g:, 'unreal_branch_dir_finder', '') |
0 | 15 let g:unreal_auto_find_project = get(g:, 'unreal_auto_find_project', 0) |
16 | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
17 let g:unreal_branch_projects = {} |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
18 |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
19 let g:unreal_branch_dir = get(g:, 'unreal_branch_dir', '') |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
20 let g:unreal_project = get(g:, 'unreal_project', '') |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
21 let g:unreal_platform = get(g:, 'unreal_platform', 'Win64') |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
22 let g:unreal_config_state = get(g:, 'unreal_config_state', 'Development') |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
23 let g:unreal_config_target = get(g:, 'unreal_config_target', 'Editor') |
0 | 24 |
25 let g:unreal_modules = get(g:, 'unreal_modules', []) | |
26 | |
27 let g:unreal_platforms = get(g:, 'unreal_platforms', [ | |
28 \"Win32", "Win64", "HoloLens", "Mac", "XboxOne", "PS4", "IOS", "Android", | |
29 \"HTML5", "Linux", "AllDesktop", "TVOS", "Switch" | |
30 \]) | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
31 let g:unreal_config_states = get(g:, 'unreal_config_states', [ |
0 | 32 \"Debug", "DebugGame", "Development", "Shipping", "Test" |
33 \]) | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
34 let g:unreal_config_targets = get(g:, 'unreal_config_targets', [ |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
35 \"", "Editor", "Client", "Server" |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
36 \]) |
0 | 37 let g:unreal_build_options = get(g:, 'unreal_build_options', [ |
38 \"-DisableUnity", "-ForceUnity" | |
39 \]) | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
40 let g:unreal_auto_build_modules = get(g:, 'unreal_auto_build_modules', { |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
41 \"ShaderCompileWorker": ["-Quiet"] |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
42 \}) |
0 | 43 let g:unreal_auto_build_options = get(g:, 'unreal_auto_build_options', [ |
44 \"-WaitMutex" | |
45 \]) | |
46 | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
47 let g:unreal_auto_generate_compilation_database = get(g:, 'unreal_auto_generate_compilation_database', 0) |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
48 |
0 | 49 " }}} |
50 | |
51 " Commands {{{ | |
52 | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
53 command! UnrealFindProject :call unreal#find_project() |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
54 command! -nargs=1 -complete=dir UnrealSetBranchDir :call unreal#set_branch_dir(<f-args>) |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
55 command! -nargs=1 -complete=customlist,unreal#complete_projects |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
56 \UnrealSetProject :call unreal#set_project(<f-args>) |
0 | 57 command! -nargs=1 -complete=customlist,unreal#complete_platforms |
58 \UnrealSetPlatform :call unreal#set_platform(<f-args>) | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
59 command! -nargs=1 -complete=customlist,unreal#complete_configs |
0 | 60 \UnrealSetConfig :call unreal#set_config(<f-args>) |
61 | |
62 command! UnrealGenerateProjectFiles :call unreal#generate_project_files() | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
63 command! UnrealGenerateCompilationDatabase :call unreal#generate_compilation_database() |
0 | 64 |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
65 command! -nargs=* -bang -complete=customlist,unreal#complete_build_args |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
66 \UnrealBuild :call unreal#build(<bang>0, <f-args>) |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
67 command! -nargs=* -bang -complete=customlist,unreal#complete_build_args |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
68 \UnrealRebuild :call unreal#rebuild(<bang>0, <f-args>) |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
69 command! -nargs=* -bang -complete=customlist,unreal#complete_build_args |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
70 \UnrealClean :call unreal#clean(<bang>0, <f-args>) |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
71 |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
72 command! UnrealReloadBranchProjects :call unreal#set_branch_dir(g:unreal_branch_dir) |
0 | 73 |
74 " }}} | |
75 | |
76 " Initialization {{{ | |
77 | |
78 call unreal#init() | |
79 | |
80 " }}} |