Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

yml -> yaml rename #40

Merged
merged 3 commits into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
10 changes: 5 additions & 5 deletions docs/man/antler-proj.1
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ project.
\f[C]
Command arguments:
\-h,\-\-help Print this help message and exit
\-p <path> This must be the path to the \[ga]project.yml\[ga] or the path containing it.
\-p <path> This must be the path to the \[ga]project.yaml\[ga] or the path containing it.
[path] Path to the root of the project.
<app,lib,dep> Type of an entity to work with
\f[R]
Expand All @@ -68,7 +68,7 @@ your project.
\f[C]
Command arguments:
\-h,\-\-help Print this help message and exit
\-p <path> This must be the path to the \[ga]project.yml\[ga] or the path containing it.
\-p <path> This must be the path to the \[ga]project.yaml\[ga] or the path containing it.
[path] Path to the root of the project.
<app,lib,dep> Type of an entity to work with
\f[R]
Expand All @@ -83,7 +83,7 @@ from your project.
\f[C]
Command arguments:
\-h,\-\-help Print this help message and exit
\-p <path> This must be the path to the \[ga]project.yml\[ga] or the path containing it.
\-p <path> This must be the path to the \[ga]project.yaml\[ga] or the path containing it.
[path] Path to the root of the project.
<app,lib,dep> Type of an entity to work with
\f[R]
Expand All @@ -106,7 +106,7 @@ Downloads all the updates in a way depending on where it is located.
\f[C]
Command arguments:
\-h,\-\-help Print this help message and exit
\-p <path> This must be the path to the \[ga]project.yml\[ga] or the path containing it.
\-p <path> This must be the path to the \[ga]project.yaml\[ga] or the path containing it.
[path] Path to the root of the project.
\f[R]
.fi
Expand Down Expand Up @@ -144,7 +144,7 @@ project.yaml, their dependencies and tests.
\f[C]
Command arguments:
\-h,\-\-help Print this help message and exit
\-p <path> This must be the path to the \[ga]project.yml\[ga] or the path containing it.
\-p <path> This must be the path to the \[ga]project.yaml\[ga] or the path containing it.
[path] Path to the root of the project.
\f[R]
.fi
Expand Down
10 changes: 5 additions & 5 deletions docs/man/antler-proj.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Command arguments:
```
Command arguments:
-h,--help Print this help message and exit
-p <path> This must be the path to the `project.yml` or the path containing it.
-p <path> This must be the path to the `project.yaml` or the path containing it.
[path] Path to the root of the project.
<app,lib,dep> Type of an entity to work with
```
Expand All @@ -60,7 +60,7 @@ Command arguments:
```
Command arguments:
-h,--help Print this help message and exit
-p <path> This must be the path to the `project.yml` or the path containing it.
-p <path> This must be the path to the `project.yaml` or the path containing it.
[path] Path to the root of the project.
<app,lib,dep> Type of an entity to work with
```
Expand All @@ -72,7 +72,7 @@ Command arguments:
```
Command arguments:
-h,--help Print this help message and exit
-p <path> This must be the path to the `project.yml` or the path containing it.
-p <path> This must be the path to the `project.yaml` or the path containing it.
[path] Path to the root of the project.
<app,lib,dep> Type of an entity to work with
```
Expand All @@ -87,7 +87,7 @@ Command arguments:
```
Command arguments:
-h,--help Print this help message and exit
-p <path> This must be the path to the `project.yml` or the path containing it.
-p <path> This must be the path to the `project.yaml` or the path containing it.
[path] Path to the root of the project.
```
**Example: antler-proj populate ./project**
Expand All @@ -113,7 +113,7 @@ Command arguments:
```
Command arguments:
-h,--help Print this help message and exit
-p <path> This must be the path to the `project.yml` or the path containing it.
-p <path> This must be the path to the `project.yaml` or the path containing it.
[path] Path to the root of the project.
```
**Example: antler-proj build ./project**
Expand Down
24 changes: 12 additions & 12 deletions docs/project_manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Github will act as the primary 'repo' for packages to exist. When listing depen
3) An optional version can be added with the additional qualifier of greater than '>'

#### Manifest
Example project.yml:
Example project.yaml:
```yaml
---
project: "antelope_system_contract"
Expand Down Expand Up @@ -66,13 +66,13 @@ The directory structure for the project manager system will be as such:
├───ricardian
├───libs
├───tests
└───project.yml
└───project.yaml
```
### Convention and Specification
A strict convention will be used to define packages/projects in terms of directory layout and manifest files.

### antler-pack --init
`antler-pack --init` should produce an initial project for the developer with the above given directory structure and project.yml.
`antler-pack --init` should produce an initial project for the developer with the above given directory structure and project.yaml.

Prompts should be given for:
- Project name
Expand All @@ -97,7 +97,7 @@ Prompts should be given for:
- dependency location (local or github)
- dependency version (if location is local then ignore)

With this information a new entry in the `project.yml` will be created.
With this information a new entry in the `project.yaml` will be created.

### antler-pack --add-lib
`antler-pack --add-lib` will allow the user to add a new library to their project given a current project exists.
Expand All @@ -110,7 +110,7 @@ Prompts should be given for:
- dependency location (local or github)
- dependency version (if location is local then ignore)

With this information a new entry in the `project.yml` will be created.
With this information a new entry in the `project.yaml` will be created.

### antler-pack --add-test
`antler-pack --add-test` will allow the user to add a new test to their project given a current project exists.
Expand All @@ -122,7 +122,7 @@ Prompts should be given for:
- dependency location (local or github)
- dependency version (if location is local then ignore)

With this information a new entry in the `project.yml` will be created.
With this information a new entry in the `project.yaml` will be created.

### antler-pack --add-dependency
`antler-pack --add-dependency` will allow the user to add a dependency to their project.
Expand All @@ -135,7 +135,7 @@ Prompts should be given for:
- Lib/s names that will use this dependency
- Test/s names that will use this dependency

With this information the associated app/s and lib/s in the `project.yml` will be updated.
With this information the associated app/s and lib/s in the `project.yaml` will be updated.

### antler-pack --remove-dependency
`antler-pack --remove-dependency` will allow the user to remove a dependency from their project.
Expand All @@ -146,7 +146,7 @@ Prompts should be given for:
- Lib/s to remove the dependency from
- Test/s to remove the dependency from

With this information the associated app/s and lib/s in the `project.yml` will be updated.
With this information the associated app/s and lib/s in the `project.yaml` will be updated.

A default value for 'project all' should be given for the prompts to allow the dependency to be removed completely.

Expand All @@ -158,12 +158,12 @@ Prompts should be given for:
- New location?
- New version?

With this information the tool will update the associated `project.yml`.
With this information the tool will update the associated `project.yaml`.

### antler-pack --populate
`antler-pack --populate` should download any dependencies need for the project.

### C++ project.yml parsing library
### C++ project.yaml parsing library
The following structures and functions should exist.

```C++
Expand Down Expand Up @@ -210,10 +210,10 @@ class object {
std::unordered_set<dependency> dependencies;
};

// main structure for the project.yml file
// main structure for the project.yaml file
class project {
public:
// parse a project from a project.yml
// parse a project from a project.yaml
inline project(const char* filename);
void upsert_app(object&& app) noexcept;
void upsert_lib(object&& lib) noexcept;
Expand Down
11 changes: 5 additions & 6 deletions docs/usecases.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ this format. Additionally, it's human readable, and our project file can
edited by and advanced user, and text compares (e.g. via github PRs)
make sense.

Typically, the file is named `project.yaml`, though a more windows
friendly `.yml` file is supported and the user can directly call out
Project file name is `project.yaml`, `.yml` file extension is also supported. Also user can directly call out
any file (e.g. `silly_project_name.txt`) as the project file.


Expand Down Expand Up @@ -86,10 +85,10 @@ All the names are UTF8 strings which may contain multibyte symbols. Max length o
### Glossary:

- `Project` is a directory structure which contains the project file
(`project.yml`) in [YAML format](https://yaml.org/), description of
(`project.yaml`) in [YAML format](https://yaml.org/), description of
applications, libraries, test commadnds, and other dependencies.

- `Application` (App) is a binary (usually a smart contract) which is built from the description in the `project.yml`.
- `Application` (App) is a binary (usually a smart contract) which is built from the description in the `project.yaml`.

- `Test` is a command, binary, or script for testing various parts of the project.

Expand Down Expand Up @@ -237,7 +236,7 @@ aproj add ./projects/example --app --name app1 --ver "1" --lang "C++" --build "C
Removed because we are unsure about it for now.
-->

The system generates a YAML file "project.yml" in format:
The system generates a YAML file "project.yaml" in format:
<!--
removing the build for now.

Expand Down Expand Up @@ -322,7 +321,7 @@ Creates a subtree for a project in ./projects/example/apps
└──lib2/
└── project.yaml
├───tests
└───project.yml
└───project.yaml
```


Expand Down
5 changes: 3 additions & 2 deletions include/antler/project/project.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ namespace antler::project {
class project {

public:
// parse a project from a project.yml
// parse a project from a project.yaml

constexpr static inline std::string_view manifest_name = "project.yml";
constexpr static inline std::string_view manifest_name = "project.yaml";
constexpr static inline std::string_view manifest_alternative = "project.yml";
constexpr static inline std::string_view magic_comment = "#antler-proj::generated";
constexpr static inline std::string_view comment_preamble = "# This file was AUTOGENERATED.\n"
"# Modification or removal of the above lines will cause antler-proj to deem the project as invalid.\n"
Expand Down
9 changes: 5 additions & 4 deletions src/project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,13 @@ bool project::update_path(system::fs::path& path) noexcept {
}

for (;;) {
if (system::fs::exists(search_path / "project.yaml")) {
path = search_path / "project.yaml";
if (system::fs::exists(search_path / manifest_name)) {
path = search_path / manifest_name;
return true;
}
if (system::fs::exists(search_path / "project.yml")) {
path = search_path / "project.yml";
// alternative manifest name
if (system::fs::exists(search_path / manifest_alternative)) {
path = search_path / manifest_alternative;
return true;
}
if (search_path.empty() || search_path == "/")
Expand Down
4 changes: 2 additions & 2 deletions tools/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ namespace antler {
inline project::project load_project(const system::fs::path& path) {
auto p = system::fs::canonical(system::fs::path(path));
ANTLER_CHECK(project::project::update_path(p),
"path either did not exist or no `project.yml` file cound be found.");
"path either did not exist or neither `project.yaml` nor `project.yml` file cound be found.");
project::project proj;
ANTLER_CHECK(proj.from_yaml(project::yaml::load(p)),
"error while loading project.yml file");
"error while loading project file");
proj.path(p.parent_path());
return proj;
}
Expand Down
2 changes: 1 addition & 1 deletion tools/remove_from.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace antler {
remove_from_project(CLI::App& app) {
path = system::fs::current_path().string();
subcommand = app.add_subcommand("remove", "Add an app, dependency, library or test to your project.");
subcommand->add_option("-p, path", path, "This must be the path to the `project.yml` or the path containing it.")->default_val(".");
subcommand->add_option("-p, path", path, "This must be the path to the `project.yaml` or the path containing it.")->default_val(".");

app_subcommand = subcommand->add_subcommand("app", "Remove app from the project.");
app_subcommand->add_option("-n, name", obj_name, "The name of the app to remove.")->required();
Expand Down
4 changes: 2 additions & 2 deletions tools/tests/init_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_init_project():
assert(os.path.isdir("./test0/include"))
assert(os.path.isdir("./test0/ricardian"))
assert(os.path.isdir("./test0/libs"))
assert(os.path.isfile("./test0/project.yml"))
assert(os.path.isfile("./test0/project.yaml") or os.path.isfile("./test0/project.yml"))

project = load_project("./test0")
assert(project["project"] == "test0")
Expand All @@ -32,7 +32,7 @@ def test_init_project_2():
assert(os.path.isdir("./test1/include"))
assert(os.path.isdir("./test1/ricardian"))
assert(os.path.isdir("./test1/libs"))
assert(os.path.isfile("./test1/project.yml"))
assert(os.path.isfile("./test1/project.yaml") or os.path.isfile("./test1/project.yml"))

project = load_project("./test1")
assert(project["project"] == "abc")
Expand Down
2 changes: 1 addition & 1 deletion tools/tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def antler_in_proj_cmd(path, args):

def load_project(path):
""" Load a project.yml file """
with open("./{0}/project.yml".format(path), "r") as file_handle:
with open("./{0}/project.yaml".format(path), "r") as file_handle:
project = yaml.safe_load(file_handle)
return project

Expand Down
2 changes: 1 addition & 1 deletion tools/update.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ namespace antler {
update_project(CLI::App& app) {
path = system::fs::current_path().string();
subcommand = app.add_subcommand("update", "Update an app, dependency, library or test to your project.");
subcommand->add_option("-p, path", path, "This must be the path to the `project.yml` or the path containing it.")->default_val(".");
subcommand->add_option("-p, path", path, "This must be the path to the `project.yaml` or the path containing it.")->default_val(".");

app_subcommand = subcommand->add_subcommand("app", "Remove app from the project.");
app_subcommand->add_option("-n, name", obj_name, "The name of the app to remove.")->required();
Expand Down
2 changes: 1 addition & 1 deletion tools/validate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace antler {
if (verbose) {
std::cout << proj.to_yaml() << std::endl;
} else {
system::info_log("Valid format for an antler-proj project.yml");
system::info_log("Valid format for an antler-proj project.yaml");
}

if (!proj.has_valid_dependencies()) {
Expand Down