Skip to content

Commit 86a8a87

Browse files
authored
Merge pull request #93 from Belosnegova/patch-2
Google Summer of Code 2024 news
2 parents 07dc273 + ad63851 commit 86a8a87

File tree

15 files changed

+262
-0
lines changed

15 files changed

+262
-0
lines changed
119 KB
Loading
133 KB
Loading
373 KB
Loading
283 KB
Loading
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
title: "Google Summer of Code 2024 – Adding Android Support to the Gradle Build Server"
3+
date: 2025-01-21 20:03
4+
coverImage: "./cover.png"
5+
socialImage: "./social.png"
6+
---
7+
8+
9+
The Kotlin Foundation sponsored four projects for the [Google Summer of Code 2024](https://summerofcode.withgoogle.com/archive/2024/organizations/kotlin-foundation), and we are excited to announce the completion of the Adding Android Support to the Gradle Build Server project.
10+
11+
This project brought Android project support to the Gradle Build Server. Despite starting with limited Gradle API knowledge, contributor Tanish Ranjan successfully implemented features like composite build support, Java Home handling, and Android project discovery. These enhancements have been integrated into production, enriching Gradle for Kotlin/Android development.
12+
13+
We thank [Tanish Ranjan](https://www.linkedin.com/in/tanish-ranjan/) and the team of mentors from Gradle and Microsoft – Oleg Nenashev, Donát Csikós, Bálint Hegyi, Sheng Chen, and Reinhold – for their valuable contributions to the Kotlin and Gradle ecosystems.
14+
15+
Check out the [project page](https://community.gradle.org/events/gsoc/2024/gradle-build-server-android/).
16+
17+
## Introduction
18+
19+
Hi everyone, my name is [Tanish Ranjan](https://www.linkedin.com/in/tanish-ranjan/), and last year I participated in Google Summer of Code (GSoC) 2024\. I had the amazing opportunity to collaborate with folks from Gradle, Microsoft, and Google to bring [Android support to the Gradle Build Server](https://summerofcode.withgoogle.com/programs/2024/projects/Guphkt1v), under the umbrella of the Kotlin Foundation.
20+
21+
Today, I’m excited to share my journey – from finding out about GSoC to completing my project. If you’re considering applying for GSoC or just curious about the experience, hopefully my story will give you some insights\!
22+
23+
## How I discovered GSoC (Spoiler: it was last minute\!)
24+
25+
I’ll be honest – I had no idea what GSoC was until a friend casually mentioned it to me during a phone call. The kicker? This was just **a week before the contributor application** was set to open\!
26+
27+
Within that week, I dove deep into learning about GSoC – the fantastic learning experiences and career opportunities it offers. Pretty quickly, I made up my mind to get involved. I started browsing through the list of registered organizations, hoping to find a project related to **Android development**, since that’s where my skills were strongest.
28+
29+
A [LinkedIn post](https://www.linkedin.com/posts/androiddev_the-kotlin-foundation-is-taking-part-in-activity-7175587337827942401-gZnq?utm_source=share&utm_medium=member_desktop) caught my attention – [Android developers](https://www.linkedin.com/showcase/androiddev/) were talking about how the Kotlin Foundation was one of the organizations participating in GSoC. After going through Kotlin Foundation’s project ideas, one grabbed my attention: adding [Android support to the Gradle Build Server](https://kotlinlang.org/docs/gsoc-2024.html#gradle-build-server-support-for-android-projects-medium-or-hard-175-hrs-or-350-hrs). It sounded challenging and aligned perfectly with my skills, so I decided to go for it.
30+
31+
## Crafting my proposal (And why it took multiple attempts)
32+
33+
When the **Contributor Application Phase** began, contributors could send in up to three proposals, but I chose to focus all my energy on just one: the project with the **Kotlin Foundation**.
34+
35+
At this point, I reached out to the **organization admin**, which turned out to be a game-changer. They reviewed our proposals, offering feedback on what was missing. One of the most common mistakes (including mine\!) was not specifying clear **deliverables**. Everyone wrote about themselves and the project they wanted to contribute to, but we weren’t clear about what we’d actually deliver.
36+
37+
I had to revise my proposal twice before I was happy with it. Finally, I submitted it.
38+
39+
## The moment of truth: Getting accepted
40+
41+
On **May 1, 2024**, the accepted contributors were announced. I remember that night clearly. I was working on a freelance project when I received an email at around **11:30 pm** with the subject: “*Congratulations, your proposal with Kotlin Foundation has been accepted\!*
42+
43+
![Getting accepted](image1.png)
44+
<p></p>
45+
46+
I couldn’t contain my excitement – I was literally bursting with joy\! **Having just graduated high school in 2023 and not started university yet**, the opportunity to work with **industry professionals** from Google, Microsoft and Gradle felt surreal.
47+
48+
With my proposal accepted, I dove into researching technologies I’d need for the project, such as [**JSON-RPC**](https://www.jsonrpc.org/) and [**Build Server Protocol (BSP)**](https://build-server-protocol.github.io/docs/specification), while also setting up my work environment.
49+
50+
## Community Bonding Phase: Meeting the Team
51+
52+
The first formal step was the **Community Bonding Phase**. A meeting was organized to introduce all the mentees to the team and admins, where we discussed the projects and how to approach them and set up regular **sync-up meetings**.
53+
54+
![Meeting the Team](image2.png)
55+
<p></p>
56+
This phase helped us ease into the collaboration and set the stage for the real coding to begin.
57+
58+
59+
## First coding phase: Learning Gradle from scratch
60+
61+
When the **first coding phase** started, I was assigned my first task: adding **composite build support** to the Gradle Build Server. Here’s the catch – I had **no prior experience** with the [**Gradle API**](https://docs.gradle.org/current/javadoc/index.html) or the [**Gradle Tooling API**](https://docs.gradle.org/current/javadoc/org/gradle/tooling/package-summary.html). So far I had only skimmed the tip of the iceberg by using Gradle in building Android projects.
62+
63+
The first few weeks were tough, as I struggled to get up to speed. But here’s a key lesson I learned: It’s perfectly okay **not to know everything** at the start. Mentors are there to guide you, but it’s important to do your own research and tackle hurdles first. When you’re stuck, that’s when mentors step in and provide the support you need.
64+
65+
Once I got comfortable with the technologies and Gradle Build Server project, my work pace picked up. After completing the [**LanguageExtension downcast**](https://github.com/microsoft/build-server-for-gradle/pull/160) fix (which turned out to be a prerequisite for my first task), I tackled the [**composite builds**](https://github.com/microsoft/build-server-for-gradle/pull/154). This led to my first task being merged just in time for my **mid-term evaluation**.
66+
67+
## Mid-term evaluation and a new challenge
68+
69+
A few weeks before the **mid-term evaluation**, a new task was added to my GSoC project: **Android project discovery** for the Gradle Build Server. This was a significant addition, but I was excited for the challenge.
70+
71+
While the evaluations were being processed, I also started working on **Java Home Handling** in the Gradle Build Server. Juggling these tasks allowed me to stay ahead and keep making progress.
72+
73+
[Gradle in Google Summer of Code 2024 - Mid-Term Project Demos](https://youtu.be/UN0AFCLASZA?t=371&si=5rcmiwhqZrPN_NTb)
74+
75+
## Final coding phase: Tackling the hardest part
76+
77+
The **final coding phase** began with me completing [**Java Home Handling**](https://github.com/microsoft/build-server-for-gradle/pull/165) and submitting a pull request. However, a new update of Gradle for Java extension delayed the PR’s merge. But this delay actually worked in my favor – it gave me time to reconsider our approach to handling Java Home.
78+
79+
One of my mentors advised against over-engineering the implementation, as it could obscure the logic of Java Home selection and confuse users. Simplifying the approach meant reworking the implementation, but it resulted in a clearer and better experience overall. It was a win-win for the end users.
80+
81+
My final and most challenging task was adding [**Android project discovery**](https://github.com/microsoft/build-server-for-gradle/pull/173). This involved working with the [**AGP (Android Gradle Plugin) API**](https://developer.android.com/reference/tools/gradle-api), which had very little documentation on extracting project information for language features.
82+
83+
I reached out to my organization admin, and they connected me with developers from **Google** who work on **AGP**. Collaborating with them helped me extract most of the required information. For anything that the AGP API didn’t publicly expose, I found creative workarounds.
84+
85+
By the end, I successfully added Android project support to the Gradle Build Server\! And here’s the most exciting part: **every piece of code I wrote was integrated directly into production**. Each of my contributions was merged into the **next release of the Gradle Build Server**, meaning the work I did became part of the **official releases of** **VSCode’s [Gradle for Java](https://github.com/microsoft/vscode-gradle) extension**\!
86+
87+
![Final coding phase](image3.png)
88+
89+
## Wrapping up: Reflections on my GSoC experience
90+
91+
Completing this project was an incredibly rewarding experience. Not only did I gain technical skills, but I also learned the value of **collaboration** and **communication**, and being persistent when tackling challenging tasks.
92+
93+
To anyone considering GSoC, especially beginners: **go for it**\! Don’t worry if you’re not an expert – this program is all about learning. And trust me, it’ll be one of the most fulfilling experiences of your programming career.
94+
95+
Thanks for reading about my GSoC journey. Feel free to [drop me](https://www.linkedin.com/in/tanish-ranjan/) any questions or thoughts\! 🙂
96+
97+
If you’re interested in the technical details of what I contributed, be sure to check out my [**project page**](https://community.gradle.org/events/gsoc/2024/gradle-build-server-android/) for an in-depth look at my work on the [**Gradle Build Server**](https://github.com/microsoft/build-server-for-gradle).
119 KB
Loading
119 KB
Loading
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: "Google Summer of Code 2024 – Android Support in `kotlinx-benchmark`"
3+
date: 2025-01-21 20:02
4+
coverImage: "./cover.png"
5+
socialImage: "./social.png"
6+
---
7+
8+
9+
The Kotlin Foundation sponsored a project to implement Android support in the `kotlinx-benchmark` library as part of [Google Summer of Code 2024](https://summerofcode.withgoogle.com/archive/2024/organizations/kotlin-foundation), and we are excited to announce its completion.
10+
11+
Thank you to [Qizhao Chen](https://github.com/kx412764776) and the mentor team from Google and JetBrains – Abduqodiri Qurbonzoda, Dustin Lam, and Rahul Ravikumar – for your great input.
12+
13+
Check out the [`kotlinx-benchmark` library](https://github.com/Kotlin/kotlinx-benchmark).
14+
15+
## Introduction
16+
17+
The [`kotlinx-benchmark` library](https://github.com/Kotlin/kotlinx-benchmark) is an open-source tool for benchmarking Kotlin code on various platforms, including the JVM, JS, wasmJs, and native. However, the library lacks support for benchmarking on Android. This project integrated this functionality using the existing Android benchmarking library `androidx.benchmark` to ensure that the current functionality supports Android as well.
18+
19+
## Goals of the project
20+
21+
The main goals for this project were to:
22+
23+
* Automatically detect Android targets in Kotlin Multiplatform projects and retrieve the corresponding compilation output.
24+
* Create a template Android project that can be used to run the benchmarks.
25+
* Retrieve benchmark annotations from the Android target and use the `androidx.benchmark` library to run these benchmarks in the generated project.
26+
* Display the benchmark results in the console during execution and write the final results to a file for further analysis.
27+
28+
## Achievements
29+
30+
The project yielded the following key achievements:
31+
32+
* **Android target detection and compilation output**: Implemented detection of Android targets in Kotlin Multiplatform projects and retrieval of the necessary compilation outputs.
33+
* **Template Android project generation**: Developed a mechanism to generate a template Android project in the build directory, allowing benchmarks to run seamlessly in an Android environment.
34+
* **Annotation mapping and code generation**: Decompiled the compilation output of the Android target and retrieved the annotations with associated data, mapped the annotations to the `androidx.benchmark` configuration, and generated the necessary benchmark code that can be run by the androidx.benchmark library.
35+
* **Test validation**: Ensured that the template project and generated code could compile and run successfully on environments, validating the flexibility and robustness of the solution.
36+
* **Capture and reporting of benchmark results**: Captured benchmark data from Logcat during execution, with measurement data output to the console and the final benchmark results being written in a file.
37+
38+
## Next steps
39+
40+
Further improvements will focus on:
41+
42+
* Adding Android-specific configuration options to enhance flexibility when running benchmarks.
43+
* Fetching raw benchmarking results from `androidx.benchmark` in binary format to replace the current Logcat-based data capture method.
119 KB
Loading
119 KB
Loading

0 commit comments

Comments
 (0)