Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find the right git info in a project with submodules #169

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

MichaelScofield
Copy link
Contributor

The reason behind this PR:

We have a project "foo" like this:

foo
├── Cargo.toml
├── main.rs
├── my-submodule
│   ├── src
│   │   ├── Cargo.toml
│   │   ├── version.rs
│   │   ├── build.rs

The shadow::new() is called in build.rs, and the shadow_rs::shadow!(build); is in version.rs.

When I build the project "foo", the git info is that of "my-submodule", instead of "foo", which is not what I actually want(want git info of "foo" of course). This PR expose the "build" function to let projects with submodules decide what the right git repo is. PTAL @baoyachi

@baoyachi
Copy link
Owner

baoyachi commented Aug 2, 2024

LGTM. Thx @MichaelScofield .

@baoyachi baoyachi merged commit 458be25 into baoyachi:master Aug 2, 2024
7 checks passed
@MichaelScofield MichaelScofield deleted the flexible-for-submodule branch August 2, 2024 09:36
@baoyachi
Copy link
Owner

baoyachi commented Aug 2, 2024

@MichaelScofield New version publised, please use:

[dependencies]
...
shadow-rs = "0.31.0"

[build-dependencies]
shadow-rs = "0.31.0"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants