nilsbraden / ttrss-reader-fork

An Android-Client for the self-hosted Tiny Tiny RSS feedreader
https://www.nilsbraden.de/TTRSS-Reader/
152 stars 41 forks source link

Provide play-services-free build flavour #288

Closed ghost closed 9 years ago

ghost commented 9 years ago

Google's play-services are non-free and thus breaking the build for fdroid, a free/libre/open-source app reposiory. Can this dependency easily be stripped e.g. by adding a build flavor?

nilsbraden commented 9 years ago

Might be possible I guess. A pull request with a finished implementation would be nice.

nilsbraden commented 9 years ago

The relevant files are:

ghost commented 9 years ago

I don't see any build flavours, was this closed for inactivity?

nilsbraden commented 9 years ago

Seemed to be inactive, yes. But leaving it opened is not a problem. I won't work on it at the moment though.

juk47ht commented 9 years ago

Hi nilsbraden. Is it possible to get an update on this issue please? I don't use Google Play so F-droid is usually my main source of getting apps. At the moment 1.84 works flawlessly - no complains on that front! - but I am afraid missing critical fixes on the future releases will put many F-droid users behind. Cheers for your support and this awesome fork!

nilsbraden commented 9 years ago

The guys from f-droid don't seem to be interested in communicating with me. I don't know in what way I can add support for their build so I am stuck. Here is a list of things to remove when building for f-droid though:

https://github.com/nilsbraden/ttrss-reader-fork/blob/master/ttrssreader/build.gradle#L67 https://github.com/nilsbraden/ttrss-reader-fork/blob/master/ttrssreader/src/main/java/org/ttrssreader/gui/MenuActivity.java#L105

If it helps I can also try to get the ProviderInstaller stuff out of the MenuActivity and into another class but I won't touch anything until I know what to do.

Also the f-droid metadata repository can be found here: https://gitlab.com/fdroid/fdroiddata/blob/master/metadata/org.ttrssreader.txt And the documentation of how to integrate new apps here: https://gitlab.com/fdroid/fdroiddata/blob/master/CONTRIBUTING.md

ghost commented 9 years ago

@nilsbraden: I opened the issue because I was asked if we could add it to F-Droid, I had no intention to work on it, since I know my way around F-Droid but am a rather inexperienced Android developer. Sorry for that misunderstanding.

To add flavors, you have to define tjhem in build.gradle like:

   productFlavors {
        play {
        }
        fdroid {
        }
    }

Instead of using compile 'com.google.android.gms:play-services-base:7.8.0' you specify it to be only used in the play flavor by changing it to playCompile 'com.google.android.gms:play-services-base:7.8.0'.

The last part needs some knowledge and restructuring of the actual app: Instead of putting all source in src/main/ you can add code for the play flavor in `src/play/. I don't know what is best to seperate the essential part and the play part so both versions work.

nilsbraden commented 9 years ago

Here we go, this should do the trick. Thanks for pointing out the right direction. :)

juk47ht commented 9 years ago

Well, I am no developer myself bu seeing how people collaborate with each other signals a great community and developer. Cheers you both.

ghost commented 9 years ago

Sorry for keeping you waiting, was just too busy. I added 1.86.1 to the build queue. It works fine locally, let's see how it turns out. Closing, since I don't expect any issues.

Ref: https://gitlab.com/fdroid/fdroiddata/commit/4b1e90810cfa41ce14aac7473485d82a45abdbf0