Skip to content

Commit

Permalink
Change [package] in Veryl.toml to [project] #65
Browse files Browse the repository at this point in the history
  • Loading branch information
dalance committed Jan 16, 2023
1 parent 1815d7a commit 5aebac7
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 27 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## [Unreleased](https://github.com/dalance/veryl/compare/v0.1.14...Unreleased) - ReleaseDate

* [Changed] modport separator from `.` to `::`
* [Changed] modport separator from `.` to `::` [#65](https://github.com/dalance/veryl/issues/65)
* [Changed] `[package]` in Veryl.toml to `[project]` [#82](https://github.com/dalance/veryl/issues/82)

## [v0.1.14](https://github.com/dalance/veryl/compare/v0.1.13...v0.1.14) - 2023-01-12

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,31 +86,31 @@ cargo install veryl veryl-ls

## Usage

* Create a new package
* Create a new project

```
veryl new [package name]
veryl new [project name]
```

* Create a new package in an existing directory
* Create a new project in an existing directory

```
veryl init [path]
```

* Format the current package
* Format the current project

```
veryl fmt
```

* Analyze the current package
* Analyze the current project

```
veryl check
```

* Build target codes corresponding to the current package
* Build target codes corresponding to the current project

```
veryl build
Expand All @@ -127,9 +127,9 @@ Transpiled SystemVerilog: https://github.com/dalance/veryl/tree/master/testcases
### Package Configuration

```toml
[package]
name = "name" # package name
version = "0.1.0" # package version (semver is recommended)
[project]
name = "name" # project name
version = "0.1.0" # project version (semver is recommended)

[build]
clock_type = "posedge" # default clock type [posedge|negedge]
Expand Down
2 changes: 1 addition & 1 deletion Veryl.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[package]
[project]
name = "veryl-testcase"
version = "0.1.0"

Expand Down
2 changes: 1 addition & 1 deletion crates/metadata/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mod metadata;
mod metadata_error;
pub use metadata::{Build, ClockType, Format, Metadata, Package, ResetType, Target};
pub use metadata::{Build, ClockType, Format, Metadata, Project, ResetType, Target};
pub use metadata_error::MetadataError;
pub use semver;
10 changes: 5 additions & 5 deletions crates/metadata/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::str::FromStr;

#[derive(Debug, Serialize, Deserialize)]
pub struct Metadata {
pub package: Package,
pub project: Project,
#[serde(default)]
pub build: Build,
#[serde(default)]
Expand Down Expand Up @@ -51,7 +51,7 @@ impl FromStr for Metadata {
}

#[derive(Debug, Serialize, Deserialize)]
pub struct Package {
pub struct Project {
pub name: String,
pub version: Version,
#[serde(default)]
Expand Down Expand Up @@ -129,7 +129,7 @@ mod tests {
use semver::{BuildMetadata, Prerelease};

const TEST_TOML: &'static str = r#"
[package]
[project]
name = "test"
version = "0.1.0"
Expand All @@ -146,9 +146,9 @@ indent_width = 4
#[test]
fn load_toml() {
let metadata: Metadata = toml::from_str(TEST_TOML).unwrap();
assert_eq!(metadata.package.name, "test");
assert_eq!(metadata.project.name, "test");
assert_eq!(
metadata.package.version,
metadata.project.version,
Version {
major: 0,
minor: 1,
Expand Down
2 changes: 1 addition & 1 deletion crates/veryl/src/cmd_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl CmdInit {
write!(file, "{}", toml).into_diagnostic()?;
file.flush().into_diagnostic()?;

println!("Created \"{}\" package", name.to_string_lossy());
println!("Created \"{}\" project", name.to_string_lossy());
} else {
bail!("path \"{}\" is not valid", self.opt.path.to_string_lossy());
}
Expand Down
2 changes: 1 addition & 1 deletion crates/veryl/src/cmd_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl CmdNew {
write!(file, "{}", toml).into_diagnostic()?;
file.flush().into_diagnostic()?;

println!("Created \"{}\" package", name.to_string_lossy());
println!("Created \"{}\" project", name.to_string_lossy());
} else {
bail!("path \"{}\" is not valid", self.opt.path.to_string_lossy());
}
Expand Down
10 changes: 5 additions & 5 deletions crates/veryl/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ enum Commands {
Dump(OptDump),
}

/// Create a new package
/// Create a new project
#[derive(Args)]
pub struct OptNew {
pub path: PathBuf,
Expand All @@ -51,7 +51,7 @@ pub struct OptNew {
pub verbose: bool,
}

/// Create a new package in an existing directory
/// Create a new project in an existing directory
#[derive(Args)]
pub struct OptInit {
#[arg(default_value = ".")]
Expand All @@ -66,7 +66,7 @@ pub struct OptInit {
pub verbose: bool,
}

/// Format the current package
/// Format the current project
#[derive(Args)]
pub struct OptFmt {
/// Target files
Expand All @@ -85,7 +85,7 @@ pub struct OptFmt {
pub verbose: bool,
}

/// Analyze the current package
/// Analyze the current project
#[derive(Args)]
pub struct OptCheck {
/// Target files
Expand All @@ -100,7 +100,7 @@ pub struct OptCheck {
pub verbose: bool,
}

/// Build the target codes corresponding to the current package
/// Build the target codes corresponding to the current project
#[derive(Args)]
pub struct OptBuild {
/// Target files
Expand Down
2 changes: 1 addition & 1 deletion crates/veryl/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub fn gather_files<T: AsRef<Path>>(base_dir: T) -> Result<Vec<PathBuf>> {

pub fn create_default_toml(name: &str) -> String {
format!(
r###"[package]
r###"[project]
name = "{}"
version = "0.1.0""###,
name
Expand Down
4 changes: 2 additions & 2 deletions crates/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use miette::{ErrReport, GraphicalReportHandler, GraphicalTheme, ThemeCharacters,
use semver::Version;
use veryl_emitter::Emitter;
use veryl_formatter::Formatter;
use veryl_metadata::{Build, Format, Metadata, Package};
use veryl_metadata::{Build, Format, Metadata, Project};
use veryl_parser::Parser;
use wasm_bindgen::prelude::*;

Expand Down Expand Up @@ -44,7 +44,7 @@ fn render_err(err: ErrReport) -> String {

fn metadata() -> Metadata {
Metadata {
package: Package {
project: Project {
name: "".into(),
version: Version::parse("0.0.0").unwrap(),
authors: vec![],
Expand Down

0 comments on commit 5aebac7

Please sign in to comment.