Final Report GSoC 2018 Android SDK Tools in Debian- Saif Abdul Cassim
Details of what this report contains
This is the final report for GSoC 2018- Debian Android tools project. This report also includes a comprehensive description on the work done on Kotlin during this period and how to move forward with the project. All my work is stored in salsa and you can find my forks there as well. The link to my profile is provided below. I have worked under the alias of m36, m36-guest and all my commits are made as Saif Abdul Cassim<saif.15@cse.mrt.ac.lk> or few made as root(done accidentally, so I ll explicitly provide links to these commits). You can find me always in the #debian-mobile(https://webchat.oftc.net)(I have logged in through matrix) and #debian-java(https://webchat.oftc.net) channels under the name of m36. https://salsa.debian.org/m36-guest
We were also asked to submit weekly report to debian with the work we did every week. The following are my 12 weekly reports.
- Week 1 --> https://lists.debian.org/debian-outreach/2018/05/msg00013.html
- Week 2 --> https://lists.debian.org/debian-outreach/2018/05/msg00031.html
- Week 3 --> https://lists.debian.org/debian-outreach/2018/06/msg00004.html
- Week 4 --> https://lists.debian.org/debian-outreach/2018/06/msg00031.html
- Week 5 --> https://lists.debian.org/debian-outreach/2018/06/msg00076.html
- Week 6 --> https://lists.debian.org/debian-outreach/2018/06/msg00112.html
- Week 7 --> https://lists.debian.org/debian-outreach/2018/06/msg00137.html
- Week 8 --> https://lists.debian.org/debian-outreach/2018/07/msg00020.html
- Week 9 --> https://lists.debian.org/debian-outreach/2018/07/msg00053.html
- Week 10 --> https://lists.debian.org/debian-outreach/2018/07/msg00078.html
- Week 11 --> https://lists.debian.org/debian-outreach/2018/07/msg00102.html
- Week 12 --> https://lists.debian.org/debian-outreach/2018/08/msg00010.html (I have used this page https://salsa.debian.org/snippets/115/edit to describe the work on kotlin instead of a debian wiki page)
My Experience with the Debian community and GSoC 2018
To be honest I started work with Debian and GSoC without believing in opensource and free software. You can ask my mentors how I troubled them with questions such as "Why opensource?", "Why do people get involved when there is no monetary rewards?" and such. But now I understand why. For me at least the main reason to do open source is because I can. say you want an extra feature in that music player you are using... if you are using a proprietary software you can sit and cry OR use a free software and add that feature yourself and get to know the community. Thank you Google and Debian so much for this opportunity. Thank you Kai-Chung Yan, Chirayu desai and Hans-Christoph Steiner I cannot thank you guys enough for this. I hope to continue to contribute to Debian in the future and be a long term contributor so maybe that way I can give something back. OK now those came out as very cheesy so lets get started with Progress I have made so far.
WORK DONE
In the initial days I mainly worked on updating existing android-tools packages to upstream version 8.1.0+23. I will list my commits in each of these projects and then dedicate a section for kotlin exclusively with the work done on it and how to proceed with it in the future.
PACKAGES THAT WERE UPDATED
android-platform-frameworks-native
- https://salsa.debian.org/android-tools-team/android-platform-frameworks-native/commit/7437ba6ac1254a9f783c18f82f31ad7b95522b5b
- https://salsa.debian.org/android-tools-team/android-platform-frameworks-native/commit/10f649e078d7f9e344dd3804a570de2214bcc074
- https://salsa.debian.org/android-tools-team/android-platform-frameworks-native/commit/a3ab681e9a01489797739dca7b112481fa9b1d35
- https://salsa.debian.org/android-tools-team/android-platform-frameworks-native/commit/c2fd3d9b20a6a253bbaa33d68a7fdb09247e60dd
- https://salsa.debian.org/android-tools-team/android-platform-frameworks-native/commit/a8df4e5e2fd7bd34eabf1a2a8dabb5541c41070d
- https://salsa.debian.org/android-tools-team/android-platform-frameworks-native/commit/794ce2c0c0a15727219007f4fdd8dfd81746efc2
- https://salsa.debian.org/android-tools-team/android-platform-frameworks-native/commit/fb49f5bd79366517884b718fc5536153546edf5f
- https://salsa.debian.org/android-tools-team/android-platform-frameworks-native/commit/1ebf5a5b7268b6e46e32dcd02233d104c56bed70
- https://salsa.debian.org/android-tools-team/android-platform-frameworks-native/commit/0bc27e002e14befd40948c309ae595eb10e8586b
- https://salsa.debian.org/android-tools-team/android-platform-frameworks-native/commit/35bc01a96c9c29ebdede2f1971433662b2b9778d
- https://salsa.debian.org/android-tools-team/android-platform-frameworks-native/commit/979f44e6da02d500adccdf7439836bc529858a7b
- https://salsa.debian.org/android-tools-team/android-platform-frameworks-native/commit/f3ebb61bd45a8a6eafec04f9c521bfde2c447173
- https://salsa.debian.org/android-tools-team/android-platform-frameworks-native/commit/2d15481011cc1a6d3b65da02ba937055571558c3
- https://salsa.debian.org/android-tools-team/android-platform-frameworks-native/commit/7262fb9d89472d0ba3ec8dc9ab688fe795005e01
- https://salsa.debian.org/android-tools-team/android-platform-frameworks-native/commit/28eb91b32ce07ae8bff191ec294ee4b8343ac205
android-platform-libcore
- https://salsa.debian.org/android-tools-team/android-platform-libcore/commit/27375e8cd13729e6ca87d1dab8a6cd767dfecd0f
- https://salsa.debian.org/android-tools-team/android-platform-libcore/commit/cbade1850823f862f8ec7dbb592f73f196673501
- https://salsa.debian.org/android-tools-team/android-platform-libcore/commit/81fd2367382b55f44bae1ac07236e4f34e0d930e
- https://salsa.debian.org/android-tools-team/android-platform-libcore/commit/cba9f7e9c4e5a12fd6ae3a1d40f33b055f04aeee
- https://salsa.debian.org/android-tools-team/android-platform-libcore/commit/550e69c7a26d1c97cee540d120954223418476a7
- https://salsa.debian.org/android-tools-team/android-platform-libcore/commit/f87007538c9746a51b2b7743e528a51156da080a
- https://salsa.debian.org/android-tools-team/android-platform-libcore/commit/b4e2d448f78fcf9ec358c8f451b12d1885e2648c
- https://salsa.debian.org/android-tools-team/android-platform-libcore/commit/aecdb0167dc995c1388e14717ffa74017a4206bc
android-platform-development
- https://salsa.debian.org/android-tools-team/android-platform-development/commit/7203bea56964c4be0a4cc5f2d50ac661e72be159
- https://salsa.debian.org/android-tools-team/android-platform-development/commit/41073bd21952e7e34980aa2805a6ed17cf974ecc
- https://salsa.debian.org/android-tools-team/android-platform-development/commit/895b70342eaf1aacd49d503ba9eef3ddcc354a68
- https://salsa.debian.org/android-tools-team/android-platform-development/commit/fb13940f0d0e7352a03a5a02d8def8a796212d83
- https://salsa.debian.org/android-tools-team/android-platform-development/commit/b86d7b9ebf86d3a200797f5f286484aa3da313f4
- https://salsa.debian.org/android-tools-team/android-platform-development/commit/538444fa3e94fc9fbc45e6cd96f3fa36a48ac7aa
- https://salsa.debian.org/android-tools-team/android-platform-development/commit/8b6933db137d8c692de0dd156f71f0136fa01809
Deliverables of above packages
- android-platform-frameworks-native --> https://packages.debian.org/source/experimental/android-platform-frameworks-native
- android-platform-libcore --> https://packages.debian.org/source/experimental/android-platform-libcore
- android-platform-development --> hasn't been uploaded to debian archive yet but the work is complete so you can run "debuild -b -rfakeroot -us -uc" from the root folder of this link(https://salsa.debian.org/android-tools-team/android-platform-development) and then "cd ../" and install the "*.deb" packages.
This concludes the major contributions that I made for android-tools. I have done some minor contributions like automated vcs version update and such but then those are like 2 commits per repo in about 15-20 repositories so I haven't extracted those commits but if need be you can review them in my profile along with the script I used to automate the stuff. Now I ll describe in detail the main course of this project........ packaging Kotlin.
KOTLIN
I took up the job of packaging Kotlin because it was a major blocker preventing the update of many of our android-tools packages as they depended on kotlin and kotlin wasn't packaged for Debian yet. To be able to package Kotlin we had a few restrictions firstly the latest version kotlin need a version of Gradle which was not available even in our unstable release. So I settled with packaging kotlin-1.1.1 since it seemed like the easiest of them all to build and package. In order to package kotlin it has be completely build-able from the Debian archive alone. So what this means is that we have to package a lot of other packages on which kotlin depends on. Kotlin-1.1.1 has 2 main scripts to build it namely the update_dependencies.xml(https://salsa.debian.org/m36-guest/kotlin-1.1.1/blob/master/update_dependencies.xml) and the build.xml(https://salsa.debian.org/m36-guest/kotlin-1.1.1/blob/master/build.xml). kotlin-1.1.1 --> https://salsa.debian.org/m36-guest/kotlin-1.1.1
update_dependencies.xml The update_dependencies.xml fetches the artifacts that are required by Kotlin-1.1.1. Even though this script fetches all the stuff we can't directly use these as they need to be available in debian archive itself. The update_dependecies.xml file contained link to some files which were no longer hosted and were replaced by their newer releases so I had to patch this file to get the closest releases. All patches to kotlin can be found here(inside debian/patches) https://salsa.debian.org/m36-guest/kotlin-1.1.1 . The update_dependencies.xml script downloads all these files inside 2 folder primarily namely the "ideaSDK" folder and the "dependencies" folder. I have now uploaded the current contents of these folders temporarily here --> https://salsa.debian.org/m36-guest/kotlin-temp-requirements.git .
build.xml This script like in every other ant project ever builds the project and uses the artifacts in the "ideaSDK" folder and the "dependencies" folder. I have patches this to use packages available in the Debian archive. I have also patched this build script to deviate from the regular way(commented in the patches mentioned above) so that it builds with our packages.
Now I ll go on to describe the files that are needed in each of the 2 folders I mentioned above. So the conventions for tagging them are (removed) means that these jars were removed from the folder and didn't affect the build process, but we will track them just incase a runtime bug should arise but this is unlikely because we use our internal compiler with the stdlib which we build to compile a chunk of the code in our build process itself so if there were an error it would have likely popped up here. (patched in) means I have patched this library into the build script and this was already packaged and available in the debian archive. (I packaged and patched in) means what is says.
dependencies folder
- android.jar --> libandroid-23-java (removed)
- jarjar.jar --> libjarjar-java (patched in)
- jansi.jar --> libjansi-java (patched in)
- jflex.jar --> jflex (removed)
- junit.jar --> junit (patched in)
- closure-compiler.jar --> libclosure-compiler-java (patched in)
- jline.jar --> libjline-java (fixed it,patched in(uses 3 more packages))
- native-platform --> libnative-platform-java (patched in)
- proguard.jar --> libproguard-java (patched it in)
- protobuf.jar --> libprotobuf-java(I packaged and patched in) https://salsa.debian.org/java-team/protobuf-2.git
- rhino.jar --> librhino-java(removed)
- asm-all.jar --> libasm-java (have a ant script inside the debian folder to rename the packages and produce a new jar)
- jna-platform.jar --> libjna-platform-java
- ant --> (removed)
- spullara/cli-parser --> (I packaged and patched in) https://salsa.debian.org/java-team/spullara-cli-parser
ideaSDK folder
- libjna-platform-java: /usr/share/java/jna-platform.jar (patched in)
- junit4: /usr/share/maven-repo/junit/junit/4.12/junit-4.12.jar (patched in/ ingonered the kotlin-test target since it was dependent on 4.11 of junit)
- libguava-java: /usr/share/java/guava.jar (create a softlink to the idea.sdk core directory)
- libpicocontainer-java: /usr/share/java/picocontainer.jar (needs pacakging version 1.3)(done) https://salsa.debian.org/m36-guest/picocontainer-1.3
- libxpp3-java: /usr/share/java/xpp3.jar (create a softlink to the idea.sdk core directory)
- libxstream-java: /usr/share/java/xstream.jar (create a softlink to the idea.sdk core directory)
- libjna-java: /usr/share/java/jna.jar (create a softlink to the idea.sdk core directory)
- jdom.jar (I packaged it and patched in) https://salsa.debian.org/m36-guest/jdom-intellij
- ibequinox-osgi-java /usr/share/java/org.eclipse.osgi.jar (create a softlink to the idea.sdk core directory)
- snappy-in-java.jar -->got a generator and depends on libequinox-osgi-java(/usr/share/java/org.eclipse.osgi.jar//copied to ideasdk/core)
- util.jar --> they have a comment in update_dependencies.xml saying that util.jar is only used since it wasn't in intellij-core.jar at the time... since we ll have to pakcage intellij-core now again I think it ll be alright.
- libintellij-annotations-java: has to be package version 16.02 (Done) https://salsa.debian.org/m36-guest/intellij-annotations.git
miscellaneous jars in random folders
- libatinject-jsr330-api-java: /usr/share/maven-repo/javax/inject/javax.inject/debian/javax.inject-debian.jar (patched in)
- libjsr305-java: /usr/share/java/jsr305.jar (patched in)
Now these are all the work that has been done. You can build Kotlin by calling "quilt push -a" then "debian/rules override_dh_clean" in the root file of the project and then proceed with an "ant" call. Make sure you have all the dependencies installed. I have added the commands to create the softlinks in the override_dh_clean target in debian/rules, you can view them there.Now for the sad part we still need to package the following packages that are needed by the dreaded ideaSDK/core folder
Needs Packaging
- oromatcher
- jps-model
- intellij-core
- log4j.jar --> https://github.com/apache/log4j
- libtrove3-java: /usr/share/java/trove4j.jar (have to package the https://github.com/JetBrains/intellij-deps-trove4j) caz some classes like tobjecthasingstratergy are not there
- libasm-java: /usr/share/java/asm-all.jar
The proper jars to these 6 packages can be found in the repository I have shared above with the current "dependencies" and "ideaSDK" folder --> https://salsa.debian.org/m36-guest/kotlin-temp-requirements.git . Once these 6 packages are done we can proceed with packaging kotlin which should be an easier task than this. You can find the versions of the packages required by kotlin-1.1.1 in https://www.jetbrains.com/intellij-repository/snapshots 163-EAP-SNAPSHOT. I ll try my best to finish packaging these 6 packages before the end of this month hopefully and finish packaging kotlin before the end of the next month.
GSoC-2018-FinalReport-SAIF_ABDUL_CASSIM.md