Skip to content

Conversation

abhirajadhikary06
Copy link
Contributor

This PR resolves Issue #9 with the following updates:

Gradle Build Overview: Detailed AGP role, build types (debug, release).
Build Management: Flavors, product dimensions, dynamic delivery modules.
Managing Dependencies: Version conflicts, catalogs, Kotlin Multiplatform.
Building Projects: Gradle wrapper, APKs, CI/CD steps.
Optimizing Builds: Build caching, parallel execution, Gradle Daemon.
Extending AGP: Custom plugins, task integration.
Migration Guide: Groovy to Kotlin DSL, Kapt to KSP.
Troubleshooting AGP: Common build issues, bottlenecks.
@oleg-nenashev, please review and merge to the main branch if everything looks good.

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the draft! I am definitely +1 for expanding some of the entries to the sections, but, if we go with teaser sections, they should be considerably more polished.

I suggest to:

  • Have a small 101 overview of the AGP plugin with 1-2 examples in Kotlin and references to the pages
  • Have new pages for Troubleshooting and Performance where we have original content to reference
  • Keep just references for the remaining sections

```

This command compiles and packages the APK in `debug` mode. Learn more about building Android projects at [Building project](https://developer.android.com/build/building-cmdline).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest collapsing those for parts to a short overview on this page and references. It can be done with one example in Kotlin and then references to the use-cases

Copy link
Contributor Author

@abhirajadhikary06 abhirajadhikary06 Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gradle provides tasks for building your Android projects, including compiling code, packaging APKs, and generating app bundles. Using the **Gradle wrapper**, you can ensure build consistency across environments.

#### Example of Building an APK with Kotlin DSL:
```kotlin
tasks.register("assembleDebug") {
    doLast {
        println("Building APK in debug mode...")
    }
}

This Kotlin example registers a task to build the APK in debug mode. For more detailed steps on building projects and packaging apps, visit the Building Projects Guide.




### **7. Migration Guide**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, not a recipe per se. I would keep a reference until there is substantial content

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### **7. Migration Guide**
### **7. Migration Guide**
With the shift from **Groovy** to **Kotlin DSL** in the Android ecosystem, migrating your build scripts is essential. This guide helps you transition your build configurations and annotation processing from **Kapt** to **KSP**.
For detailed steps and best practices, refer to the [official Migration Guide](https://developer.android.com/build/migrate-to-kotlin-dsl).

@oleg-nenashev oleg-nenashev added the documentation Improvements or additions to documentation label Oct 23, 2024
@abhirajadhikary06
Copy link
Contributor Author

@oleg-nenashev Please check for the changes I have made according to the suggestions requested by you.

@oleg-nenashev
Copy link
Member

Looks like troubleshooting and performance contents haven't been moved yet, right?

@abhirajadhikary06
Copy link
Contributor Author

abhirajadhikary06 commented Oct 24, 2024

A new readme for troubleshooting page has been added already and some contents have been added too.

Edit :
Sorry for the overlook I am adding the contents...just give me few minutes.

Edit - 2 :
Now the contents are updated.

@abhirajadhikary06
Copy link
Contributor Author

Hope you could merge my contents with the main branch now.

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix indenting of the Kotlin code, and then we are ready to go. I do have some ideas about restructuring the texts, but I will do them in the subsequent PRs

@abhirajadhikary06
Copy link
Contributor Author

Ok Sir, I'll be doing the changes in some moment.

@oleg-nenashev
Copy link
Member

oleg-nenashev commented Oct 24, 2024 via email

@abhirajadhikary06
Copy link
Contributor Author

abhirajadhikary06 commented Oct 24, 2024

Please fix indenting of the Kotlin code, and then we are ready to go. I do have some ideas about restructuring the texts, but I will do them in the subsequent PRs
I found indentation errors in (### 4. Building Projects) :

tasks.register("assembleDebug")  {
doLast {
println("Building APK in debug mode...")
}
}

Corrected to :

tasks.register("customAssembleDebug") {
    doLast {
        println("Building APK in debug mode...")
    }
}

Another error was found in (### 8. Troubleshooting AGP) :

configurations.all {

resolutionStrategy {

force("com.google.guava:guava:27.0.1-android")

}

}
Corrected to :

configurations.all {
    resolutionStrategy {
        force("com.google.guava:guava:27.0.1-android")
    }
}

I hope now it is all set to be merged.

@abhirajadhikary06
Copy link
Contributor Author

abhirajadhikary06 commented Oct 24, 2024

Thank you! And no need to use "sir" 😉

I feel that addressing you as "Sir" is essential, given the immense seniority and experience you hold in your field. It’s a level of expertise that would take me years to achieve. The way you guided me through the errors, while being so understanding, truly reflects both your humanity and your seniority 😊🙏

@oleg-nenashev
Copy link
Member

I feel that addressing you as "Sir" is essential, given the immense seniority and experience you hold in your field...

This is mostly a cultural matter. I mentored quite a lot of students from India, and I know using "Sir" is common there, as well as other gendered titles. Open-source communities are normally informal and many people may get irritated, and many explicitly say to avoid that due to the risk of gender mistakes, e.g. https://google.github.io/gsocguides/student/communication-best-practices , https://zulip.com/development-community/#communication-style .

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! let's get it landed and improve incrementally

@oleg-nenashev oleg-nenashev merged commit 4e4aa2e into gradle:main Oct 24, 2024
1 check passed
@abhirajadhikary06
Copy link
Contributor Author

abhirajadhikary06 commented Oct 24, 2024

If I had the permission to improve the Readme of the Gradle's original repo also add Gradle's participation in Hacktober 2024, then I would done that after raising a new issue on the same.

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

Successfully merging this pull request may close these issues.

2 participants