question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[suggestion] Generate `Projects.kt` file with all subprojects

See original GitHub issue

I love using this plugin to manage external dependencies, but when setting up intra-project dependencies amongst subprojects of a single repo, I have to resort to using Stringly-typed values again with implementation(project(":...")). It would be really nice if this plugin could generate a solution for this problem as well.

My proposal is to generate a 3rd file, Projects.kt, and in it generate functions for referencing each Gradle subproject as a dependency. It would be especially nice if this file used nested objects to make it easier to reference.

I just hand-wrote this kind of file for my own project, and it seems to be working really well. Makes setting up and referencing my subprojects/groups of subprojects much easier, and it would be awesome to have this file generated automatically. The links below show sample usage of what this could look like, but I just threw this together and am open to any suggestions for better structure.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jmfayardcommented, Sep 4, 2019

Cool! Wait a bit that I’m done with issue #55 which includes quite a large refactoring. I will ping you

Le mer. 4 sept. 2019 à 16:54, Casey Brooks notifications@github.com a écrit :

Yeah, I like that approach better, passing enums/lists of enums to top-level extension functions. And I’d be happy to work on implementing this, it shouldn’t be too difficult.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jmfayard/buildSrcVersions/issues/61?email_source=notifications&email_token=AADQFSBOKT2DTXA7KGUGXT3QH7D2FA5CNFSM4ITJNHM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD533FCQ#issuecomment-527938186, or mute the thread https://github.com/notifications/unsubscribe-auth/AADQFSEBLPN5RJRBVEYY2B3QH7D2FANCNFSM4ITJNHMQ .

0reactions
jmfayardcommented, Oct 13, 2019

This is still a good tip for people busing the buildSrc

But this project will now focus on :refreshVersions

See Long term plan: focus on refreshVersions · Issue #104 ·

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure Kotlin extension for Gradle subprojects
1. Set up ./buildSrc ... Create a directory named buildSrc in your project root. Because buildSrc is a standalone project, create a ./buildSrc/ ......
Read more >
Add support for consolidated report in multi-project setup #1295
The reports are generated successfully in the sub-projects. What should I do to get a consolidated report of all sub-projects?
Read more >
Organizing Gradle Projects - Gradle User Manual
Source code and build logic of every software project should be organized in a meaningful way. This page lays out the best practices...
Read more >
Plans within plans: master projects and subprojects
When you insert a subproject into the master project, the two projects are linked and you can view all the information in the...
Read more >
Reducing boilerplate in Gradle multi-module projects
However, when you start adding more sub-projects, you will need to create the second file for every project you add. This file will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found