Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
fbb3830
Add example1.ini file (for tests)
ccp-chargeback Dec 1, 2025
31479c2
Add vcpkg inih to project
ccp-chargeback Dec 1, 2025
9ce31fa
Add first ResourceFilterTest
ccp-chargeback Dec 2, 2025
4a0a0d8
Update ExampleIniParsing test
ccp-chargeback Dec 2, 2025
dbbfb83
Rename the ResourceFilterTest class
ccp-chargeback Dec 3, 2025
fd26db0
Add scaffolding for the Filter classes
ccp-chargeback Dec 3, 2025
40ec602
Include exclude filter implementation without regex
ccp-chargeback Dec 5, 2025
ede9636
Simplify FilterResourceFilter::ParseFilters()
ccp-chargeback Dec 5, 2025
b79fe7e
Add error tests for FilterResourceFilter::ParseFilters()
ccp-chargeback Dec 5, 2025
a2bd883
Add tests for Condensed but valid filter strings
ccp-chargeback Dec 8, 2025
1a406b3
Add Doxygen markdown comments to FilterResourceFilter class.
ccp-chargeback Dec 8, 2025
c65e3c4
Change scaffolding of FilterResourceFilter
ccp-chargeback Dec 9, 2025
5d151d0
Move Filter logic into tools
ccp-chargeback Dec 10, 2025
c8b8bcd
Make filter tool classes part of ResourceTools namespace
ccp-chargeback Dec 10, 2025
5fed2b9
Fix Filter tests to now use new ResourceTools namespace
ccp-chargeback Dec 10, 2025
369e3c8
Add test for multiline respaths with empty lines
ccp-chargeback Dec 10, 2025
f9d4965
Refactor of ResourceLing and PrefixMap
ccp-chargeback Dec 11, 2025
8a68f53
Add FilterPrefixMap and Entry classes
ccp-chargeback Dec 12, 2025
e90027b
Add tests for FilterPrefixMap and Entry
ccp-chargeback Dec 15, 2025
cd967c2
Include and function signature cleanup
ccp-chargeback Dec 15, 2025
a84ebd9
Add tests for class FilterDefaultSection
ccp-chargeback Dec 15, 2025
12e4d74
Fixup NamedSection and related classes.
ccp-chargeback Jan 8, 2026
3ce25ae
Add test for Duplicate Filter in Overrides
ccp-chargeback Jan 8, 2026
f96197d
Change m_parentPrefixMap to a const reference
ccp-chargeback Jan 9, 2026
698874b
Change m_parentSectionFilter to a const reference
ccp-chargeback Jan 9, 2026
74de122
Remove un-necessary default constructors
ccp-chargeback Jan 9, 2026
022b0cf
Rename and gorup Resource Filter tests by class tested
ccp-chargeback Jan 9, 2026
7b31e28
Add FilterNamedSection tests
ccp-chargeback Jan 12, 2026
073a220
Add FilterResourceFile class
ccp-chargeback Jan 13, 2026
c885982
Add test for FilterResourceFile class (example1.ini)
ccp-chargeback Jan 13, 2026
b842fb7
Treat empty top-level and inline filters differently
ccp-chargeback Jan 15, 2026
c82711e
Add tests for NamedSection different inline filters
ccp-chargeback Jan 15, 2026
825ffee
Add tests for loading invalid example .ini files
ccp-chargeback Jan 15, 2026
183d0c0
Add ResourceFilter class
ccp-chargeback Jan 21, 2026
4ecb4a7
Merge branch 'main' into add-resource-filtering
ccp-chargeback Jan 21, 2026
42f2006
Fix formatting
ccp-chargeback Jan 21, 2026
eb4917e
Remove TODOs
ccp-chargeback Jan 21, 2026
31989f8
Add a complex include/exclude via different relative paths test
ccp-chargeback Jan 22, 2026
93b6942
Add ResourceFilter test using two .ini files
ccp-chargeback Jan 23, 2026
cf59252
Hook up CLI argument --filter-files
ccp-chargeback Jan 26, 2026
5158d92
Make the CurrentWorkingDirectoryChanger helper class available for al…
ccp-chargeback Jan 26, 2026
6d3c1fb
Add resourceFilterIniFiles info to PrintStartBanner()
ccp-chargeback Jan 26, 2026
cec67ec
Make CLI parameter --filter-files singular
ccp-chargeback Jan 26, 2026
43bdd0f
Update helpString for --filter-file
ccp-chargeback Jan 26, 2026
bef0e53
Create CLI test for filtering using validSimpleExample1.ini
ccp-chargeback Jan 26, 2026
201dcff
Create more CLI filter tests
ccp-chargeback Jan 26, 2026
d80b9e6
Fix formatting of FilterResources CLI tests
ccp-chargeback Jan 26, 2026
56dbfb0
Remove unnecessary comments in class CurrentWorkingDirectoryChanger
ccp-chargeback Jan 26, 2026
215803d
Merge branch 'main' into add-resource-filtering
ccp-chargeback Jan 30, 2026
ae101d9
Update include statements
ccp-chargeback Jan 30, 2026
b19dba2
Fix wrong case of #include <FilterPrefixmap.h>
ccp-chargeback Jan 31, 2026
8a4b712
Remove unused m_parentPrefixMap member in NamedSection
ccp-chargeback Jan 31, 2026
2cddd56
Change Kotlin Github access token
ccp-chargeback Feb 2, 2026
8459427
Move include statement to trigger TC build
ccp-chargeback Feb 2, 2026
e260153
Fix casing of #include <FilterPrefixmap.h> (missed one from earlier)
ccp-chargeback Feb 2, 2026
a943d6a
Use generic_string() for all paths involving Filter operations
ccp-chargeback Feb 2, 2026
d8ee506
Debug info - ResourceFilter_Load_validSimpleExample1_ini_usingRelativ…
ccp-chargeback Feb 2, 2026
25d2083
Normalize path strings before WildcardMatching
ccp-chargeback Feb 2, 2026
e237775
Change WildcardMatch regex exception handling
ccp-chargeback Feb 2, 2026
f91de56
Add debugging code to Path tests
ccp-chargeback Feb 2, 2026
b983c2a
Fix formatting of FilterResourcePathFile.cpp
ccp-chargeback Feb 3, 2026
8841d93
Add debug info in ResourceFilter.cpp
ccp-chargeback Feb 3, 2026
d7c7bda
Fix handling on recursive folder wildcard "..."
ccp-chargeback Feb 3, 2026
b0d0b53
Temp disable expected checks on Filter CLI tests
ccp-chargeback Feb 3, 2026
85db31b
Add debug statements for CLI Filter tests
ccp-chargeback Feb 3, 2026
02c5c0f
Normalize paths in CLI Filter test arguments
ccp-chargeback Feb 3, 2026
4b0fa83
Update microsoft vcpkg baseline
ccp-chargeback Feb 3, 2026
5f64f32
Normalize paths in CLI Filter test - take 2
ccp-chargeback Feb 3, 2026
9873d32
Normalize outputFilePath in CLI Filter tests
ccp-chargeback Feb 3, 2026
bf0f295
Use system specific filePaths for CLI Filter tests
ccp-chargeback Feb 3, 2026
9d302ec
Change RunCli() to populate stderr as well
ccp-chargeback Feb 4, 2026
a658470
Populate std::cerr on Filter errors
ccp-chargeback Feb 4, 2026
0cc5064
Add override of working directory in CliTestFixture::RunCli()
ccp-chargeback Feb 4, 2026
80a8dec
Call the CLI with full path in tests
ccp-chargeback Feb 4, 2026
89bcc80
Remove debug print statements from tests
ccp-chargeback Feb 4, 2026
d203192
Add pragma once to Filter header files and CamelCase define macros
ccp-chargeback Feb 4, 2026
fa65603
Organize/order imports for Filter header and cpp files
ccp-chargeback Feb 5, 2026
9951e5c
Add macOS gold files for comparison in Filter CLI tests
Feb 5, 2026
ed6e7d8
Cleanup Cli Filter tests
ccp-chargeback Feb 5, 2026
9f2a4f3
Change FilterResourceFilter test names to be more descriptive
ccp-chargeback Feb 5, 2026
92255d7
Change FilterPrefixMap test names to be more descriptive
ccp-chargeback Feb 5, 2026
e523297
Change FilterDefaultSection test names to be more descriptive
ccp-chargeback Feb 5, 2026
fd41064
Change FilterResourcePathFile test names to be more descriptive
ccp-chargeback Feb 5, 2026
73c7817
Change FilterNamedSection test names to be more descriptive
ccp-chargeback Feb 5, 2026
7e2106b
Change FilterResourceFile test names to be more descriptive
ccp-chargeback Feb 5, 2026
6f4a150
Change ResourceFilter test names to be more descriptive
ccp-chargeback Feb 5, 2026
f8b16aa
Order files in tools/CMakeLists.txt in alphabetical order
ccp-chargeback Feb 5, 2026
64ed63e
Add comments as per coding guidelines to CurrentWorkingDirectoryChang…
ccp-chargeback Feb 5, 2026
44ec1f4
Cleanup, simplify and comment the FilterDefaultSection class
ccp-chargeback Feb 6, 2026
6707e9f
Cleanup, simplify and comment the FilterPrefixMap class
ccp-chargeback Feb 6, 2026
ea42b88
Cleanup, simplify and comment the FilterPrefixMapEntry class
ccp-chargeback Feb 6, 2026
e5ed360
Cleanup, simplify and comment the FilterNamedSection class
ccp-chargeback Feb 6, 2026
11653de
Make sure to use C++ 17 for arm64-osx (was set to 20)
ccp-chargeback Feb 6, 2026
d55fe53
Re-organize Filter tests as part of ResourceToolsTests
ccp-chargeback Feb 6, 2026
a1b2fc1
Adding gtest include in ResourceToolsFilterTest.cpp
ccp-chargeback Feb 6, 2026
e365e6b
Cleanup, simplify and comment the FilterResourceFilter class
ccp-chargeback Feb 6, 2026
6660d02
Cleanup, simplify and comment the FilterResourceFilter class (take 2)
ccp-chargeback Feb 6, 2026
15871dd
Cleanup, simplify and comment the FilterResourcePathFileEntry class
ccp-chargeback Feb 6, 2026
31cf40c
Cleanup, simplify and comment the FilterResourcePathFile class
ccp-chargeback Feb 7, 2026
33cd209
Cleanup, simplify and comment the FilterResourceFile class
ccp-chargeback Feb 8, 2026
d4f0a3e
Rename ShouldInclude() to FilePathMatchesIncludeFilterRules()
ccp-chargeback Feb 8, 2026
4ac6ebe
Rename constants in WildcardMatch() as per coding guidelines.
ccp-chargeback Feb 8, 2026
9836626
Cleanup, simplify and comment the ResourceFilter class
ccp-chargeback Feb 8, 2026
b81076b
Use .empty() instead of .size() where applicable
ccp-chargeback Feb 10, 2026
399b860
Add two CLI tests for error .ini files
ccp-chargeback Feb 10, 2026
5d1efb7
Remove sending error message to std::cerr in ResourceGroupImpl
ccp-chargeback Feb 11, 2026
d369fe1
Change RunCli() so that standard and errorOut are only populated if/w…
ccp-chargeback Feb 11, 2026
b26ad54
Change GetResolvedResfileMap() to return a pointer to a map (because …
ccp-chargeback Feb 11, 2026
93b27fa
Optimize dealing with CLI filter files (as per code review suggestion)
ccp-chargeback Feb 11, 2026
4ed3794
Change how NamedSection is populated and its getter function.
ccp-chargeback Feb 11, 2026
828ae10
Change population of FilterResourceFile members and signature of gett…
ccp-chargeback Feb 11, 2026
51ecead
Change initialization of ResourceFilter class and signature of GetFul…
ccp-chargeback Feb 11, 2026
c294a8e
Stop using absolute paths for comparison, using relative ones instead.
ccp-chargeback Feb 12, 2026
9e6c75f
Reverting back to using absolute paths for comparison
ccp-chargeback Feb 12, 2026
7254135
Fully reverting back to original absolute paths for comparison
ccp-chargeback Feb 12, 2026
6e6ee17
Adding CLI filter tests for old-style document version (0.0.0)
ccp-chargeback Feb 12, 2026
18bfb5a
Update macOS gold comparison files for create-group with txt output
hrafn Feb 12, 2026
2daee24
Remove reliance on the WorkingDirectory when filter files from the CLI
ccp-chargeback Feb 16, 2026
4ffe5eb
Remove the CurrentWorkingDirectoryChanger helper class.
ccp-chargeback Feb 16, 2026
7c014c1
Merge branch 'filter-changes' of github.com:ccp-chargeback/resources …
ccp-chargeback Feb 16, 2026
7345745
Merge branch 'main' into filter-changes
ccp-chargeback Feb 16, 2026
6d75e6e
Rename cli argument for clarity
ccp-chargeback Feb 17, 2026
45de398
Remove workingDirectory default parameter from RunCli()
ccp-chargeback Feb 17, 2026
d0dc0ea
Simplify inputDirectoryPath in CreateGroup CLI tests
ccp-chargeback Feb 17, 2026
4977e2f
Rename filterFilePrefixmapBaseDirectory members
ccp-chargeback Feb 17, 2026
0a811ed
Simplify ResourceFilter.Initialize()
ccp-chargeback Feb 17, 2026
c14fab9
Add fileProcessing update message for skipped filter files
ccp-chargeback Feb 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .teamcity/MacOS/Project.kt
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class CarbonBuildMacOS(buildName: String, configType: String, preset: String, ag
vcsRootExtId = "${DslContext.settingsRootId.id}"
provider = github {
authType = token {
token = "%GITHUB_TEAMCITY_TOKEN%"
token = "%GITHUB_CARBON_PAT%"
}
filterAuthorRole = PullRequests.GitHubRoleFilter.MEMBER
}
Expand All @@ -159,7 +159,7 @@ class CarbonBuildMacOS(buildName: String, configType: String, preset: String, ag
publisher = github {
githubUrl = "https://api.github.com"
authType = personalToken {
token = "%GITHUB_TEAMCITY_TOKEN%"
token = "%GITHUB_CARBON_PAT%"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions .teamcity/Windows/Project.kt
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class CarbonBuildWindows(buildName: String, configType: String, preset: String)
vcsRootExtId = "${DslContext.settingsRootId.id}"
provider = github {
authType = token {
token = "%GITHUB_TEAMCITY_TOKEN%"
token = "%GITHUB_CARBON_PAT%"
}
filterAuthorRole = PullRequests.GitHubRoleFilter.MEMBER
}
Expand All @@ -217,7 +217,7 @@ class CarbonBuildWindows(buildName: String, configType: String, preset: String)
publisher = github {
githubUrl = "https://api.github.com"
authType = personalToken {
token = "%GITHUB_TEAMCITY_TOKEN%"
token = "%GITHUB_CARBON_PAT%"
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ include(cmake/CcpPackageConfigHelpers.cmake)
include(cmake/CcpBuildConfigurations.cmake)

find_package(yaml-cpp CONFIG REQUIRED)
find_package(unofficial-inih CONFIG REQUIRED)

# Add subdirectory for resource tools static library
add_subdirectory(tools)
Expand Down Expand Up @@ -68,7 +69,7 @@ endif ()

target_compile_definitions(resources PUBLIC CARBON_RESOURCES_STATIC)

target_link_libraries(resources PRIVATE $<BUILD_LOCAL_INTERFACE:resources-tools> yaml-cpp::yaml-cpp)
target_link_libraries(resources PRIVATE $<BUILD_LOCAL_INTERFACE:resources-tools> yaml-cpp::yaml-cpp unofficial::inih::inireader)

target_include_directories(resources
PUBLIC
Expand Down
87 changes: 64 additions & 23 deletions cli/src/CreateResourceGroupCliOperation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ CreateResourceGroupCliOperation::CreateResourceGroupCliOperation() :
m_createResourceGroupSkipCompressionCalculationId( "--skip-compression" ),
m_createResourceGroupExportResourcesId( "--export-resources" ),
m_createResourceGroupExportResourcesDestinationTypeId( "--export-resources-destination-type" ),
m_createResourceGroupExportResourcesDestinationPathId( "--export-resources-destination-path" )
m_createResourceGroupExportResourcesDestinationPathId( "--export-resources-destination-path" ),
m_createResourceGroupIniFilterFilesArgumentId( "--filter-file" ),
m_createResourceGroupIniFilterFilesPrefixmapBasePathArgumentId( "--filter-file-prefixmap-basepath" )
{

AddRequiredPositionalArgument( m_createResourceGroupPathArgumentId, "Base directory to create resource group from." );
Expand All @@ -32,25 +34,29 @@ CreateResourceGroupCliOperation::CreateResourceGroupCliOperation() :
AddArgument( m_createResourceGroupDocumentVersionArgumentId, "Document version for created resource group.", false, false, VersionToString( defaultImportParams.outputDocumentVersion ) );

AddArgument( m_createResourceGroupResourcePrefixArgumentId, R"(Optional resource path prefix, such as "res" or "app")", false, false, "" );

AddArgumentFlag( m_createResourceGroupSkipCompressionCalculationId, "Set skip compression calculations on resources." );

AddArgumentFlag( m_createResourceGroupExportResourcesId, "Export resources after processing. see --export-resources-destination-type and --export-resources-destination-path" );
AddArgumentFlag( m_createResourceGroupSkipCompressionCalculationId, "Set skip compression calculations on resources." );

AddArgument( m_createResourceGroupExportResourcesDestinationTypeId, "Represents the type of repository where exported resources will be saved. Requires --export-resources", false, false, DestinationTypeToString( defaultImportParams.exportResourcesDestinationSettings.destinationType ), ResourceDestinationTypeChoicesAsString() );
AddArgumentFlag( m_createResourceGroupExportResourcesId, "Export resources after processing. see --export-resources-destination-type and --export-resources-destination-path" );

AddArgument( m_createResourceGroupExportResourcesDestinationTypeId, "Represents the type of repository where exported resources will be saved. Requires --export-resources", false, false, DestinationTypeToString( defaultImportParams.exportResourcesDestinationSettings.destinationType ), ResourceDestinationTypeChoicesAsString() );

AddArgument( m_createResourceGroupExportResourcesDestinationPathId, "Represents the base path where the exported resources will be saved. Requires --export-resources", false, false, defaultImportParams.exportResourcesDestinationSettings.basePath.string() );

AddArgument( m_createResourceGroupIniFilterFilesArgumentId, "Path to INI file for resource filtering.", false, true, "" );

AddArgument( m_createResourceGroupIniFilterFilesPrefixmapBasePathArgumentId, "Base directory for resolving relative paths contained within filter INI file(s) prefixmap attribute.", false, false, "" );
}

bool CreateResourceGroupCliOperation::Execute( std::string& returnErrorMessage ) const
{
CarbonResources::CreateResourceGroupFromDirectoryParams createResourceGroupParams;

CarbonResources::ResourceGroupExportToFileParams exportParams;
CarbonResources::ResourceGroupExportToFileParams exportParams;

createResourceGroupParams.directory = m_argumentParser->get<std::string>( m_createResourceGroupPathArgumentId );
createResourceGroupParams.directory = m_argumentParser->get<std::string>( m_createResourceGroupPathArgumentId );

bool versionIsValid = ParseDocumentVersion( m_argumentParser->get( m_createResourceGroupDocumentVersionArgumentId ), createResourceGroupParams.outputDocumentVersion );
bool versionIsValid = ParseDocumentVersion( m_argumentParser->get( m_createResourceGroupDocumentVersionArgumentId ), createResourceGroupParams.outputDocumentVersion );

if( !versionIsValid )
{
Expand All @@ -63,7 +69,7 @@ bool CreateResourceGroupCliOperation::Execute( std::string& returnErrorMessage )

createResourceGroupParams.calculateCompressions = !m_argumentParser->get<bool>( m_createResourceGroupSkipCompressionCalculationId );

createResourceGroupParams.exportResources = m_argumentParser->get<bool>( m_createResourceGroupExportResourcesId );
createResourceGroupParams.exportResources = m_argumentParser->get<bool>( m_createResourceGroupExportResourcesId );

if( createResourceGroupParams.exportResources )
{
Expand All @@ -79,20 +85,37 @@ bool CreateResourceGroupCliOperation::Execute( std::string& returnErrorMessage )
createResourceGroupParams.exportResourcesDestinationSettings.basePath = m_argumentParser->get<std::string>( m_createResourceGroupExportResourcesDestinationPathId );
}

exportParams.filename = m_argumentParser->get<std::string>( m_createResourceGroupOutputFileArgumentId );

exportParams.filename = m_argumentParser->get<std::string>( m_createResourceGroupOutputFileArgumentId );
exportParams.outputDocumentVersion = createResourceGroupParams.outputDocumentVersion;

exportParams.outputDocumentVersion = createResourceGroupParams.outputDocumentVersion;
if( m_argumentParser->is_used( m_createResourceGroupIniFilterFilesArgumentId ) )
{
std::vector<std::filesystem::path> filterIniFilePaths;
auto iniFileStringVector = m_argumentParser->get<std::vector<std::string>>( m_createResourceGroupIniFilterFilesArgumentId );

if (ShowCliStatusUpdates())
{
for( const auto& iniPathStr : iniFileStringVector )
{
if( !iniPathStr.empty() )
{
createResourceGroupParams.resourceFilterIniFiles.emplace_back( iniPathStr );
}
}

createResourceGroupParams.resourceFilterIniFilesPrefixmapBaseDirectory = m_argumentParser->get<std::string>( m_createResourceGroupIniFilterFilesPrefixmapBasePathArgumentId );
}

if (ShowCliStatusUpdates())
{
PrintStartBanner( createResourceGroupParams, exportParams );
}
}

return CreateResourceGroup( createResourceGroupParams, exportParams );
}

void CreateResourceGroupCliOperation::PrintStartBanner( CarbonResources::CreateResourceGroupFromDirectoryParams& createResourceGroupFromDirectoryParams, CarbonResources::ResourceGroupExportToFileParams& ResourceGroupExportToFileParams ) const
void CreateResourceGroupCliOperation::PrintStartBanner(
CarbonResources::CreateResourceGroupFromDirectoryParams& createResourceGroupFromDirectoryParams,
CarbonResources::ResourceGroupExportToFileParams& ResourceGroupExportToFileParams ) const
{
std::cout << "---Creating Resource Group---" << std::endl;

Expand All @@ -102,37 +125,55 @@ void CreateResourceGroupCliOperation::PrintStartBanner( CarbonResources::CreateR

std::cout << "Output File: " << ResourceGroupExportToFileParams.filename << std::endl;

std::cout << "Output Document Version: " << VersionToString(ResourceGroupExportToFileParams.outputDocumentVersion) << std::endl;
std::cout << "Output Document Version: " << VersionToString( ResourceGroupExportToFileParams.outputDocumentVersion ) << std::endl;

std::cout << "Resource Prefix: " << createResourceGroupFromDirectoryParams.resourcePrefix << std::endl;

if( createResourceGroupFromDirectoryParams.calculateCompressions)
{
if( createResourceGroupFromDirectoryParams.calculateCompressions )
{
std::cout << "Calculate Compression: On" << std::endl;
}
}
else
{
std::cout << "Calculate Compression: Off" << std::endl;
}

if( createResourceGroupFromDirectoryParams.exportResources )
if( createResourceGroupFromDirectoryParams.exportResources )
{
std::cout << "Export Resources: On" << std::endl;

std::cout << "Export Resources Type: " << DestinationTypeToString( createResourceGroupFromDirectoryParams.exportResourcesDestinationSettings.destinationType ) << std::endl;
std::cout << "Export Resources Type: " << DestinationTypeToString( createResourceGroupFromDirectoryParams.exportResourcesDestinationSettings.destinationType ) << std::endl;

std::cout << "Export Resources Base Path: " << createResourceGroupFromDirectoryParams.exportResourcesDestinationSettings.basePath << std::endl;
std::cout << "Export Resources Base Path: " << createResourceGroupFromDirectoryParams.exportResourcesDestinationSettings.basePath << std::endl;
}
else
{
std::cout << "Export Resources: Off" << std::endl;
}

if( !createResourceGroupFromDirectoryParams.resourceFilterIniFiles.empty() )
{
std::cout << "Resource Filter INI File(s) used: " << std::endl;

for( const auto& iniPath : createResourceGroupFromDirectoryParams.resourceFilterIniFiles )
{
std::cout << " - " << iniPath.generic_string() << std::endl;
}

std::cout << "Base Directory for Resolving Relative Paths in Filter INI File(s): " << createResourceGroupFromDirectoryParams.resourceFilterIniFilesPrefixmapBaseDirectory << std::endl;
}
else
{
std::cout << "Resource Filter INI File(s) used: None" << std::endl;
}

std::cout << "----------------------------\n"
<< std::endl;
}

bool CreateResourceGroupCliOperation::CreateResourceGroup( CarbonResources::CreateResourceGroupFromDirectoryParams& createResourceGroupFromDirectoryParams, CarbonResources::ResourceGroupExportToFileParams& ResourceGroupExportToFileParams ) const
bool CreateResourceGroupCliOperation::CreateResourceGroup(
CarbonResources::CreateResourceGroupFromDirectoryParams& createResourceGroupFromDirectoryParams,
CarbonResources::ResourceGroupExportToFileParams& ResourceGroupExportToFileParams ) const
{
CarbonResources::ResourceGroup resourceGroup;

Expand Down
24 changes: 16 additions & 8 deletions cli/src/CreateResourceGroupCliOperation.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ class CreateResourceGroupCliOperation : public CliOperation
virtual bool Execute( std::string& returnErrorMessage ) const final;

private:
void PrintStartBanner( CarbonResources::CreateResourceGroupFromDirectoryParams& createResourceGroupFromDirectoryParams, CarbonResources::ResourceGroupExportToFileParams& ResourceGroupExportToFileParams ) const;
void PrintStartBanner(
CarbonResources::CreateResourceGroupFromDirectoryParams& createResourceGroupFromDirectoryParams,
CarbonResources::ResourceGroupExportToFileParams& ResourceGroupExportToFileParams ) const;

bool CreateResourceGroup( CarbonResources::CreateResourceGroupFromDirectoryParams& createResourceGroupFromDirectoryParams, CarbonResources::ResourceGroupExportToFileParams& ResourceGroupExportToFileParams ) const;
bool CreateResourceGroup(
CarbonResources::CreateResourceGroupFromDirectoryParams& createResourceGroupFromDirectoryParams,
CarbonResources::ResourceGroupExportToFileParams& ResourceGroupExportToFileParams ) const;

private:
std::string m_createResourceGroupPathArgumentId;
Expand All @@ -30,14 +34,18 @@ class CreateResourceGroupCliOperation : public CliOperation
std::string m_createResourceGroupDocumentVersionArgumentId;

std::string m_createResourceGroupResourcePrefixArgumentId;

std::string m_createResourceGroupSkipCompressionCalculationId;

std::string m_createResourceGroupExportResourcesId;
std::string m_createResourceGroupSkipCompressionCalculationId;

std::string m_createResourceGroupExportResourcesDestinationTypeId;

std::string m_createResourceGroupExportResourcesDestinationPathId;
std::string m_createResourceGroupExportResourcesId;

std::string m_createResourceGroupExportResourcesDestinationTypeId;

std::string m_createResourceGroupExportResourcesDestinationPathId;

std::string m_createResourceGroupIniFilterFilesArgumentId;

std::string m_createResourceGroupIniFilterFilesPrefixmapBasePathArgumentId;
};

#endif // CreateResourceGroupCliOperation_H
2 changes: 1 addition & 1 deletion customized_toolchain/toolchains/arm64-osx-carbon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ if (NOT _CCP_TOOLCHAIN_FILE_LOADED)
set(_CCP_TOOLCHAIN_FILE_LOADED 1)

set (VCPKG_USE_HOST_TOOLS ON CACHE STRING "")
set (CMAKE_CXX_STANDARD 20 CACHE STRING "")
set (CMAKE_CXX_STANDARD 17 CACHE STRING "")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the story here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When Toebeans applied the Template project changes into carbonengine/resources, he changed the macOS Arm config to use C++ 20 on his local and checked it it (forgot to revert it back to 17).
Windows and macOS x64 are already using C++ 17.
When we upgrade to a newer version we'll do so on all flavors at the same time.

set (CMAKE_CXX_STANDARD_REQUIRED ON CACHE STRING "")
set (CMAKE_CXX_EXTENSIONS OFF CACHE STRING "")
set (CMAKE_POSITION_INDEPENDENT_CODE ON CACHE STRING "")
Expand Down
6 changes: 6 additions & 0 deletions include/Enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ using StatusCallback = std::function<void( StatusProgressType statusProgressType
* Required resource not found
* @var REQUIRED_INPUT_PARAMETER_NOT_SET
* A required input parameter was not set
* @var FAILED_TO_INITIALIZE_RESOURCE_FILTER
* Failed to initialize ResourceFilter from .ini file
* @var FAILED_TO_APPLY_RESOURCE_FILTER_RULES
* Unable to decide on include/exclude filtering rules for resource
*/
enum class ResultType
{
Expand Down Expand Up @@ -164,6 +168,8 @@ enum class ResultType
RESOURCE_LIST_NOT_SET,
RESOURCE_NOT_FOUND,
REQUIRED_INPUT_PARAMETER_NOT_SET,
FAILED_TO_INITIALIZE_RESOURCE_FILTER,
FAILED_TO_APPLY_RESOURCE_FILTER_RULES,
//NOTE: if adding to this enum, a complimentary entry must be added to resultToString.
};

Expand Down
17 changes: 14 additions & 3 deletions include/ResourceGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ struct ResourceGroupExportToFileParams
* @var CreateResourceGroupFromDirectoryParams::exportResourcesDestinationSettings
* If export resources is set, specifies where the produced PatchResourceGroup will be saved.
* @see CreateResourceGroupFromDirectoryParams::exportResources
* @var CreateResourceGroupFromDirectoryParams::resourceFilterIniFiles
* List of INI file(s) containing include/exclude rules for resource filtering
* @var CreateResourceGroupFromDirectoryParams::resourceFilterIniFilesPrefixmapBaseDirectory
* Base directory for resolving relative paths contained within resourceFilterIniFiles prefixmap attribute
*/
struct CreateResourceGroupFromDirectoryParams
{
Expand All @@ -230,11 +234,18 @@ struct CreateResourceGroupFromDirectoryParams

std::string resourcePrefix = "";

bool calculateCompressions = true;
bool calculateCompressions = true;

bool exportResources = false;

ResourceDestinationSettings exportResourcesDestinationSettings = {
CarbonResources::ResourceDestinationType::LOCAL_CDN,
"ExportedResources"
};

bool exportResources = false;
std::vector<std::filesystem::path> resourceFilterIniFiles = {};

ResourceDestinationSettings exportResourcesDestinationSettings = { CarbonResources::ResourceDestinationType::LOCAL_CDN, "ExportedResources" };
std::filesystem::path resourceFilterIniFilesPrefixmapBaseDirectory = "";
};

/** @struct ResourceGroupMergeParams
Expand Down
8 changes: 8 additions & 0 deletions src/Enums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ bool ResultTypeToString( ResultType resultType, std::string& output )
case ResultType::REQUIRED_INPUT_PARAMETER_NOT_SET:
output = "A required parameter was not set";
return true;

case ResultType::FAILED_TO_INITIALIZE_RESOURCE_FILTER:
output = "Failed to initialize ResourceFilter from .ini file";
return true;

case ResultType::FAILED_TO_APPLY_RESOURCE_FILTER_RULES:
output = "Unable to decide on include/exclude filtering rules for resource";
return true;
}

output = "Error code unrecognised. This is an internal library error which shouldn't be encountered. If you encounter this error contact API addministrators.";
Expand Down
Loading