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

init androidenv.buildGradleApp #41855

Merged
merged 8 commits into from Jun 21, 2018
Merged

Conversation

matthewbauer
Copy link
Member

Motivation for this change

This is the last big piece of code that is used by reflex-platform but missing in nixpkgs. It is used to generate apps using the gradle build system.

Need feedback on whether this is useful in Nixpkgs.

/cc @ali-abrar @ryantrinkle @Ericson2314

@matthewbauer matthewbauer changed the title Init androidenv.buildGradleApp init androidenv.buildGradleApp Jun 11, 2018
@matthewbauer
Copy link
Member Author

Some of these commits need to be reworked I think. For instance google-repository.nix should be replaced with a fetchzip call.

export ANDROID_SDK_HOME=`pwd`

mkdir -p "$ANDROID_HOME/licenses"
echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ericson2314 Do you think this is okay to do? I guess the "assert acceptAndroidSdkLicenses" is basically covering this acceptance.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I...suppose so!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this hash?

mv ${buildDirectory}/build/outputs/apk/*.apk $out

mkdir -p $out/nix-support
echo "file binary-dist \"$(echo $out/*.apk)\"" > $out/nix-support/hydra-build-products
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am actually unsure what this is doing? @Ericson2314

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know either. @ElvishJerricco might.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea what this does

This is easier than having to remember which SDKs are supported, etc.
Stuff based on this can become more future-proof.
@matthewbauer matthewbauer merged commit ec2ea29 into NixOS:master Jun 21, 2018
@Ericson2314 Ericson2314 deleted the gradle-app branch June 21, 2018 23:22
@ElvishJerricco
Copy link
Contributor

As someone who helped write this stuff originally, I'm not really in favor of having this in nixpkgs in its current state. I never really considered it release quality. If possible, I'd much rather see this brought in-tree into reflex-platform.

@matthewbauer
Copy link
Member Author

We can definitely look into removing this stuff but i would definitely object to adding even more android infrastructure to reflex-platform than there already is. This stuff is not specific to Reflex or even haskell so it does not seem like the right place to put it. We want more people to be using this outside of Reflex world so it gets more testing, more refactors, etc. It seems to me fairly close to doing what build-app.nix does for ant but with gradle. Maybe it makes sense to move all of this to some sort of a build support overlay or something like it though.

@ElvishJerricco
Copy link
Contributor

ElvishJerricco commented Jun 22, 2018

I suggested reflex-platform only because I think nixpkgs is the wrong place (edit: at least right now), and reflex-platform is the intended consumer. Though this isn't specific to reflex-platform morally speaking, it sure is in terms of implementation; I would not recommend others to use this generally without a big warning about it being unfeatured, buggy, unstable, and wip. It's pretty much only well suited for the very specific thing that reflex-platform does with it, and it's not even particularly good at that.

@ali-abrar
Copy link
Contributor

ali-abrar commented Jun 22, 2018 via email

@dingxiangfei2009
Copy link
Contributor

dingxiangfei2009 commented Sep 29, 2018

This PR does not have any tests to demonstrate the usability of the function "buildGradleApps". Shall we add some tests for it @matthewbauer?

In addition. Note that buildGradleApps needs mavenDeps. Currently from a given gradle project, there is no feasible way, to my knowledge, to export a list of maven dependencies. The feasibility of this solution to build any recent Android apps is questiionable.

@ali-abrar
Copy link
Contributor

ali-abrar commented Sep 29, 2018 via email

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/using-androidenv-error-functionargs-requires-a-function/32773/5

@Artturin
Copy link
Member

Artturin commented Sep 8, 2023

Was accidentally removed in #50596

Readding in #254082

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

Successfully merging this pull request may close these issues.

None yet

8 participants