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

Push version infos during compilation #437

Closed
etcimon opened this issue Oct 10, 2014 · 6 comments
Closed

Push version infos during compilation #437

etcimon opened this issue Oct 10, 2014 · 6 comments

Comments

@etcimon
Copy link
Contributor

etcimon commented Oct 10, 2014

I'm translating a large library from C++ and it makes use of these constants, defined in the ./configure script:

enum BOTAN_VERSION_MAJOR = 2;
enum BOTAN_VERSION_MINOR = 0;
enum BOTAN_VERSION_PATCH = 0;
enum BOTAN_VERSION_DATESTAMP = 20141030;
enum BOTAN_VERSION_RELEASE_TYPE = "unreleased";
enum BOTAN_VERSION_VC_REVISION = "123";
enum BOTAN_DISTRIBUTION_INFO = "unspecified";

I can't think of a way on top of my head, but I think these should be set automatically by dub using the version control information from the git repository, probably writing it into an auto-generated module with a specific name.

@MartinNowak
Copy link
Member

The pre/post build steps get some variable passed via env.
You could pass the semver too.
https://github.com/D-Programming-Language/dub/blob/1e81a9296ed807c4f73e4131619931fc6c655fc4/source/dub/generators/generator.d#L449

@s-ludwig
Copy link
Member

Related: #6

@s-ludwig
Copy link
Member

The downside of an automatically generated module is that this makes replicating the build process without DUB more difficult. But on the other hand, getting programmatic access to the current version of a project is a constant nuisance in my experience (using GIT based hacks or manually maintained version constants), so having a built-in solution would definitely be a very nice to have thing.

@Geod24
Copy link
Member

Geod24 commented Dec 29, 2023

Duplicate of #1438 (well, it precedes it, but 1438 has more conversation).

@Geod24 Geod24 closed this as completed Dec 29, 2023
@etcimon
Copy link
Contributor Author

etcimon commented Dec 29, 2023

Imagine seeing an issue being replied to almost a decade later

@etcimon
Copy link
Contributor Author

etcimon commented Dec 29, 2023

Please don't let this one go stale #2753

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

No branches or pull requests

4 participants