Open tajobe opened 3 weeks ago
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 .
does nothing and/
is treated as empty and fails the non-empty check.
Would it be possible to have some flag option in the monorepo config for not passing the project dir? EG at https://github.com/allegro/axion-release-plugin/blob/876ab173185112ee25b2d7efb651e2f67abf625b/src/main/java/pl/allegro/tech/build/axion/release/infrastructure/git/GitRepository.java#L254
if (!includeProjectPath || path.isEmpty()) {
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:
...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:
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?