I consider this a functionality bug, but if functionality is works-as-intended, then I believe this is at least a documentation bug.
I am running Unreal Editor 4.18.0-3709383+++UE4+Release-4.18 on Mac OS X 10.12.6 (16G29) with XCode 9.1 (9B55) and VS Code 1.18.0 installed. The plugin I am testing with is the open source UnrealJS plugin, which I added to my project with git clone https://.com/ncsoft/Unreal.js-core <MyProject>/Plugins/UnrealJS
The plugin documentation explains:
“If the plugin contains modules that have Source folders… plugin code will be automatically added to generated C++ project files… Whenever you compile your game project, any plugins that have Source available will also be compiled as a synthetic dependency of your game”. This appears to be accurate for initial builds of a plugin.
It does not appear to be accurate for rebuilds of a plugin. In my testing, on rebuilds, “compiling” the game project as the documentation suggests does not result in compiling plugins.
UnrealJS runs this code in StartupModule()
:
GLog->Log(NAME_JavascriptCmd, ELogVerbosity::Log, *FString::Printf(TEXT("Unreal.js started. V8 %d.%d.%d"), V8_MAJOR_VERSION, V8_MINOR_VERSION, V8_BUILD_NUMBER));
I use this line to test whether UnrealJS has been rebuilt, by adding a number to the end of the TEXT string. I tested with “Source Code Editor” set to both XCode and VS Code. The results of my tests are:
Using VS Code on mac: Nothing I do seems to be able to trigger a rebuild of the plugin.
Using XCode on mac: Altering the plugin code and running “build” inside XCode does nothing and I do not see the updated line printed in the console. However, if I “build” inside XCode, then close and reopen Unreal Editor, I get this dialog:
After this dialog is shown, a bar is shown inside Unreal indicating that the project is being rebuilt. After THIS, I see the log line with the new text correctly printed in the console. Although I am able to rebuild the plugin this way, I am bothered that (1) The documentation does not indicate Unreal must be relaunched (2) It is inconvenient to relaunch Unreal (3) It is concerning this method is not consistent between source editors.
Using the command line?: If I search “rebuild unreal plugin” on google, the top hit is this AnswerHub question, where the advice is given to delete the “Intermediate” and “Binaries” folders of the plugin then reopen Unreal Editor. In my testing, doing a git clean xffd of the Plugin folder does force a plugin rebuild. However (1) the documentation does not indicate this (2) reopening Unreal engine is inconvenient (3) this is not a very good method because it means you cannot do incremental builds of plugins (this is effectively a clean build every time).
To sum up, my expected behavior is that there should be a convenient way to rebuild or force a rebuild of a in-project plugin, the method should be consistent regardless of source editor, the method should support plugin hotloading, and the method should be documented. The most important of these things is that the process should be documented in the plugin documentation.