Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make app buildable for new devs #93

Open
AllanWang opened this issue Jan 9, 2019 · 6 comments
Open

Make app buildable for new devs #93

AllanWang opened this issue Jan 9, 2019 · 6 comments

Comments

@AllanWang
Copy link
Collaborator

I think we talked about this before, but unfortunately the app won't compile without the service json.

Not sure how other projects really deal with this (beyond requiring any contributor to get their own json), but one thing you could consider is splitting up the project in models. All the parsing doesn't depend on Android and pure kotlin devs can contribute. The general UI components (per application) do not depend on how data is fetched, and we can test their layouts through integration tests. Then you can package it all together, and other devs may not need to deal with google services at all.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processReleaseGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it. 
   Searched Location: 
  /Users/allanwang/PA/MyMartlet/app/src/nullnull/release/google-services.json
  /Users/allanwang/PA/MyMartlet/app/src/release/nullnull/google-services.json
  /Users/allanwang/PA/MyMartlet/app/src/nullnull/google-services.json
  /Users/allanwang/PA/MyMartlet/app/src/release/google-services.json
  /Users/allanwang/PA/MyMartlet/app/src/nullnullRelease/google-services.json
  /Users/allanwang/PA/MyMartlet/app/google-services.json

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
@jguerinet
Copy link
Owner

jguerinet commented Jan 12, 2019

Yeah, that is a route we can go down. I've been trying to research how to properly do this, with not much success. Splitting it up into app modules might be best.
I was intending on this doing in any case because I have plans on using Kotlin multi-platform to potentially bring MyMartlet to iOS...

@AllanWang
Copy link
Collaborator Author

Alright. I'll do that first on behalf of #94 . Note that you'll have a long way to go with multi-platform, as jsoup isn't multiplatform to begin with.

@jguerinet
Copy link
Owner

Yeah, MP is more of a pipe dream than anything else at this point. More of an idea that i'm keeping in mind while I work on this.

@jguerinet
Copy link
Owner

I've been looking into this a bit more, and it would seem that committing google-services.json is not recommended as it gives the users access to your API keys, which they can then use in there projects (and will then count towards your quota).
In the Firebase tutorial provided by Google, they ignore it and instead give instructions on how to generate and set it up. See here.

My recommendation:

  • We ignore it (you'll notice that it's actually within the project, but Travis encoded so that Travis can use it. This is part of Moved from Google Analytics to Firebase Analytics #108)
  • We add instructions on how to generate it in the README.
  • We can even add a blank google-services-sample.json, and have some sort of init script that you run when first cloning the project, which simple copies and renames it. That way the app compiles immediately, even if none of the Google-served data would work (categories, places, the map, registration terms).

Thoughts?

@AllanWang
Copy link
Collaborator Author

I'm a fan of the third choice. I know there are instructions online but I don't like having to go through all that to get an app to build. I like making things one click build and one click test if possible. If you want you can even add a gradle script to auto copy it over if it doesn't exist.

@jguerinet
Copy link
Owner

I was actually thinking of doing all of these things together, as opposed to them being 3 different approaches. But sounds good, that's what we'll do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants