/GSoC-21-CASTOR

The significance of this repo is to provide my final report of GSoC'21 with CASTOR org. This report is a full summary of the GSoC work that I completed this summer.

GSoC'21 @CASTOR FINAL REPORT

GSoC-logo

General Information 📝

Organization: CASTOR
Project: DEPCLEAN
Tasks:

  1. Implementation of a depclean-gradle-plugin like depclean-maven-plugin.
  2. Implement a feature in depclean-maven-plugin to analyze multi-module projects.
  3. Implementation of some new tests.

Student: Abhay Singh
Mentors: Thomas Durieux, César Soto Valero & Benoit Baudry
My proposal: Click here

Abstract 📜

This summer, I was selected for GSoC to work on project DepClean for CASTOR organization. CASTOR is a research software center at KTH Royal institiute 🏛️ . It performs lots of cool stuffs like developing software tools, perform excellent research, train world class Graduates and a lot more. One of the best software tools which is provided by CASTOR is depclean. It is a tool to automatically remove dependencies that are included in the dependency tree of java projects but are not used in the code. It detects and removes all the unused dependencies declared in the pom.xml file of the project or imported from its parent pom.xml. This tool can only be used in maven-based java projects. For more information visit here

Goals 🎯

  • Previously depclean was confined only to maven-based java projects, but due to the increasing popularity of Gradle, the project requires a feature so that depclean could be used on gradle-based java projects too. So, my main goal for the project was to implement a depclean-gradle plugin so that the tool depclean could analyze Gradle projects.
  • Secondly, the existing depclean maven plugin was failing on the multi-module maven project i.e. the plugin was not providing the correct output when there are dependent modules inside a multi-module maven project. So my second goal was to fix this bug.
  • My third and last goal was to implement some new tests for the depclean-core and depclean maven plugin.

Results 🚀

Now the project depclean has a gradle plugin just like maven one, which can analyze and debloat out the unused dependencies from a gradle-based java project too. It also has all the optional parameter which was present in depclean gradle maven-plugin. Also, I fixed the multi-module bug too i.e. now depclean-maven plugin will provide the correct (desired) results whenever it will encounter the dependent modules inside a multi-module project. In the end, I added some new tests for the depclean core and all of my code that I have written during GSoC with proper documentation. Proud to say that, I have successfully achieved my goals that I planned to do during the GSoC period. 🎉 Here are some results of the tasks that I have completed during GSoC, you can treat them as a working prototype. 😉

Contributions 🎁

Here are some stats of my contributions to project DepClean during GSoC:

  • I made a total of 13 PRs during GSoC, out of which 11 got successfully merged and 2 got closed.
  • In those 11 successfully merged PRs, I made a total of 35 commits during the program.
  • Overall up to now I had contributed with 4367++ 918-- lines of codes to this project out of which 3914++ 809-- lines of code have been written during the program.

Github contribution-snap

Here is the list of PRs (both open & closed) that I created during GSoC but if anyone only wants to see all of my commits then he/she may visit here.

      PULL   REQUESTS   COMMITS                                           DESCRIPTION       STATUS
#94 This PR marked the starting of the implementation of DepClean Gradle Plugin. It also covers the analysis part of the plugin which is required to collect all the dependencies from the project itself and then using them to get the used artifact of the project from depclean core. 🟪Merged
#95 This PR implements the abstract classes or methods which are must to build a gradle plugin like action and tasks classes. 🟪Merged
#96 In this PR, I implemented complete Gradle Action i.e. the working of the depclean gradle plugin. 🟪Merged
#97 In this PR, I added some new (but based on maven plugin) optional parameters to the plugin to make it highly configurable and to provide flexibility in its usage. 🟪Merged
#98 In this PR, I implemented some functional test which are needed for the plugin to avoid unnecessary failures or crashes and to ensure that plugin is providing a desired output. 🟪Merged
#99 In this PR, I added gradle build to depclean workflow (github actions) to check for any build failures on new PRs. 🟪Merged
#100 This PR marked the implementation of json and csv optional parameters for depclean gradle plugin. These parameters help depclean to show its result in the provided format (.json or .csv). Also, this PR marked the complete deployment of depclean-gradle plugin. 😃 🟪Merged
#101 In this PR, I added support (fixed bug) for the correct analysis of dependent modules of a multi-module project. 🟪Merged
#103 In this PR, I added a unit test for the core of depclean, more precisely it will test the working of asm. 🟪Merged
#104 In this PR, I added a unit test to ensure the correct working of core-graph which is used as a node in the project. 🟪Merged
#105 In this PR, I added a unit test for core-class analyzer, it will ensure that after analyzing a non-null class, the analyzer must return the desired output 🟪Merged

List of my closed PRs during GSoC

  • #89 - This PR was made to show the demo of depclean gradle plugin implementation.
  • #93 - This PR contains the complete implementation of depclean gradle plugin, but was closed due to messy git history, unnecessary commits and lack of commit information.

List of issues on which I majorly worked upon during GSoC

Communication (Chat) 🗣️

In our very first virtual meet, we decided to keep all our technical discussions to be open to all for future references. So, all of our formal (technical) discussion took place over GitHub. Here are the required threads links

Future plans ⏲️

The last three months of my life were unforgettable. This time was very precious to me, and I hope that it was so too for my community. After GSoC, I would like to continue the same spirit of the contribution that I maintained during GSoC. I would like to get involved more in the community and will be happy to guide new developers as well. I will also like to work on some new (if any) or existing projects from my organization. In the end, I will try my best to be more and more helpful to the community. 😇 If anyone wants any kind of help or wants to connect with me, then he/she is just two clicks away.

Key takeaways 🧠

There's a lot that I learned from GSoC, I mean what can be better than working on a community product that is used by around 10k users. This is the list of my key takeaways from this program.

  • Got experience of working on a community product.
  • Learned lots of new things in Java, and also learned some new concepts in OOPS.
  • Learned lots of new things about project management tools like Gradle and Maven and also learned about dependency management.
  • Got experienced developing Gradle & Maven plugins.
  • Learned about how to work in a team or with a broad community on single or multiple projects.

Acknowledgement 👏

On this ending note, I want to thank my mentors Thomas Durieux, César Soto Valero & Benoit Baudry for constantly supporting me from the very beginning of my contributions. I am very thankful for their patient behavior whenever I got stuck and their suggestions that helped me in resolving them. Also, I am thankful to the whole CASTOR family who provided me this wonderful opportunity of working on such an amazing project.

I would also like to thank my family and my friends who constantly supported and helped me throughout the program. Special thanks to Mitul varshney for helping me out during my tough times of debugging. ❤️

In the end, I would like to thank Google for organizing such a wonderful program and also kudos to me who successfully completed this program. 😉 I am ending this report with an image, which precisely describes my feelings of this summer.

Summer-creation

During this summer I thought that I am one of the character of this famous cartoon who is working on some cool things with his friends. I will never forget this period of my life.:wink:

Thanks for your precious time. 👋