Skip to content
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

Feature request: Need support for includeBuild #100

Closed
rougsig opened this issue Dec 28, 2021 · 6 comments
Closed

Feature request: Need support for includeBuild #100

rougsig opened this issue Dec 28, 2021 · 6 comments

Comments

@rougsig
Copy link
Contributor

rougsig commented Dec 28, 2021

More details about includeBuild here

Include build can be used as dependency, but for gradle that kind of dependency is external dependency.
ProjectGraph can't work correct with includeBuild dependencies. For ProjectGraph includeBuild dependencies is external dependencies, not project dependencies. In that case not all modules can be found, and marked as unknownFiles.

@digitalbuddha
Copy link
Contributor

Sounds interesting, How would we get the git data for the external build? We would need it to find which files are changed.

@rougsig
Copy link
Contributor Author

rougsig commented Dec 28, 2021

Sample https://github.com/rougsig/AffectedModuleDetector/tree/main/sample

I've add failing test to includeBuild to that file sample/include-util/common/src/test/java/com/dropbox/detector/sample_util/ExampleUnitTest.kt. Run task for check. Task was green.

logs

[INFO] [amd] unknownFiles: [sample/build.gradle, sample/include-util/common/src/test/java/com/dropbox/detector/sample_util/ExampleUnitTest.kt], changedProjects: [], buildAll: false

In gradle dependencies to module in includeBuild realised like external dependency.
Like that: implementation "com.example.includeutil:common".

More info can be found here.


Expected behaviour is:

Project structure is:
app -> utils-module (in includeBuild)

Change in utils-module (in includeBuild).
Test will be executed for: app and utils-module (in includeBuild)

@rougsig
Copy link
Contributor Author

rougsig commented Jan 17, 2022

To find module from include build, we need to know group of that module.

I can try to make PR with that logic, but it have one problem. We need to register group id and path of include build.

@joshafeinberg
Copy link
Member

Sorry for the delay here but can you explain what you mean by "We need to register group id and path of include build" @rougsig? Are you saying that we would need to have them manually state any included builds?

I've played around with this a bit and it seems like the only way to get what included builds programmatically is to do gradle.includedBuilds but then we still don't get information of what dependencies those are replacing. I'm just not sure if this is feasible with the current gradle system

@rougsig
Copy link
Contributor Author

rougsig commented Jul 8, 2022

I've implemented my own version of affected-module-detector with includeBuild support. Actually affected-module-detecktor should resolve dependencies, not iterate by them as now.

@joshafeinberg
Copy link
Member

Alright, then I will close this but feel free to put up a PR for you includeBuild support if you are interested

And thank you for the note on how to better handle dependencies

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

No branches or pull requests

3 participants