AAPT2: Parse artifact names from template.
Add a helper method to convert a templated artifact name to file name
based on the values present in an Artifact struct. The Artifact
validates that all required template paramters are present.
Test: Unit tests
Change-Id: Id97ff606bb41c72a31c2d769104966be9cbca1a0
diff --git a/tools/aapt2/configuration/ConfigurationParser.h b/tools/aapt2/configuration/ConfigurationParser.h
index 3fae5dd..28c355e 100644
--- a/tools/aapt2/configuration/ConfigurationParser.h
+++ b/tools/aapt2/configuration/ConfigurationParser.h
@@ -20,8 +20,9 @@
#include <string>
#include <unordered_map>
#include <vector>
-#include <ConfigDescription.h>
+#include "ConfigDescription.h"
+#include "Diagnostics.h"
#include "util/Maybe.h"
namespace aapt {
@@ -48,6 +49,9 @@
Maybe<std::string> device_feature_group;
/** If present, uses the OpenGL texture group with this name. */
Maybe<std::string> gl_texture_group;
+
+ /** Convert an artifact name template into a name string based on configuration contents. */
+ Maybe<std::string> ToArtifactName(const std::string& format, IDiagnostics* diag) const;
};
/** Enumeration of currently supported ABIs. */
@@ -212,4 +216,4 @@
} // namespace aapt
-#endif //AAPT2_CONFIGURATION_H
+#endif // AAPT2_CONFIGURATION_H