## IMPORTANT NOTE:
## When you use this page as a template for creating your project page:
## * please remove all lines starting with two hashes (##)
## * except the acl line, please keep that, but remove one hash, so it reads #acl ...
## * fix the acl line so it has the correct page instead of the sample Project/...Group
##acl Project/AdminGroup:admin,read,write,delete,revert Project/ReadWriteGroup:read,write Project/ReadGroup:read
##master-page:Unknown-Page
##master-date:Unknown-Date
#format wiki
#language en
= Google Summer of Code 2020 =
This page is to document the work done during Google Summer of Code 2020 by [[ https://salsa.debian.org/theloudspeaker-guest | Raman Sarda ]] for the [[https://wiki.debian.org/SummerOfCode2020/Projects#SummerOfCode2020.2FApprovedProjects.2FAndroid_SDK_Tools_in_Debian.Android_SDK_Tools_in_Debian | Android SDK Tools in Debian ]] project.
<
>
The page also serves as the final report for Google Summer oF Code 2020.
<
>
Mostly packaging was done during the duration of the Project. All of the work has been pushed to salsa.
== Initial Project Aim ==
The end goal of the project was to make the entire Android toolchain and SDK tools available in debian archives. So that a user can develop android apps using only free software and easy to use debian packages.
<
>
For most of the Android packages, Gradle and Kotlin are main prerequisites. We have Gradle 4.4.1 currently in Debian archives and Kotlin is not present.
== Overview of the work done ==
[[https://developer.android.com/studio/releases/gradle-plugin#updating-gradle | Android Gradle Plugin Documentation ]] mentions that Gradle 6.1.1 is required for latest Android Gradle Plugin. At the time of start of the project, Gradle 6.4.1 was the latest one. So I decided to upgrade Gradle to 6.4.1. And that has taken almost all of the duration of the Project. Kotlin was picked up by [[ https://samyak-jn.tk/ | Samyak Jain ]], My partner for the same project.
<
>
All of the progress is logged in this [[https://salsa.debian.org/android-tools-team/admin/-/issues/16|issue]] on salsa.
== Tasks Completed during GSoC 2020 including Community Bonding period and Coding period. ==
1. Update android-platform-libcore. [[https://salsa.debian.org/android-tools-team/android-platform-libcore/-/merge_requests/3 | merge request]]
<
>
2. Confirm that javaslang is not requred anyore for kotlin. [[https://salsa.debian.org/android-tools-team/admin/-/issues/8#note_167147 | salsa issue]]
<
>
3. Built Gradle using upstream methods and saved in a salsa repo. [[https://salsa.debian.org/theloudspeaker-guest/gradle-source-build | gradle-source-build]]
<
>
4. Update Gradle to 6.4.1 [[https://salsa.debian.org/theloudspeaker-guest/gradle/ | Repository]]
<
>
5. Gather required info and list of packages to be replaced by newer platform-tools. [[https://salsa.debian.org/android-tools-team/admin/-/issues/22 | salsa issue]]
<
>
6. Help in packaging emulator. [[https://salsa.debian.org/Manas-kashyap-guest/google-android-emulator-installer/-/commit/e13a68e4883292469874fc53b416b210f602ecb2|Commit]]
Gradle update was the project that took the most time, so I will explain it in detail here:
<
>
There were tons of blockers as Gradle 4.4.1 is written in groovy and all the later versions are written in Kotlin. Hence the 4.4.1 gradle which we have in archives isn't capable of building the updated Gradle.
<
>
This means that Upgrading Gradle is almost like packaging it for the first time, without any bootstraps and no other tools that can even build it.
<
>
We have a bootstrap script in debian/ folder which creates a bootstrap .deb from upstream release of Gradle which can be used to build gradle.
The bootstrap deb provided a way to build Gradle but a lot of other changes were needed to Gradle as all the patches had to be updated to work with build.gradle,kts files.
<
>
One of the major blockers was the hook in gradle 4.4.1 which made Gradle look for artifacts in local directories instead of online mvn repositories. The hook not only needed translation to kotlin but also needed to be modified according to upstream changes to [[https://github.com/gradle/gradle/commit/cb8d1762066084109168ceabbc50cb98869e889f|ModuleIdentifier]].
<
>
Another major blocker was unavailability of zinc in Debian archives. Gradle needs zinc but we don't have the updated Scala build tool which contains zinc. I had to patch out the languageScala task as a work around for this. we can include the task once we ave updated SBT in Debian.
<
>
A manpage was also added back as the previous one was removed by upstream.
<
>
Since a lot more artifacts are generated in Gradle 6.4.1, all of then needed to be included in appropriate .poms files so that they are installed correctly along with Gradle. A separate task to generate correct pom.xml files for each artifact was also updated.
<
>
All of the above changes along with standard debian changes like standards version, debhelper-compat, etc can be found as commits [[https://salsa.debian.org/theloudspeaker-guest/gradle/-/commits/testing2| here]].
All the steps required to arrive at the current working status of Gradle are described in the salsa issue [[https://salsa.debian.org/android-tools-team/admin/-/issues/16#note_190550 | here]].
== Weekly reports ==
I have written weekly reports for the duration of coding period and community bonding period. They can be found below:
<
>
[[https://lists.debian.org/debian-outreach/2020/06/msg00001.html| Community bonding period]]
<
>
[[https://lists.debian.org/debian-outreach/2020/06/msg00007.html| Week 1]]
<
>
[[https://lists.debian.org/debian-outreach/2020/06/msg00012.html| Week 2]]
<
>
[[https://lists.debian.org/debian-outreach/2020/06/msg00015.html| Week 3]]
<
>
[[https://lists.debian.org/debian-outreach/2020/07/msg00001.html | Week 4]]
<
>
[[https://lists.debian.org/debian-outreach/2020/07/msg00014.html | Week 5 and 6]]
<
>
[[https://lists.debian.org/debian-outreach/2020/08/msg00001.html | Week 7]]
<
>
[[https://lists.debian.org/debian-outreach/2020/08/msg00004.html | Week 9]] (Week 8 is missing because of my mistake in counting weeks. Sorry for that.)
<
>
[[https://lists.debian.org/debian-outreach/2020/08/msg00010.html | Week 10]]
<
>
[[https://lists.debian.org/debian-outreach/2020/08/msg00012.html | Week 11]]
<
>
[[https://lists.debian.org/debian-outreach/2020/08/msg00023.html | Week 12]]
== Weekly Blogs ==
I have also written weekly blogs for the same and they can be found on my personal blog [[https://theloudspeaker.home.blog/category/gsoc/ | here]].
== Android Tools Team BoF at Debconf20 ==
An [[https://debconf20.debconf.org/talks/34-android-tools-bof/ | Android tools team BoF]] was hosted for first time during Debconf. I participated and discussed the current status of my project and future of Android packages along with fellow members of the team and my partners Samyak Jain and Manas Kashyap.
Overall, this has been a great project with lots of learning and fun. I plan to continue to work with the team and finish what I started.