r/androiddev • • Sep 07 '17

Drone - The missing library manager for Android Developers

https://github.com/cesarferreira/drone
0 Upvotes

38 comments sorted by

46

u/nhaarman Sep 07 '17
  1. Go to the library's readme

  2. Copy the compile section

  3. Paste in build.gradle

  4. ??

  5. Profit

19

u/codeka Sep 07 '17

Compare to drone:

  1. Go to library's readme

  2. Realize that of course they don't list the drone command to use

  3. Open command prompt

  4. Try to figure out library's 'drone' name, because it wasn't in their readme

  5. Realize that the library hasn't been included in the done database

  6. drone new, populate the json file with a description cut'n'pasted from the readme in step 1

  7. Try to find the drone repository on GitHub again, realize that's basically impossible due to the hundreds of actual [drone libraries] (https://github.com/dronekit/dronekit-android) on there

  8. Create a pull request to the drone repo

  9. Wait for it be merged

  10. Run the drone command again to add the dependency

  11. ???

  12. Give up

1

u/cesarferreira Sep 08 '17

Go to library's readme Realize that of course they don't list the drone command to use

it's not supposed to be in the library's readme, it's an alternative to have to search google and find the compile line in the readme..

Open command prompt Try to figure out library's 'drone' name, because it wasn't in their readme

as you can see in drone's readme it says it's CREATOR/LIBRARY, so picasso? square/picasso, easy..

Try to find the drone repository on GitHub again, realize that's basically impossible due to the hundreds of actual drone libraries on there

in my readme it says that if you RUN drone hive will open the repository, no need to google anything.

Realize that the library hasn't been included in the done database drone new, populate the json file with a description cut'n'pasted from the readme in step 1 Create a pull request to the drone repo Wait for it be merged Run the drone command again to add the dependency

if you paid attention to the readme in the bottom gif you'd see that when you do DRONE NEW and type something like: square/picasso it will AUTO FILL everything for you, no need to copy and paste anything..

If you tried it you'd see that the DRONE NEW will add the library, you dont need to wait for any pull request to be accepted

9

u/nhaarman Sep 07 '17

Pro tip: you can even copy the maven xml setup and paste it in your gradle files. IntelliJ will convert it to gradle syntax for free.

1

u/cesarferreira Sep 08 '17

didn't know about this one, thanks

4

u/el_bhm Sep 08 '17

THIS IS SORCERY

1

u/cesarferreira Sep 08 '17

and repeat that 10 times for 10 libraries... OR... do

drone add square/retrofit app

drone add square/picasso app

drone add google/gson app

drone add square/okhttp app

drone add google/dagger app

etc.

and be done with it in a few seconds... what a no brainer right?

3

u/jaredsburrows Sep 07 '17

You can even go a step further and use Ben Mane's Gradle Version Plugin: https://github.com/ben-manes/gradle-versions-plugin.

Simply running gradlew dependencyUpdates will list out all of the latest dependencies for upgrades.

22

u/tofiffe Sep 07 '17

Trying to "simplify" existing solution? ☑️ NodeJS app? ☑️ Use emoji in Readme.md? ☑️ Use the word intuitive? ☑️ Mac screenshots? ☑️

5/5 hipster material

2

u/cesarferreira Sep 08 '17

so, your complaint is that the cli app was written in nodejs (irrelevant) and it has a readme with a good presentation? thanks dude

3

u/tofiffe Sep 08 '17

I agree, I did not mention that it was, in my opinion useless, since adding one line to build.gradle is a lot faster than installing this app, possibly not even having an entry in those repos.

1

u/cesarferreira Sep 08 '17

If you think about it you have like 50 libraries that are used in 95% of the apps (picasso, retrofit, rxjava, gson, etc.)

I made this because every time I want to add (lets say) butterknife I need to

  1. google butterknife

  2. go to the readme

  3. find the lines to copy

  4. notice that butterknife has 3 depedencies

  5. copy and paste in my gradle file

  6. OPTIONAL if it was not in jcenter, go to the main build gradle and put the custom URL

OR...

write: drone add jakewharton/butterknife app

and everything will be done for you automatically

1

u/tofiffe Sep 08 '17

So you can remember jakewharton/butterknife, bit not 'compile "com.jakewharton:butterknife"'?

3

u/cesarferreira Sep 08 '17

compile 'com.jakewharton:butterknife:8.8.1' annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

Can you remember all of this? And the versions?

VS remember that Jake Wharton made butterknife?

1

u/tofiffe Sep 08 '17

Yes, if I use a library and understand what it does I remember what I have to do to get it to work. It even tells you if your version is outdated.

8

u/endrohat Sep 07 '17

There was a reason it was missing. It wasn't necessary

2

u/cesarferreira Sep 08 '17

because it's not necessary to you it's not necessary to anyone? cool thinking dude

3

u/[deleted] Sep 08 '17

Don't you guys just copy and paste your entire dependencies block for every new app?

1

u/cesarferreira Sep 08 '17

Not really, to be honest

2

u/Zhuinden Sep 07 '17

I mean can't you just get the links from the maven repository and copy the Gradle link? Otherwise most libraries have an installation section that you just need to copy/paste to your gradle file.

1

u/cesarferreira Sep 08 '17

so 10 libraries = 10 google searches + 10 reading of readme files + 10 finds of the compile line + 10 copy pastes

2

u/Zhuinden Sep 08 '17

well 1 library seems to take 15 seconds so that would mean I can do that in 150 seconds which means it takes 2.5 minutes and needs to be done only once at start of the project, and that's without getting accustomed with a custom tool.

Better question is if this thing even supports jitpack.

1

u/cesarferreira Sep 08 '17

Yes it does support jitpack, I worked with them on this.

It took you 15 seconds because the server was outdated.. So it was pulling the latest version.

2

u/Zhuinden Sep 08 '17

No I mean by doing the google search and the copy paste into my gradle file.

1

u/cesarferreira Sep 08 '17

Ah I get it, my bad. If you do proofs of concept often (as I do a lot to try new stuff), learning this tool that is not that hard to memorize, will save you some time in the long term. Are you familiar with the mac tool homebrew ? It's similar, of course you can just Google everytime to install stuff but if you have a tool you can trust that will configure everything for you properly, why not just use it? That's why I made it

19

u/ArmoredPancake Sep 07 '17

Here we go again.

1

u/[deleted] Sep 07 '17

[removed] — view removed comment

24

u/ArmoredPancake Sep 07 '17

Another useless JS CLI.

it's so easy to write yarn add <library> and a library is imported into the project.

It's so easy to write compile <library> and a library is imported into the project.

2

u/Saketme Sep 07 '17

The only use I see is the ability to search libraries.

4

u/paramsen Sep 07 '17

It would make sense to have a IntelliJ plugin that lets you autocomplete/search packages, and indicate updates for 3rd party libs etc.

2

u/[deleted] Sep 07 '17

[removed] — view removed comment

1

u/cesarferreira Sep 08 '17

I often create POCs (proof of concept)s, so with this tool if I want something quickly that makes network calls for instance i'll quickly do

drone add square/retrofit app

drone add google/gson app

drone add square/okhttp app

etc.

3

u/BacillusBulgaricus ComposableThermosiphon Sep 07 '17

I just wish to have a standardized tool that shows a list of the updated libraries and their CHANGELOGs. Preferably in the IDE. Last time I checked the AS built-in feature that shows the latest deps versions wasn't working fine for my project.

2

u/[deleted] Sep 08 '17

If I have to know how the developers account of some library I use is called on GitHub, I have to go on Google, search for the library and go on their GitHub page anyway. At this point, I can just copy their compile block and the ProGuard configuration too. I'm not going to copy the creators name, open the shell, and use some cli tool to insert two lines I already have at this point.

-1

u/Hivito Sep 07 '17

Thanks man, this is actually pretty useful