コード例 #1
0
//------------------------------------------------------------------------------
static bool BlueprintNativeCodeGenUtilsImpl::GeneratePluginDescFile(const FString& PluginName, const FBlueprintNativeCodeGenPaths& TargetPaths)
{
	FPluginDescriptor PluginDesc;
	PluginDesc.FriendlyName = PluginName;
	PluginDesc.CreatedBy    = TEXT("Epic Games, Inc.");
	PluginDesc.CreatedByURL = TEXT("http://epicgames.com");
	PluginDesc.Description  = TEXT("A programatically generated plugin which contains source files produced from Blueprint assets. The aim of this is to help performance by eliminating script overhead for the converted assets (using the source files in place of thier coresponding assets).");
	PluginDesc.DocsURL      = TEXT("@TODO");
	PluginDesc.SupportURL   = TEXT("https://answers.unrealengine.com/");
	PluginDesc.Category     = TEXT("Intermediate");
	PluginDesc.bEnabledByDefault  = true;
	PluginDesc.bCanContainContent = false;
	PluginDesc.bIsBetaVersion     = true; // @TODO: change once we're confident in the feature

	FModuleDescriptor RuntimeModuleDesc;
	RuntimeModuleDesc.Name = *TargetPaths.RuntimeModuleName();
	RuntimeModuleDesc.Type = EHostType::Runtime;
	// load at startup (during engine init), after game modules have been loaded 
	RuntimeModuleDesc.LoadingPhase = ELoadingPhase::Default;

	PluginDesc.Modules.Add(RuntimeModuleDesc);

	FText ErrorMessage;
	bool bSuccess = PluginDesc.Save(TargetPaths.PluginFilePath(), ErrorMessage);

	if (!bSuccess)
	{
		UE_LOG(LogBlueprintCodeGen, Error, TEXT("Failed to generate the plugin description file: %s"), *ErrorMessage.ToString());
	}
	return bSuccess;
}
コード例 #2
0
//------------------------------------------------------------------------------
static bool BlueprintNativeCodeGenUtilsImpl::WipeTargetPaths(const FBlueprintNativeCodeGenPaths& TargetPaths)
{
	IFileManager& FileManager = IFileManager::Get();

	bool bSuccess = true;
	bSuccess &= FileManager.Delete(*TargetPaths.PluginFilePath());
	bSuccess &= FileManager.DeleteDirectory(*TargetPaths.PluginSourceDir(), /*RequireExists =*/false, /*Tree =*/true);
	bSuccess &= FileManager.Delete(*TargetPaths.ManifestFilePath());

	return bSuccess;
}