digitalmars.D.announce - gen-package-version v0.9.0: New: Auto-generate version/timestamp
- Nick Sabalausky (35/35) Jun 13 2015 This was kind of taken from a cool trick I saw in dub's buildscript, but...
- Nick Sabalausky (17/17) Jun 14 2015 A couple fixes in v0.9.2:
- Nick Sabalausky (10/10) Jun 15 2015 One more followup, gen-package-version v0.9.3:
- Rikki Cattermole (2/12) Jun 15 2015 Will it support hg in future?
- Nick Sabalausky (8/25) Jun 15 2015 Possibly. All I'd need is an hg equivalent to "git describe". Looks like...
- Rikki Cattermole (7/19) Jun 15 2015 It's not a D project, but it does have tags and branches.
- Nick Sabalausky (3/27) Jun 16 2015 Cool. Just checked it out, looks like that command on the stackoverflow
- Rikki Cattermole (3/18) Jun 16 2015 Thanks, will be appreciated. Mostly for the purpose of keeping
- Nick Sabalausky (4/5) Jun 16 2015 Ask and ye shall receive ;) Now in gen-package-version's ~master:
- Rikki Cattermole (6/14) Jun 16 2015 Awesome thanks!
- Nick Sabalausky (5/9) Jun 16 2015 By request, Mercurial (hg) support now added in gen-package-version v0.9...
This was kind of taken from a cool trick I saw in dub's buildscript, but I figured it would be useful to have generalized in a convenient package, no messing with shell scripts or anything. https://github.com/Abscissa/gen-package-version gen-package-version: Automatically generate a D module with version and timestamp information (detected from git) every time your program or library is built. Additionally. all your in-between builds will automatically have their own git-generated version number, including the git commit hash (for example: v1.2.0-1-g78f5cf9). So there's never any confusion as to which "version" of v1.2.0 you're running! Full usage and instructions are at the link above, but here's a brief primer for those using it with dub: To use: ======= Add this to your dub.json: ----------------------------------------------------- "dependencies": { "gen-package-version": "~>0.9.0" }, "preGenerateCommands": ["dub run gen-package-version -- package.name --src=path/to/src"] ----------------------------------------------------- It'll generate "path/to/src/package/name/packageVersion.d". Then just import that and use: ----------------------------------------------------- module package.name.main; import std.stdio; import package.name.packageVersion; void main() { writeln("My Cool Program ", packageVersion); writeln("Built on ", packageTimestamp); } -----------------------------------------------------
Jun 13 2015
A couple fixes in v0.9.2: https://github.com/Abscissa/gen-package-version/blob/master/CHANGELOG.md - Fixed: helper/gen_version.sh isn't set as executable when checked out through dub, preventing successful build on Posix. - Fixed: The old recommeded "preGenerateCommands" led to problems (project dependencies that use gen-package-version would run it from the wrong directory). So...this is the correction on what you should include in your dub.json (if using gen-package-version through dub): ----------------------------------------------------- "dependencies": { "gen-package-version": "~>0.9.2" }, "preGenerateCommands": ["cd $PACKAGE_DIR && dub run gen-package-version -- your.package.name --src=path/to/src"] -----------------------------------------------------
Jun 14 2015
One more followup, gen-package-version v0.9.3: https://github.com/Abscissa/gen-package-version/blob/master/CHANGELOG.md - Enhancement: If detecting the version number via git fails, attempt to detect it via the currect directory name (ex, ~/.dub/packages/[project-name]-[version-tag]). - Enhancement: Don't bother running git if there's no .git directory. - Enhancement: Bootstraps itself, so gen-package-version itself enjoys the following fix: - Fixed: Fails to detect version number for packages fetched by dub (since they lack .git).
Jun 15 2015
On 16/06/2015 12:45 p.m., Nick Sabalausky wrote:One more followup, gen-package-version v0.9.3: https://github.com/Abscissa/gen-package-version/blob/master/CHANGELOG.md - Enhancement: If detecting the version number via git fails, attempt to detect it via the currect directory name (ex, ~/.dub/packages/[project-name]-[version-tag]). - Enhancement: Don't bother running git if there's no .git directory. - Enhancement: Bootstraps itself, so gen-package-version itself enjoys the following fix: - Fixed: Fails to detect version number for packages fetched by dub (since they lack .git).Will it support hg in future?
Jun 15 2015
On 06/16/2015 12:40 AM, Rikki Cattermole wrote:On 16/06/2015 12:45 p.m., Nick Sabalausky wrote:Possibly. All I'd need is an hg equivalent to "git describe". Looks like there's one listed here: http://stackoverflow.com/questions/6693209/is-there-an-equivalent-to-gits-describe-function-for-mercurial But I haven't really been using hg so I don't really have any hg projects handy, and I've kinda forgotten even the basics. Could you post a hg command that will clone for me an OSS project I could use to test?One more followup, gen-package-version v0.9.3: https://github.com/Abscissa/gen-package-version/blob/master/CHANGELOG.md - Enhancement: If detecting the version number via git fails, attempt to detect it via the currect directory name (ex, ~/.dub/packages/[project-name]-[version-tag]). - Enhancement: Don't bother running git if there's no .git directory. - Enhancement: Bootstraps itself, so gen-package-version itself enjoys the following fix: - Fixed: Fails to detect version number for packages fetched by dub (since they lack .git).Will it support hg in future?
Jun 15 2015
On Tuesday, 16 June 2015 at 06:35:47 UTC, Nick Sabalausky wrote:On 06/16/2015 12:40 AM, Rikki Cattermole wrote:It's not a D project, but it does have tags and branches. https://bitbucket.org/sdorra/scm-manager/wiki/Home $ hg clone ssh://hg bitbucket.org/sdorra/scm-manager Example tag 1.12 $ hg up 1.12 should switch to it.On 16/06/2015 12:45 p.m., Nick Sabalausky wrote:Possibly. All I'd need is an hg equivalent to "git describe". Looks like there's one listed here: http://stackoverflow.com/questions/6693209/is-there-an-equivalent-to-gits-describe-function-for-mercurial But I haven't really been using hg so I don't really have any hg projects handy, and I've kinda forgotten even the basics. Could you post a hg command that will clone for me an OSS project I could use to test?[...]Will it support hg in future?
Jun 15 2015
On 06/16/2015 02:51 AM, Rikki Cattermole wrote:On Tuesday, 16 June 2015 at 06:35:47 UTC, Nick Sabalausky wrote:Cool. Just checked it out, looks like that command on the stackoverflow link should work well.On 06/16/2015 12:40 AM, Rikki Cattermole wrote:It's not a D project, but it does have tags and branches. https://bitbucket.org/sdorra/scm-manager/wiki/Home $ hg clone ssh://hg bitbucket.org/sdorra/scm-manager Example tag 1.12 $ hg up 1.12 should switch to it.On 16/06/2015 12:45 p.m., Nick Sabalausky wrote:Possibly. All I'd need is an hg equivalent to "git describe". Looks like there's one listed here: http://stackoverflow.com/questions/6693209/is-there-an-equivalent-to-gits-describe-function-for-mercurial But I haven't really been using hg so I don't really have any hg projects handy, and I've kinda forgotten even the basics. Could you post a hg command that will clone for me an OSS project I could use to test?[...]Will it support hg in future?
Jun 16 2015
On Tuesday, 16 June 2015 at 07:14:35 UTC, Nick Sabalausky wrote:On 06/16/2015 02:51 AM, Rikki Cattermole wrote:Thanks, will be appreciated. Mostly for the purpose of keeping dub repo as the base support level for e.g. Github vs Bitbucket.On Tuesday, 16 June 2015 at 06:35:47 UTC, Nick Sabalausky wrote:Cool. Just checked it out, looks like that command on the stackoverflow link should work well.[...]It's not a D project, but it does have tags and branches. https://bitbucket.org/sdorra/scm-manager/wiki/Home $ hg clone ssh://hg bitbucket.org/sdorra/scm-manager Example tag 1.12 $ hg up 1.12 should switch to it.
Jun 16 2015
On 06/16/2015 12:40 AM, Rikki Cattermole wrote:Will it support hg in future?Ask and ye shall receive ;) Now in gen-package-version's ~master: https://github.com/Abscissa/gen-package-version/commit/a6b0aa8536c4080a5ee56f14f62aae9495a8c180 I'll add .hgignore support and then tag a new release soon, maybe tomorrow.
Jun 16 2015
On Tuesday, 16 June 2015 at 07:26:34 UTC, Nick Sabalausky wrote:On 06/16/2015 12:40 AM, Rikki Cattermole wrote:Awesome thanks! Now I need to start working on my web server again to take advantage of it! (even though it is on Github). Although it looks more like a web application server then a web server right now.Will it support hg in future?Ask and ye shall receive ;) Now in gen-package-version's ~master: https://github.com/Abscissa/gen-package-version/commit/a6b0aa8536c4080a5ee56f14f62aae9495a8c180 I'll add .hgignore support and then tag a new release soon, maybe tomorrow.
Jun 16 2015
On 06/14/2015 01:24 AM, Nick Sabalausky wrote:https://github.com/Abscissa/gen-package-version gen-package-version: Automatically generate a D module with version and timestamp information (detected from git) every time your program or library is built.By request, Mercurial (hg) support now added in gen-package-version v0.9.4: https://github.com/Abscissa/gen-package-version/blob/master/CHANGELOG.md - Enhancement: Support detecting the version number via Mercurial (hg). - Enhancement: Support .hgignore for Mercurial working directories.
Jun 16 2015