RobWin / jgitflow-gradle-plugin

A Gradle Plugin which adds tasks to support the Gitflow Workflow.
Apache License 2.0
48 stars 44 forks source link

Each task always starting at rootProject of current project #21

Open cvantreese opened 7 years ago

cvantreese commented 7 years ago

Doesn't really look like a bug, but in each of the Task classes, when the class calls the get() or forceInit() methods in JGitFlow, it always passes in the projectDir as project.rootProject.projectDir.

This doesn't work very well in multi-project builds.

If I have a structure like this: RootProject ----.git -----Sub-Project 1 ----------.git -----Sub-Project 2 ----------.git

Whenever I use the plugin, it will only operate git commands for RootProject. In my case, each sub-project has its own git repository. RootProject here is really just to store a common build.gradle and because we deal with a bunch of legacy code with a bunch of dependencies between the subprojects.

So bottom line: I'd like to change this to use project.projectDir. Those same methods always take the directory passed in and search upwards until it finds the .git directory anyway, so the result for single project builds should be the same, as well as multi-project builds where it is all on one repository.

If you'd like this change, I already changed the code and could submit a pull request. I just need to test my assumption above about having no impact.

RobWin commented 7 years ago

Hello, yes, feel free to create a PR when it's working as expected. Thanks :+1: