-
Notifications
You must be signed in to change notification settings - Fork 156
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
Single version across separate projects in a monorepo #845
Comments
It seems once the plugin passes the project directory (non-root dir) here, there is no way to back out to the root of the repo with jgit path filters as Would it be possible to have some flag option in the monorepo config for not passing the project dir? Line 254 in 876ab17
if (!includeProjectPath || path.isEmpty()) { |
This issue seems to be addressed on this page ... correct me if that's not what you need. Look particularly at the section that says
TLDR:
|
@Olatunji-Longe That only works for actual submodules, not separate projects. Projects in subdirectories have no way to "escape" the subdir to understand the version, only filters for version incrementing relative to the project. You cannot configure the subproject to use |
I have a repository which contains multiple gradle projects (not subprojects, but independent builds) and I wish to keep them on the same version.
I understand it is possible to configure the repository path via:
scmVersion { repository { directory.set(rootProject.file("../").path) } }
...which enables the non-root projects to see the git repo and pick up tags for versioning, however for incrementing and snapshots, it doesn't seem to take any commits outside its path into account. It seems like
monorepoConfig
is how we should be telling it how to include changes outside its dir when filtering the git log, but settingmonorepoConfig.include(listOf(rootProject.file("../").path))
doesn't seem to help. I noticed in jgit that path filters are supposed to be relative to the root of the repository, so I tried using.
as an include (egmonorepoConfig.dependenciesDirs.add(".")
) to see changes in the whole repo, which also didn't work.For example, I have a test project with the following layout:
❯ tree . ├── build.gradle.kts ├── gradle │ └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── project1 ├── build.gradle.kts ├── gradlew └── gradlew.bat 4 directories, 8 files
build.gradle.kts
:project1/build.gradle.kts
:If I have a v0.1.0 release followed by some commit, eg adding a README to the root, the versions diverge:
The docs state that a
-SNAPSHOT
is suffixed when not on a tag, but theproject1
version isn't being decorated despite the commit being ahead of thev0.1.0
tag. I'm guessing it has to do with the changes being made outside of theproject1
directory, but including the root path via monorepoConfig didn't help, though it's certainly possible I misunderstand its configuration.How can I get the non-root project to always have the same version?
The text was updated successfully, but these errors were encountered: