Skip to content

Commit

Permalink
Fix #4 - Set libName when appropriate
Browse files Browse the repository at this point in the history
Also skip setting build, libName, libPath if the default would do instead.
  • Loading branch information
kolloch committed Apr 22, 2019
1 parent 20dbc4d commit e2a0cc6
Show file tree
Hide file tree
Showing 19 changed files with 551 additions and 298 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"crate2nix" = { git = "https://github.com/kolloch/crate2nix" }
```

* Support for `libName` != `crateName`. Fixes #4.

# 0.2.0 - 0.2.1

* Added comments to the generated nix build file to indicate which attributes are public and unlikely to change.
Expand Down
405 changes: 136 additions & 269 deletions Cargo.nix

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions sample_projects/bin/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sample_projects/bin_with_default_features/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sample_projects/bin_with_default_features/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#[cfg(feature = "use_lib")]
use hello_world_lib;
use renamed_hello_world_lib;

fn main() {
#[cfg(feature = "use_lib")]
hello_world_lib::hello_world("bin_with_default_features");
renamed_hello_world_lib::hello_world("bin_with_default_features");
#[cfg(feature = "do_not_activate")]
println!("COMPILED with do_not_activate");
}
2 changes: 2 additions & 0 deletions sample_projects/bin_with_lib_dep/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sample_projects/bin_with_lib_dep/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fn main() {
hello_world_lib::hello_world("bin_with_lib_dep");
renamed_hello_world_lib::hello_world("bin_with_lib_dep");
}
2 changes: 2 additions & 0 deletions sample_projects/bin_with_lib_git_dep/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions sample_projects/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ version = "0.1.0"
authors = ["Peter Kolloch <info@eigenvalue.net>"]
edition = "2018"

[lib]
# Regression test for issue #4
name = "renamed_hello_world_lib"

[dependencies]
2 changes: 2 additions & 0 deletions sample_projects/lib_and_bin/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e2a0cc6

Please sign in to comment.