[LYN-7520] Wildcard Source Dependencies include files in cache/excluded files (#5349)

* Add folder exclusion for wildcard source dependencies

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Exclude ignored files.  Add unit tests

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Add handling for ignored folders being added/removed

Add unit tests

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Add ExcludedFolderCacheInterface to cmake

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Fix include

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Add error message

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Cleanup includes

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Revert traits include

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Fix missing include, minor cleanup

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Add missing includes

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>
This commit is contained in:
amzn-mike
2021-11-18 13:37:48 -06:00
committed by GitHub
parent 8e02a82866
commit ae50187fba
13 changed files with 506 additions and 14 deletions
@@ -0,0 +1,39 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AssetManager/ExcludedFolderCacheInterface.h>
#include <AssetManager/FileStateCache.h>
namespace AssetProcessor
{
class PlatformConfiguration;
struct ExcludedFolderCache : ExcludedFolderCacheInterface
{
explicit ExcludedFolderCache(const PlatformConfiguration* platformConfig);
~ExcludedFolderCache() override;
// Gets a set of absolute paths to folder which have been excluded according to the platform configuration rules
// Note - not thread safe
const AZStd::unordered_set<AZStd::string>& GetExcludedFolders() override;
void FileAdded(QString path) override;
private:
bool m_builtCache = false;
const PlatformConfiguration* m_platformConfig{};
AZStd::unordered_set<AZStd::string> m_excludedFolders;
AZStd::recursive_mutex m_pendingNewFolderMutex;
AZStd::unordered_set<AZStd::string> m_pendingNewFolders; // Newly ignored folders waiting to be added to m_excludedFolders
AZStd::unordered_set<AZStd::string> m_pendingDeletes;
AZ::Event<FileStateInfo>::Handler m_handler;
};
}