Skip to content

Conversation

@yunlishao
Copy link
Contributor

Summary

Implements automatic version management for TrafficLayer.exe using git tags as the single source of truth. Version header is now auto-generated during build from the latest git tag, eliminating manual version updates.

Related Issues / Tasks

Closes #7

Type of Change

  • Maintenance / Refactor

Affected Modules / Components

  • CommonLib/RealSimVersion.h - Now auto-generated (removed from repo)
  • CommonLib/RealSimVersion.h.in - New template file with placeholders
  • scripts/generate_version.ps1 - PowerShell script that reads git tags and generates header
  • TrafficLayer/TrafficLayer/TrafficLayer.vcxproj - Added Pre-Build Event for all configurations
  • .gitignore - Excludes auto-generated RealSimVersion.h

Implementation Details

Workflow:

  1. Visual Studio Pre-Build Event runs generate_version.ps1
  2. Script reads latest git tag (e.g., v0.7.0)
  3. Parses version into MAJOR.MINOR.PATCH
  4. Generates RealSimVersion.h from template
  5. Build continues with correct version info

Version Strategy:

  • Git tags control version (format: vX.Y.Z)
  • MAJOR.MINOR controlled by GitHub milestones
  • PATCH manually tagged for bug fixes
  • Each tag tied to GitHub Release

Current Version:

  • Tagged v0.7.0 (156 commits since v0.6.0)
  • Includes: CMake modernization, dSPACE 2024a support, SUMO-CARLA enhancements, CarMaker CM13 integration, ReadTheDocs setup, Python helpers, bug fixes

Test Cases

  • ✅ Manually ran generate_version.ps1 - successfully generated version header from v0.7.0 tag
  • ✅ Verified generated header contains correct version numbers (0.7.0)
  • ✅ Verified git commit hash included for traceability
  • ✅ Tested gitignore excludes auto-generated file

Environment

  • Windows 10/11
  • PowerShell 5.1+
  • Git 2.x+
  • Visual Studio 2022 (v143 toolset)

Checklist

Additional Notes

For developers:

  • First build after pulling will auto-generate RealSimVersion.h
  • Never manually edit version numbers - use git tags only
  • To create new version: git tag vX.Y.Z -m "message" then push tag

Future enhancements (not in this PR):

- Add RealSimVersion.h.in template with placeholders for version info
- Create PowerShell script (generate_version.ps1) to read git tags and generate version header
- Add Pre-Build Event to TrafficLayer.vcxproj for all configurations (Debug/Release, Win32/x64)
- Update .gitignore to exclude auto-generated RealSimVersion.h
- Remove RealSimVersion.h from version control (now auto-generated)

Version header now automatically syncs with git tags during build.
Tagged v0.7.0 to reflect 156 commits of updates since v0.6.0 including:
CMake modernization, dSPACE 2024a support, SUMO-CARLA enhancements,
CarMaker CM13 integration, ReadTheDocs setup, Python helpers, and bug fixes.

Related: #7, #41
@yunlishao yunlishao requested a review from cjffly October 16, 2025 22:28
@yunlishao yunlishao changed the title Implement git-tag-based automatic version management #7/automatic version management Oct 17, 2025
@yunlishao yunlishao merged commit f92e045 into main Oct 17, 2025
@yunlishao yunlishao deleted the maintenance/#7_cleanup branch October 17, 2025 17:03
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.

clean up

3 participants