- Notifications
You must be signed in to change notification settings - Fork3
Template generator#214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
16 commits Select commitHold shift + click to select a range
8d4f711 Updated builder interface
coder13778c667a Updated bootstrap main script
coder137955f6fe Added default value for TargetType in TargetSchema
coder137b884b07 Renamed GetValueByIdentifier to Get
coder1370d7a31a Rename from AddDefaultArgument(s) to AddPattern(s)
coder137b0e1d2f Minor updates
coder13701f5a11 Renamed generator.h to file_generator.h
coder137a016008 Renamed generator to file_generator, added template_generator
coder1370b64ad5 Updated template generator
coder1378269fe3 Updated test_generator.cpp
coder137920b54e Renamed from test_generator to test_file_generator
coder137e91e756 Added test_template_generator.cpp
coder1374939677 Added template_generator tests
coder137ce9a657 Updated custom_generator
coder1372a53178 Updated template_generator and test
coder1377e036f3 Updated test_template_generator.cpp
coder137File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletionbootstrap/main.buildcc.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletionsbootstrap/src/build_buildcc.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletionbuildcc/buildcc.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletionbuildcc/lib/args/include/args/register.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletionsbuildcc/lib/target/cmake/common_target_src.cmake
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
22 changes: 10 additions & 12 deletionsbuildcc/lib/target/include/target/custom_generator.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions...dcc/lib/target/include/target/generator.h → ...ib/target/include/target/file_generator.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
54 changes: 20 additions & 34 deletionsbuildcc/lib/target/include/target/interface/builder_interface.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletionsbuildcc/lib/target/include/target/template_generator.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| /* | ||
| * Copyright 2021-2022 Niket Naidu. All rights reserved. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| #ifndef TARGET_TEMPLATE_GENERATOR_H_ | ||
| #define TARGET_TEMPLATE_GENERATOR_H_ | ||
| #include "target/custom_generator.h" | ||
| namespace buildcc { | ||
| class TemplateGenerator : public CustomGenerator { | ||
| public: | ||
| TemplateGenerator(const std::string &name, const TargetEnv &env) | ||
| : CustomGenerator(name, env) {} | ||
| void AddTemplate(const fs::path &input_filename, | ||
| const fs::path &output_filename); | ||
| std::string Parse(const std::string &pattern); | ||
| /** | ||
| * @brief Build FileGenerator Tasks | ||
| * | ||
| * Use `GetTaskflow` for the registered tasks | ||
| */ | ||
| void Build() override; | ||
| // Restrict access to certain custom generator APIs | ||
| private: | ||
| using CustomGenerator::AddDependencyCb; | ||
| using CustomGenerator::AddGenInfo; | ||
| using CustomGenerator::Build; | ||
| private: | ||
| struct TemplateInfo { | ||
| fs::path input; | ||
| fs::path output; | ||
| }; | ||
| private: | ||
| std::vector<TemplateInfo> template_infos_; | ||
| }; | ||
| } // namespace buildcc | ||
| #endif |
34 changes: 18 additions & 16 deletionsbuildcc/lib/target/src/custom_generator/custom_generator.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
15 changes: 9 additions & 6 deletions...cc/lib/target/src/generator/generator.cpp → ...b/target/src/generator/file_generator.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.