|
@@ -169,7 +169,7 @@ namespace AssetProcessor
|
|
|
UNIT_TEST_EXPECT_FALSE(gameName.isEmpty());
|
|
|
// should create cache folder in the root, and read everything from there.
|
|
|
|
|
|
- // There is a sub-case of handling mixed cases, but is only supported on case-insensitive filesystems.
|
|
|
+ // There is a sub-case of handling mixed cases, but is only supported on case-insensitive filesystems.
|
|
|
#if defined(AZ_PLATFORM_LINUX)
|
|
|
// Linux is case-sensitive, so 'basefile.txt' will stay the same case as the other subfolder versions
|
|
|
constexpr const char* subfolder3BaseFilePath = "subfolder3/basefile.txt";
|
|
@@ -190,7 +190,7 @@ namespace AssetProcessor
|
|
|
expectedFiles << tempPath.absoluteFilePath("subfolder2/aaa/bbb/ccc/basefile.txt");
|
|
|
expectedFiles << tempPath.absoluteFilePath("subfolder2/aaa/bbb/ccc/ddd/basefile.txt");
|
|
|
|
|
|
- expectedFiles << tempPath.absoluteFilePath(subfolder3BaseFilePath);
|
|
|
+ expectedFiles << tempPath.absoluteFilePath(subfolder3BaseFilePath);
|
|
|
|
|
|
expectedFiles << tempPath.absoluteFilePath("subfolder8/a/b/c/test.txt");
|
|
|
|
|
@@ -259,6 +259,7 @@ namespace AssetProcessor
|
|
|
config.AddScanFolder(ScanFolderInfo(tempPath.filePath("subfolder1"), "subfolder1", "subfolder1", false, true, platforms, -1)); // subfolder1 overrides root
|
|
|
config.AddScanFolder(ScanFolderInfo(tempPath.absolutePath(), "temp", "tempfolder", true, false, platforms, 0)); // add the root
|
|
|
|
|
|
+ config.AddIntermediateScanFolder();
|
|
|
|
|
|
config.AddMetaDataType("exportsettings", QString());
|
|
|
|
|
@@ -465,9 +466,14 @@ namespace AssetProcessor
|
|
|
UNIT_TEST_EXPECT_TRUE(processResults[checkIdx].m_jobEntry.m_watchFolderPath == AssetUtilities::NormalizeFilePath(watchFolderPath));
|
|
|
UNIT_TEST_EXPECT_TRUE(processResults[checkIdx].m_jobEntry.m_pathRelativeToWatchFolder == "uniquefile.txt");
|
|
|
UNIT_TEST_EXPECT_TRUE(processResults[checkIdx].m_jobEntry.m_databaseSourceName == "uniquefile.txt");
|
|
|
+
|
|
|
QString platformFolder = cacheRoot.filePath(QString::fromUtf8(processResults[checkIdx].m_jobEntry.m_platformInfo.m_identifier.c_str()));
|
|
|
platformFolder = AssetUtilities::NormalizeDirectoryPath(platformFolder);
|
|
|
- UNIT_TEST_EXPECT_TRUE(processResults[checkIdx].m_destinationPath.startsWith(platformFolder));
|
|
|
+ AZ::IO::Path expectedCachePath = normalizedCacheRootDir.absoluteFilePath(platformFolder).toUtf8().constData();
|
|
|
+ AZ::IO::FixedMaxPath intermediateAssetsFolder = AssetUtilities::GetIntermediateAssetsFolder(normalizedCacheRoot.toUtf8().constData());
|
|
|
+
|
|
|
+ UNIT_TEST_EXPECT_TRUE(processResults[checkIdx].m_cachePath == expectedCachePath);
|
|
|
+ UNIT_TEST_EXPECT_TRUE(processResults[checkIdx].m_intermediatePath == intermediateAssetsFolder);
|
|
|
UNIT_TEST_EXPECT_TRUE(processResults[checkIdx].m_jobEntry.m_computedFingerprint != 0);
|
|
|
|
|
|
QMetaObject::invokeMethod(&apm, "OnJobStatusChanged", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[checkIdx].m_jobEntry), Q_ARG(JobStatus, JobStatus::Queued));
|
|
@@ -651,6 +657,15 @@ namespace AssetProcessor
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // Takes an absolute cache path and returns the portion after cache/platform/
|
|
|
+ auto absProductPathToRelative = [&cacheRoot](QString absolutePath) -> AZStd::string
|
|
|
+ {
|
|
|
+ AZ::IO::Path platformRelativePath = absolutePath.toUtf8().constData();
|
|
|
+ platformRelativePath = platformRelativePath.LexicallyRelative(cacheRoot.absolutePath().toUtf8().constData());
|
|
|
+
|
|
|
+ return (*++platformRelativePath.begin()).StringAsPosix();
|
|
|
+ };
|
|
|
+
|
|
|
// ---------- test successes ----------
|
|
|
|
|
|
|
|
@@ -665,8 +680,8 @@ namespace AssetProcessor
|
|
|
//Invoke Asset Processed for android platform , txt files job description
|
|
|
AssetBuilderSDK::ProcessJobResponse response;
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts[0].toUtf8().constData(), AZ::Uuid::CreateNull(), 1));
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts[1].toUtf8().constData(), AZ::Uuid::CreateNull(), 2));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(androidouts[0]), AZ::Uuid::CreateNull(), 1));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(androidouts[1]), AZ::Uuid::CreateNull(), 2));
|
|
|
|
|
|
// make sure legacy SubIds get stored in the DB and in asset response messages.
|
|
|
// also make sure they don't get filed for the wrong asset.
|
|
@@ -792,7 +807,7 @@ namespace AssetProcessor
|
|
|
//Invoke Asset Processed for android platform , txt files2 job description
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(androidouts[0])));
|
|
|
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[1].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
@@ -816,7 +831,7 @@ namespace AssetProcessor
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(pcouts[0])));
|
|
|
|
|
|
//Invoke Asset Processed for pc platform , txt files job description
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[2].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
@@ -844,7 +859,7 @@ namespace AssetProcessor
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(pcouts[0])));
|
|
|
|
|
|
//Invoke Asset Processed for pc platform , txt files 2 job description
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[3].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
@@ -952,7 +967,7 @@ namespace AssetProcessor
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(pcouts[0])));
|
|
|
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[0].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
@@ -1010,8 +1025,11 @@ namespace AssetProcessor
|
|
|
UNIT_TEST_EXPECT_TRUE(AssetUtilities::NormalizeFilePath(processFile1) == AssetUtilities::NormalizeFilePath(absolutePath));
|
|
|
QString platformFolder = cacheRoot.filePath(QString::fromUtf8(processResults[checkIdx].m_jobEntry.m_platformInfo.m_identifier.c_str()));
|
|
|
platformFolder = AssetUtilities::NormalizeDirectoryPath(platformFolder);
|
|
|
- processFile1 = processResults[checkIdx].m_destinationPath;
|
|
|
- UNIT_TEST_EXPECT_TRUE(processFile1.startsWith(platformFolder));
|
|
|
+ AZ::IO::Path expectedCachePath = normalizedCacheRootDir.absoluteFilePath(platformFolder).toUtf8().constData();
|
|
|
+ AZ::IO::FixedMaxPath intermediateAssetsFolder = AssetUtilities::GetIntermediateAssetsFolder(normalizedCacheRoot.toUtf8().constData());
|
|
|
+
|
|
|
+ UNIT_TEST_EXPECT_TRUE(processResults[checkIdx].m_cachePath == expectedCachePath);
|
|
|
+ UNIT_TEST_EXPECT_TRUE(processResults[checkIdx].m_intermediatePath == intermediateAssetsFolder);
|
|
|
UNIT_TEST_EXPECT_TRUE(processResults[checkIdx].m_jobEntry.m_computedFingerprint != 0);
|
|
|
}
|
|
|
|
|
@@ -1047,22 +1065,22 @@ namespace AssetProcessor
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(androidouts[0])));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[0].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts2[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(androidouts2[0])));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[1].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(pcouts[0])));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[2].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts2[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(pcouts2[0])));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[3].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
// let events bubble through:
|
|
@@ -1146,37 +1164,45 @@ namespace AssetProcessor
|
|
|
UNIT_TEST_EXPECT_TRUE((processResults[3].m_jobEntry.m_platformInfo.m_identifier == "pc"));
|
|
|
UNIT_TEST_EXPECT_TRUE(processResults[0].m_jobEntry.m_computedFingerprint != 0);
|
|
|
|
|
|
+ auto verifyProductPaths = [&cacheRoot, this](const JobDetails& jobDetails)
|
|
|
+ {
|
|
|
+ QString platformFolder = cacheRoot.filePath(QString::fromUtf8(jobDetails.m_jobEntry.m_platformInfo.m_identifier.c_str()));
|
|
|
+ platformFolder = AssetUtilities::NormalizeDirectoryPath(platformFolder);
|
|
|
+ AZ::IO::Path expectedCachePath = cacheRoot.absoluteFilePath(platformFolder).toUtf8().constData();
|
|
|
+ AZ::IO::FixedMaxPath intermediateAssetsFolder = AssetUtilities::GetIntermediateAssetsFolder(cacheRoot.absolutePath().toUtf8().constData());
|
|
|
+
|
|
|
+ UNIT_TEST_EXPECT_TRUE(jobDetails.m_cachePath == expectedCachePath);
|
|
|
+ UNIT_TEST_EXPECT_TRUE(jobDetails.m_intermediatePath == intermediateAssetsFolder);
|
|
|
+ };
|
|
|
+
|
|
|
// send all the done messages simultaneously:
|
|
|
for (int checkIdx = 0; checkIdx < 4; ++checkIdx)
|
|
|
{
|
|
|
QString processFile1 = processResults[checkIdx].m_jobEntry.GetAbsoluteSourcePath();
|
|
|
UNIT_TEST_EXPECT_TRUE(AssetUtilities::NormalizeFilePath(processFile1) == AssetUtilities::NormalizeFilePath(absolutePath));
|
|
|
- QString platformFolder = cacheRoot.filePath(QString::fromUtf8(processResults[checkIdx].m_jobEntry.m_platformInfo.m_identifier.c_str()));
|
|
|
- platformFolder = AssetUtilities::NormalizeDirectoryPath(platformFolder);
|
|
|
- processFile1 = processResults[checkIdx].m_destinationPath;
|
|
|
- UNIT_TEST_EXPECT_TRUE(processFile1.startsWith(platformFolder));
|
|
|
+ verifyProductPaths(processResults[checkIdx]);
|
|
|
UNIT_TEST_EXPECT_TRUE(processResults[checkIdx].m_jobEntry.m_computedFingerprint != 0);
|
|
|
}
|
|
|
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(androidouts[0])));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[0].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts2[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(androidouts2[0])));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[1].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(pcouts[0])));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[2].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts2[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(pcouts2[0])));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[3].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
// let events bubble through:
|
|
@@ -1212,22 +1238,22 @@ namespace AssetProcessor
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(androidouts[0])));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[0].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts2[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(androidouts2[0])));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[1].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(pcouts[0])));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[2].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts2[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(pcouts2[0])));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[3].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
// let events bubble through:
|
|
@@ -1329,23 +1355,23 @@ namespace AssetProcessor
|
|
|
// send both done messages simultaneously!
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(androidouts[0])));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[0].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts2[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(androidouts2[0])));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[1].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
// send one failure only for PC :
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(pcouts[0])));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetFailed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[2].m_jobEntry));
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts2[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(pcouts2[0])));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[3].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
// let events bubble through:
|
|
@@ -1451,7 +1477,7 @@ namespace AssetProcessor
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(pcouts[0])));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[0].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
// let events bubble through:
|
|
@@ -1493,9 +1519,9 @@ namespace AssetProcessor
|
|
|
//Invoke Asset Processed for pc platform , txt files job description
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts[0].toUtf8().constData(), AZ::Uuid::CreateNull(), 1));
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts[1].toUtf8().constData(), AZ::Uuid::CreateNull(), 2));
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts[2].toUtf8().constData(), AZ::Uuid::CreateNull(), 3));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(pcouts[0]), AZ::Uuid::CreateNull(), 1));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(pcouts[1]), AZ::Uuid::CreateNull(), 2));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(pcouts[2]), AZ::Uuid::CreateNull(), 3));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[0].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
// let events bubble through:
|
|
@@ -1548,22 +1574,22 @@ namespace AssetProcessor
|
|
|
// send all the done messages simultaneously:
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts[0].toUtf8().constData(), AZ::Uuid::CreateNull(), 1));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(androidouts[0]), AZ::Uuid::CreateNull(), 1));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[0].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts2[0].toUtf8().constData(), AZ::Uuid::CreateNull(), 2));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(androidouts2[0]), AZ::Uuid::CreateNull(), 2));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[1].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts[0].toUtf8().constData(), AZ::Uuid::CreateNull(), 3));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(pcouts[0]), AZ::Uuid::CreateNull(), 3));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[2].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts2[0].toUtf8().constData(), AZ::Uuid::CreateNull(), 4));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(absProductPathToRelative(pcouts2[0]), AZ::Uuid::CreateNull(), 4));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[3].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
|
// let events bubble through:
|
|
@@ -1630,10 +1656,7 @@ namespace AssetProcessor
|
|
|
{
|
|
|
QString processFile1 = processResults[checkIdx].m_jobEntry.GetAbsoluteSourcePath();
|
|
|
UNIT_TEST_EXPECT_TRUE(processFile1 == expectedReplacementInputFile);
|
|
|
- QString platformFolder = cacheRoot.filePath(QString::fromUtf8(processResults[checkIdx].m_jobEntry.m_platformInfo.m_identifier.c_str()));
|
|
|
- platformFolder = AssetUtilities::NormalizeDirectoryPath(platformFolder);
|
|
|
- processFile1 = processResults[checkIdx].m_destinationPath;
|
|
|
- UNIT_TEST_EXPECT_TRUE(processFile1.startsWith(platformFolder));
|
|
|
+ verifyProductPaths(processResults[checkIdx]);
|
|
|
UNIT_TEST_EXPECT_TRUE(processResults[checkIdx].m_jobEntry.m_computedFingerprint != 0);
|
|
|
}
|
|
|
#endif // defined(AZ_PLATFORM_LINUX)
|
|
@@ -1690,11 +1713,13 @@ namespace AssetProcessor
|
|
|
for (const auto& processResult : processResults)
|
|
|
{
|
|
|
++resultIdx;
|
|
|
- QString outputFile = normalizedCacheRootDir.absoluteFilePath(processResult.m_destinationPath + "/doesn'tmatter.dds" + processResult.m_jobEntry.m_jobKey);
|
|
|
+ AZStd::string filename = ("doesn'tmatter.dds" + processResult.m_jobEntry.m_jobKey).toUtf8().constData();
|
|
|
+ QString outputFile = (processResult.m_cachePath / filename).AsPosix().c_str();
|
|
|
CreateDummyFile(outputFile);
|
|
|
response = {};
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(outputFile.toUtf8().constData(), AZ::Uuid::CreateNull(), resultIdx));
|
|
|
+ response.m_outputProducts.push_back(
|
|
|
+ AssetBuilderSDK::JobProduct((processResult.m_relativePath / filename).StringAsPosix(), AZ::Uuid::CreateNull(), resultIdx));
|
|
|
apm.AssetProcessed(processResult.m_jobEntry, response);
|
|
|
}
|
|
|
|
|
@@ -1717,7 +1742,7 @@ namespace AssetProcessor
|
|
|
UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "pc") || (processResults[1].m_jobEntry.m_platformInfo.m_identifier == "android"));
|
|
|
|
|
|
processResults.clear();
|
|
|
-
|
|
|
+
|
|
|
// ------------- Test querying asset status -------------------
|
|
|
{
|
|
|
absolutePath = tempPath.absoluteFilePath("subfolder2/folder/ship.tiff");
|
|
@@ -1729,13 +1754,15 @@ namespace AssetProcessor
|
|
|
for (const JobDetails& processResult : processResults)
|
|
|
{
|
|
|
++resultIdx;
|
|
|
- QString outputFile = normalizedCacheRootDir.absoluteFilePath(processResult.m_destinationPath + "/ship_nrm.dds");
|
|
|
+ AZStd::string filename = "ship_nrm.dds";
|
|
|
+ QString outputFile = (processResult.m_cachePath / filename).AsPosix().c_str();
|
|
|
|
|
|
CreateDummyFile(outputFile);
|
|
|
|
|
|
AssetBuilderSDK::ProcessJobResponse jobResponse;
|
|
|
jobResponse.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- jobResponse.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(outputFile.toUtf8().constData(), AZ::Uuid::CreateNull(), resultIdx));
|
|
|
+ jobResponse.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(
|
|
|
+ (processResult.m_relativePath / filename).StringAsPosix(), AZ::Uuid::CreateNull(), resultIdx));
|
|
|
|
|
|
apm.AssetProcessed(processResult.m_jobEntry, jobResponse);
|
|
|
}
|
|
@@ -1824,12 +1851,13 @@ namespace AssetProcessor
|
|
|
for (int index = 0; index < processResults.size(); ++index)
|
|
|
{
|
|
|
QFileInfo fi(processResults[index].m_jobEntry.GetAbsoluteSourcePath());
|
|
|
- QString pcout = QDir(processResults[index].m_destinationPath).absoluteFilePath(fi.fileName());
|
|
|
+ AZStd::string filename = fi.fileName().toUtf8().constData();
|
|
|
+ QString pcout = (processResults[index].m_cachePath / filename).c_str();
|
|
|
UNIT_TEST_EXPECT_TRUE(CreateDummyFile(pcout, "products."));
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcout.toUtf8().constData(), AZ::Uuid::CreateNull(), index));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct((processResults[index].m_relativePath / filename).StringAsPosix(), AZ::Uuid::CreateNull(), index));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[index].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
}
|
|
|
|
|
@@ -1880,12 +1908,14 @@ namespace AssetProcessor
|
|
|
for (int index = 0; index < processResults.size(); ++index)
|
|
|
{
|
|
|
QFileInfo fi(processResults[index].m_jobEntry.GetAbsoluteSourcePath());
|
|
|
- QString pcout = QDir(processResults[index].m_destinationPath).absoluteFilePath(fi.fileName());
|
|
|
+ AZStd::string filename = fi.fileName().toUtf8().constData();
|
|
|
+ QString pcout = (processResults[index].m_cachePath / filename).c_str();
|
|
|
UNIT_TEST_EXPECT_TRUE(CreateDummyFile(pcout, "products."));
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcout.toUtf8().constData(), AZ::Uuid::CreateNull(), index));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(
|
|
|
+ (processResults[index].m_relativePath / filename).StringAsPosix(), AZ::Uuid::CreateNull(), index));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[index].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
}
|
|
|
|
|
@@ -1941,12 +1971,14 @@ namespace AssetProcessor
|
|
|
for (int index = 0; index < processResults.size(); ++index)
|
|
|
{
|
|
|
QFileInfo fi(processResults[index].m_jobEntry.GetAbsoluteSourcePath());
|
|
|
- QString pcout = QDir(processResults[index].m_destinationPath).absoluteFilePath(fi.fileName());
|
|
|
+ AZStd::string filename = fi.fileName().toUtf8().constData();
|
|
|
+ QString pcout = (processResults[index].m_cachePath / filename).c_str();
|
|
|
UNIT_TEST_EXPECT_TRUE(CreateDummyFile(pcout, "products."));
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcout.toUtf8().constData(), AZ::Uuid::CreateNull(), index));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(
|
|
|
+ (processResults[index].m_relativePath / filename).StringAsPosix(), AZ::Uuid::CreateNull(), index));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[index].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
}
|
|
|
|
|
@@ -1996,12 +2028,14 @@ namespace AssetProcessor
|
|
|
for (int index = 0; index < processResults.size(); ++index)
|
|
|
{
|
|
|
QFileInfo fi(processResults[index].m_jobEntry.GetAbsoluteSourcePath());
|
|
|
- QString pcout = QDir(processResults[index].m_destinationPath).absoluteFilePath(fi.fileName());
|
|
|
+ AZStd::string filename = fi.fileName().toUtf8().constData();
|
|
|
+ QString pcout = (processResults[index].m_cachePath / filename).c_str();
|
|
|
UNIT_TEST_EXPECT_TRUE(CreateDummyFile(pcout, "products."));
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcout.toUtf8().constData(), AZ::Uuid::CreateNull(), index));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(
|
|
|
+ (processResults[index].m_relativePath / filename).StringAsPosix(), AZ::Uuid::CreateNull(), index));
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[index].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
}
|
|
|
|
|
@@ -2055,13 +2089,18 @@ namespace AssetProcessor
|
|
|
// this time, ouput 2 files for each job instead of just one:
|
|
|
QFileInfo fi(processResults[index].m_jobEntry.GetAbsoluteSourcePath());
|
|
|
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(QDir(processResults[index].m_destinationPath).absoluteFilePath(fi.fileName() + ".0.txt").toUtf8().constData(), AZ::Uuid::CreateNull(), index));
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(QDir(processResults[index].m_destinationPath).absoluteFilePath(fi.fileName() + ".1.txt").toUtf8().constData(), AZ::Uuid::CreateNull(), index + 100));
|
|
|
+ AZStd::string filename0 = (fi.fileName() + ".0.txt").toUtf8().constData();
|
|
|
+ AZStd::string filename1 = (fi.fileName() + ".1.txt").toUtf8().constData();
|
|
|
+
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(
|
|
|
+ (processResults[index].m_relativePath / filename0).StringAsPosix(), AZ::Uuid::CreateNull(), index));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(
|
|
|
+ (processResults[index].m_relativePath / filename1).StringAsPosix(), AZ::Uuid::CreateNull(), index + 100));
|
|
|
|
|
|
- createdDummyFiles.push_back(response.m_outputProducts[0].m_productFileName.c_str()); // we're only gong to delete this one out of the two, which is why we don't push the other one.
|
|
|
+ createdDummyFiles.push_back((processResults[index].m_cachePath / filename0).c_str()); // we're only gong to delete this one out of the two, which is why we don't push the other one.
|
|
|
|
|
|
- UNIT_TEST_EXPECT_TRUE(CreateDummyFile(response.m_outputProducts[0].m_productFileName.c_str(), "product 0"));
|
|
|
- UNIT_TEST_EXPECT_TRUE(CreateDummyFile(response.m_outputProducts[1].m_productFileName.c_str(), "product 1"));
|
|
|
+ UNIT_TEST_EXPECT_TRUE(CreateDummyFile((processResults[index].m_cachePath / filename0).c_str(), "product 0"));
|
|
|
+ UNIT_TEST_EXPECT_TRUE(CreateDummyFile((processResults[index].m_cachePath / filename1).c_str(), "product 1"));
|
|
|
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[index].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
}
|
|
@@ -2094,8 +2133,11 @@ namespace AssetProcessor
|
|
|
// this time, ouput only one file for each job instead of just one:
|
|
|
QFileInfo fi(processResults[index].m_jobEntry.GetAbsoluteSourcePath());
|
|
|
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(QDir(processResults[index].m_destinationPath).absoluteFilePath(fi.fileName() + ".1.txt").toUtf8().constData(), AZ::Uuid::CreateNull(), index));
|
|
|
- UNIT_TEST_EXPECT_TRUE(CreateDummyFile(response.m_outputProducts[0].m_productFileName.c_str(), "product 1 changed"));
|
|
|
+ AZStd::string filename = (fi.fileName() + ".1.txt").toUtf8().constData();
|
|
|
+
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(
|
|
|
+ (processResults[index].m_relativePath / filename).StringAsPosix(), AZ::Uuid::CreateNull(), index));
|
|
|
+ UNIT_TEST_EXPECT_TRUE(CreateDummyFile((processResults[index].m_cachePath / filename).c_str(), "product 1 changed"));
|
|
|
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[index].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
}
|
|
@@ -2255,6 +2297,8 @@ namespace AssetProcessor
|
|
|
config.AddScanFolder(ScanFolderInfo(tempPath.filePath("subfolder1"), "subfolder1", "subfolder1", false, true, platforms,-1)); // subfolder1 overrides root
|
|
|
config.AddScanFolder(ScanFolderInfo(tempPath.absolutePath(), "temp", "tempfolder", true, false, platforms, 0)); // add the root
|
|
|
|
|
|
+ config.AddIntermediateScanFolder();
|
|
|
+
|
|
|
AssetProcessorManager_Test apm(&config);
|
|
|
|
|
|
QDir cacheRoot;
|
|
@@ -2325,8 +2369,8 @@ namespace AssetProcessor
|
|
|
// Invoke Asset Processed for pc platform for the first job
|
|
|
AssetBuilderSDK::ProcessJobResponse response;
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts[0].toUtf8().constData(), AZ::Uuid::CreateNull(), 1));
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts[1].toUtf8().constData(), AZ::Uuid::CreateNull(), 2));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct("basefile.arc1", AZ::Uuid::CreateNull(), 1));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct("basefile.arc2", AZ::Uuid::CreateNull(), 2));
|
|
|
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[0].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
@@ -2354,7 +2398,7 @@ namespace AssetProcessor
|
|
|
|
|
|
// Invoke Asset Processed for pc platform for the second job
|
|
|
response.m_outputProducts.clear();
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(pcouts[0].toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct("basefile.arc3"));
|
|
|
assetMessages.clear();
|
|
|
changedInputResults.clear();
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[1].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
@@ -2710,6 +2754,8 @@ namespace AssetProcessor
|
|
|
config.AddScanFolder(ScanFolderInfo(tempPath.filePath("subfolder1"), "subfolder1", "subfolder1", false, true, platforms, -1)); // subfolder1 overrides root
|
|
|
config.AddScanFolder(ScanFolderInfo(tempPath.absolutePath(), "temp", "tempfolder", true, false, platforms, 0)); // add the root
|
|
|
|
|
|
+ config.AddIntermediateScanFolder();
|
|
|
+
|
|
|
AssetProcessorManager_Test apm(&config);
|
|
|
|
|
|
QList<JobDetails> processResults;
|
|
@@ -2737,11 +2783,17 @@ namespace AssetProcessor
|
|
|
QDir cacheRoot;
|
|
|
UNIT_TEST_EXPECT_TRUE(AssetUtilities::ComputeProjectCacheRoot(cacheRoot));
|
|
|
|
|
|
- QString productFileAPath = cacheRoot.filePath(QString("pc/fileaproduct.txt"));
|
|
|
- QString productFileBPath = cacheRoot.filePath(QString("pc/filebproduct1.txt"));
|
|
|
- QString product2FileBPath = cacheRoot.filePath(QString("pc/filebproduct2.txt"));
|
|
|
- QString productFileCPath = cacheRoot.filePath(QString("pc/filecproduct.txt"));
|
|
|
- QString product2FileCPath = cacheRoot.filePath(QString("pc/filecproduct2.txt"));
|
|
|
+ constexpr const char* productFileAFilename = "fileaproduct.txt";
|
|
|
+ constexpr const char* productFileBFilename = "filebproduct1.txt";
|
|
|
+ constexpr const char* product2FileBFilename = "filebproduct2.txt";
|
|
|
+ constexpr const char* productFileCFilename = "filecproduct.txt";
|
|
|
+ constexpr const char* product2FileCFilename = "filecproduct2.txt";
|
|
|
+
|
|
|
+ QString productFileAPath = cacheRoot.filePath(QString("pc/") + productFileAFilename);
|
|
|
+ QString productFileBPath = cacheRoot.filePath(QString("pc/") + productFileBFilename);
|
|
|
+ QString product2FileBPath = cacheRoot.filePath(QString("pc/") + product2FileBFilename);
|
|
|
+ QString productFileCPath = cacheRoot.filePath(QString("pc/") + productFileCFilename);
|
|
|
+ QString product2FileCPath = cacheRoot.filePath(QString("pc/") + product2FileCFilename);
|
|
|
|
|
|
UNIT_TEST_EXPECT_TRUE(CreateDummyFile(sourceFileAPath, ""));
|
|
|
UNIT_TEST_EXPECT_TRUE(CreateDummyFile(sourceFileBPath, ""));
|
|
@@ -2752,6 +2804,8 @@ namespace AssetProcessor
|
|
|
UNIT_TEST_EXPECT_TRUE(CreateDummyFile(productFileCPath, "product"));
|
|
|
UNIT_TEST_EXPECT_TRUE(CreateDummyFile(product2FileCPath, "product"));
|
|
|
|
|
|
+ AZStd::string cacheWithPlatform = cacheRoot.absoluteFilePath("pc").toUtf8().constData();
|
|
|
+
|
|
|
// Analyze FileA
|
|
|
QMetaObject::invokeMethod(&apm, "AssessAddedFile", Qt::QueuedConnection, Q_ARG(QString, sourceFileAPath));
|
|
|
|
|
@@ -2763,7 +2817,8 @@ namespace AssetProcessor
|
|
|
// Invoke Asset Processed for pc platform for the FileA job
|
|
|
AssetBuilderSDK::ProcessJobResponse response;
|
|
|
response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success;
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(productFileAPath.toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(productFileAFilename));
|
|
|
+ response.m_outputProducts.back().m_outputPathOverride = cacheWithPlatform;
|
|
|
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[0].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
|
|
@@ -2795,7 +2850,8 @@ namespace AssetProcessor
|
|
|
UNIT_TEST_EXPECT_TRUE(onlyOneJobHaveJobDependency);
|
|
|
|
|
|
// Invoke Asset Processed for pc platform for the first FileB job
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(productFileBPath.toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(productFileBFilename));
|
|
|
+ response.m_outputProducts.back().m_outputPathOverride = cacheWithPlatform;
|
|
|
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[0].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
UNIT_TEST_EXPECT_TRUE(BlockUntil(idling, 5000));
|
|
@@ -2803,7 +2859,8 @@ namespace AssetProcessor
|
|
|
response.m_outputProducts.clear();
|
|
|
|
|
|
// Invoke Asset Processed for pc platform for the second FileB job
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(product2FileBPath.toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(product2FileBFilename));
|
|
|
+ response.m_outputProducts.back().m_outputPathOverride = cacheWithPlatform;
|
|
|
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[1].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
UNIT_TEST_EXPECT_TRUE(BlockUntil(idling, 5000000));
|
|
@@ -2822,20 +2879,24 @@ namespace AssetProcessor
|
|
|
|
|
|
for (JobDetails& jobDetail : processResults)
|
|
|
{
|
|
|
+ UNIT_TEST_EXPECT_TRUE(processResults.size() == 2); // Repeat to ensure count doesn't change while looping
|
|
|
+
|
|
|
if (QString(jobDetail.m_jobEntry.m_pathRelativeToWatchFolder).endsWith("FileB.txt"))
|
|
|
{
|
|
|
// Ensure that we are processing the right FileB job
|
|
|
UNIT_TEST_EXPECT_TRUE(QString(jobDetail.m_jobEntry.m_jobKey).compare("yyy") == 0);
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(product2FileBPath.toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(product2FileBFilename));
|
|
|
+ response.m_outputProducts.back().m_outputPathOverride = cacheWithPlatform;
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, jobDetail.m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
UNIT_TEST_EXPECT_TRUE(BlockUntil(idling, 5000));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
response.m_outputProducts.clear();
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(productFileAPath.toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(productFileAFilename));
|
|
|
+ response.m_outputProducts.back().m_outputPathOverride = cacheWithPlatform;
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, jobDetail.m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
UNIT_TEST_EXPECT_TRUE(BlockUntil(idling, 5000));
|
|
|
}
|
|
@@ -2863,14 +2924,16 @@ namespace AssetProcessor
|
|
|
UNIT_TEST_EXPECT_TRUE(QString(jobDetail.m_jobEntry.m_jobKey).compare("yyy") == 0);
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(product2FileBPath.toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(product2FileBFilename));
|
|
|
+ response.m_outputProducts.back().m_outputPathOverride = cacheWithPlatform;
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, jobDetail.m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
UNIT_TEST_EXPECT_TRUE(BlockUntil(idling, 5000));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
response.m_outputProducts.clear();
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(productFileAPath.toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(productFileAFilename));
|
|
|
+ response.m_outputProducts.back().m_outputPathOverride = cacheWithPlatform;
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, jobDetail.m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
UNIT_TEST_EXPECT_TRUE(BlockUntil(idling, 5000));
|
|
|
}
|
|
@@ -2900,14 +2963,16 @@ namespace AssetProcessor
|
|
|
UNIT_TEST_EXPECT_TRUE(QString(jobDetail.m_jobDependencyList[0].m_jobDependency.m_jobKey.c_str()).compare("yyy") == 0);
|
|
|
|
|
|
response.m_outputProducts.clear();
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(product2FileCPath.toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(product2FileCFilename));
|
|
|
+ response.m_outputProducts.back().m_outputPathOverride = cacheWithPlatform;
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, jobDetail.m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
UNIT_TEST_EXPECT_TRUE(BlockUntil(idling, 5000));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
response.m_outputProducts.clear();
|
|
|
- response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(productFileCPath.toUtf8().constData()));
|
|
|
+ response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(productFileCFilename));
|
|
|
+ response.m_outputProducts.back().m_outputPathOverride = cacheWithPlatform;
|
|
|
QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, jobDetail.m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response));
|
|
|
UNIT_TEST_EXPECT_TRUE(BlockUntil(idling, 5000));
|
|
|
}
|