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

The :app project is special #4

Closed
6 tasks
phreed opened this issue Jun 10, 2022 · 1 comment
Closed
6 tasks

The :app project is special #4

phreed opened this issue Jun 10, 2022 · 1 comment
Labels

Comments

@phreed
Copy link

phreed commented Jun 10, 2022

Just how special :app is not clear from the documentation.

Process to reproduce.

  • clone the project's git repository
  • git mv app foo
  • ./gradlew build -> see error below
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':bespin:compileJava'.
> Could not resolve all dependencies for configuration ':bespin:compileClasspath'.
   > Project with path ':app' could not be found in project ':bespin'.

Resolution:

  • change :app to :foo in two files
    • ./gradle/plugins/base-plugins/src/main/kotlin/org.example.consistent-resolution.gradle.kts
    • ./gradle/plugins/base-plugins/src/main/kotlin/org.example.root.gradle.kts

This may be the intended behavior but it was not what I expected.
The documentation around :app including dependencies should get some attention.
My specific issue was that I created an application with a different name.
It was unable to resolve any dependencies unless it shared that dependency with :app.

@jjohannes
Copy link
Owner

Thanks for the feedback. It is indeed intentional. Do you have suggestion where I could put some more documentation? Inside the build scripts you needed to touch?

To explain:

  • org.example.root.gradle.kts - This is for making the build easier accessible. The assumption is that :app:run is the central method to run the application. So we add a lifecycle task for it to the root project. The idea is that if you run :tasks you only see the tasks you usually need to work on the project to make the project easier to access for users working with it for the first time. This is completely optional.
    More explanation: https://www.youtube.com/watch?v=sOo0p4Gpjcc&t=1m17s
  • org.example.consistent-resolution.gradle.kts - This follows the idea, that :app is special in so far that it provides the complete runtime classpath and with that the dependency versions that will be used "for real". So we pull that into all projects with consistent resolution to make sure we use these versions everywhere.
    More explanation: https://www.youtube.com/watch?v=YYWhfy6c2YQ&t=5m05s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants