2015-09-01 12:27:21 -04:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#include "BlueprintNativeCodeGenPCH.h"
|
2015-09-24 18:57:23 -04:00
|
|
|
#include "GenerateNativePluginFromBlueprintCommandlet.h"
|
2015-09-01 12:27:21 -04:00
|
|
|
#include "NativeCodeGenCommandlineParams.h"
|
|
|
|
|
#include "BlueprintNativeCodeGenCoordinator.h"
|
2015-09-04 13:35:03 -04:00
|
|
|
#include "BlueprintNativeCodeGenUtils.h"
|
2015-09-18 14:01:11 -04:00
|
|
|
#include "BlueprintNativeCodeGenManifest.h"
|
|
|
|
|
#include "FileManager.h"
|
2015-09-01 12:27:21 -04:00
|
|
|
|
|
|
|
|
/*******************************************************************************
|
2015-09-24 18:57:23 -04:00
|
|
|
* UGenerateNativePluginFromBlueprintCommandlet
|
2015-09-01 12:27:21 -04:00
|
|
|
*******************************************************************************/
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
2015-09-24 18:57:23 -04:00
|
|
|
UGenerateNativePluginFromBlueprintCommandlet::UGenerateNativePluginFromBlueprintCommandlet(FObjectInitializer const& ObjectInitializer)
|
2015-09-01 12:27:21 -04:00
|
|
|
: Super(ObjectInitializer)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
2015-09-24 18:57:23 -04:00
|
|
|
int32 UGenerateNativePluginFromBlueprintCommandlet::Main(FString const& Params)
|
2015-09-01 12:27:21 -04:00
|
|
|
{
|
|
|
|
|
TArray<FString> Tokens, Switches;
|
|
|
|
|
ParseCommandLine(*Params, Tokens, Switches);
|
|
|
|
|
|
|
|
|
|
FNativeCodeGenCommandlineParams CommandlineParams(Switches);
|
|
|
|
|
|
|
|
|
|
if (CommandlineParams.bHelpRequested)
|
|
|
|
|
{
|
|
|
|
|
UE_LOG(LogBlueprintCodeGen, Display, TEXT("%s"), *FNativeCodeGenCommandlineParams::HelpMessage);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-09 18:51:40 -04:00
|
|
|
FBlueprintNativeCodeGenUtils::FScopedFeedbackContext ScopedErrorTracker;
|
2015-09-24 18:57:23 -04:00
|
|
|
const bool bSuccess = FBlueprintNativeCodeGenUtils::GeneratePlugin(CommandlineParams);
|
|
|
|
|
|
|
|
|
|
return bSuccess && ScopedErrorTracker.HasErrors();
|
2015-09-01 12:27:21 -04:00
|
|
|
}
|
|
|
|
|
|