|
1 | 1 | // Copyright 2020 Gamemakin LLC. All Rights Reserved.
|
2 | 2 |
|
3 | 3 | #include "LinterCommandlet.h"
|
4 |
| -#include "AssetRegistryModule.h" |
5 |
| -#include "Engine/ObjectLibrary.h" |
| 4 | +#include "AssetRegistry/AssetRegistryModule.h" |
6 | 5 | #include "Dom/JsonObject.h"
|
7 | 6 | #include "Dom/JsonValue.h"
|
8 | 7 | #include "Interfaces/IPluginManager.h"
|
@@ -56,7 +55,11 @@ int32 ULinterCommandlet::Main(const FString& InParams)
|
56 | 55 | FLinterModule::TryToLoadAllLintRuleSets();
|
57 | 56 |
|
58 | 57 | TArray<FAssetData> FoundRuleSets;
|
| 58 | +#if UE_VERSION_NEWER_THAN(5, 1, 0) |
| 59 | + AssetRegistryModule.Get().GetAssetsByClass(ULintRuleSet::StaticClass()->GetClassPathName(), FoundRuleSets, true); |
| 60 | +#else |
59 | 61 | AssetRegistryModule.Get().GetAssetsByClass(ULintRuleSet::StaticClass()->GetFName(), FoundRuleSets, true);
|
| 62 | +#endif |
60 | 63 |
|
61 | 64 | for (const FAssetData& RuleSetData : FoundRuleSets)
|
62 | 65 | {
|
@@ -128,7 +131,11 @@ int32 ULinterCommandlet::Main(const FString& InParams)
|
128 | 131 | UniqueViolatorViolations[0].PopulateAssetData();
|
129 | 132 | AssetData = UniqueViolatorViolations[0].ViolatorAssetData;
|
130 | 133 | AssetJsonObject->SetStringField(TEXT("ViolatorAssetName"), AssetData.AssetName.ToString());
|
| 134 | +#if UE_VERSION_NEWER_THAN(5, 1, 0) |
| 135 | + AssetJsonObject->SetStringField(TEXT("ViolatorAssetPath"), AssetData.GetObjectPathString()); |
| 136 | +#else |
131 | 137 | AssetJsonObject->SetStringField(TEXT("ViolatorAssetPath"), AssetData.ObjectPath.ToString());
|
| 138 | +#endif |
132 | 139 | AssetJsonObject->SetStringField(TEXT("ViolatorFullName"), AssetData.GetFullName());
|
133 | 140 | //@TODO: Thumbnail export?
|
134 | 141 |
|
|
0 commit comments