Contribute to version
Contributions are welcome. This guide covers project conventions and workflow.
Development Environment
Prerequisites
- JDK: 17.0.19 or later
- Clang / LLVM: For Scala Native tests
- cmake: For building the vendored libgit2 (Native backend)
Running Tests
sbt test # All tests
sbt version-jvm/test # JVM modules
sbt version-native/test # Native modules
Formatting
sbt format # Apply scalafmt + scalafix + license headers
sbt check # Verify formatting compliance
Architecture
Module Structure
| Module | Scope | Dependencies |
|---|---|---|
version |
Version model | boilerplate |
version-resolution |
Version derivation | version, JGit (JVM), libgit2 (Native) |
version-cli |
CLI application | version-resolution, scopt |
sbt-version |
sbt plugin | version-resolution |
version-testkit |
Test utilities | (no external dependencies) |
Version Resolution
The resolution engine in version-resolution follows the Specification. Key components:
KeywordParser- extracts directives from commit messagesTargetVersionCalculator- computes target version from keywordsResolver- orchestrates the full resolution workflow
Per-platform Git backends:
- JVM:
JvmGitRepositorywrapping JGit - Native:
NativeGitRepositorywrapping libgit2 (statically linked, built via cmake)
Pull Request Guidelines
- One concern per PR - focused changes are easier to review
- Include tests - coverage for new functionality and regressions
- Follow existing patterns - consistency aids maintenance
- Update documentation - keep docs in sync with changes
- Run static checks -
sbt checkmust pass
Specification Changes
The Specification is normative. If code contradicts the specification, the specification wins. Changes to version resolution behaviour require:
- Specification update with rationale
- Implementation changes
- Test coverage
- Documentation updates
Licence
By contributing, you agree that your contributions will be licensed under the Apache License, Version 2.0.
In this article