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

Android: Updated the example to build with gradle #1393

Merged
merged 3 commits into from Apr 14, 2018

Conversation

MarioLiebisch
Copy link
Member

This PR is mostly for visibility and you should consider it a work in progress.
It basically addresses #1311 and supercedes/includes #1315.

This updates the Android example to use Gradle rather than Ant for building.

To configure the example, simply run gradle. To build it, run gradle build, and to install it, run gradle installDebug or gradle installRelease.

Here are some known and so far not fixed issues (at least on my Nexus 5), but I don't think they're actually demo project related:

  • Loading canary.wav fails for me.
  • Once you switch to another app, the EGL context is no longer valid/restored.
  • There's something broken with loading the shared STL libraries.

Feedback and bugfixes are appreciated, I'm really short on time right now. :(

@eXpl0it3r
Copy link
Member

I assume this isn't SFML 2.5 ready, right? Will you find time anytime soon, to get it ready?

@MarioLiebisch MarioLiebisch added this to the 2.5 milestone Mar 28, 2018
@MarioLiebisch
Copy link
Member Author

As far as I know the issues I've mentioned aren't related to the demo itself. It just needs testing/feedback. Considering the current demo in the master branch is broken/unusable with up to date tools anyway, including this should be as good (or better) than keeping the current state.

@eXpl0it3r eXpl0it3r added this to Discussion in SFML 2.5.0 via automation Mar 28, 2018
@eXpl0it3r eXpl0it3r moved this from Discussion to Review & Testing in SFML 2.5.0 Mar 28, 2018
@eXpl0it3r
Copy link
Member

@MarioLiebisch The CI build failed. Anything that needs to be update on the CI or with this branch?

@MarioLiebisch
Copy link
Member Author

MarioLiebisch commented Apr 7, 2018

The whole build process for the example is outdated (starting at step 20). You'll need Gradle installed, then only run gradle debug or gradle release in the example directory (calling gradle without parameters will run the configure step only).

You might need a local local.properties file in the example directory defining the SDK/NDK paths:

sdk.dir=X:/Android
ndk.dir=X:/Android/ndk

@eXpl0it3r eXpl0it3r moved this from Review & Testing to Requires Adjustments in SFML 2.5.0 Apr 7, 2018
@binary1248
Copy link
Member

Is there a tutorial or step by step guide for this somewhere? 😛

@MarioLiebisch
Copy link
Member Author

MarioLiebisch commented Apr 7, 2018

It's really just that. Get Gradle, standalone or by using npm, and invoke it for everything:

cd path/to/example
npm install -g gradle
gradle build

@binary1248
Copy link
Member

There... after 2 hours of trial and error it actually builds. Better merge this quick since all other branches will fail to build on Android now. 😁

@texus
Copy link
Contributor

texus commented Apr 8, 2018

If I run gradle release then it gives the error Task 'release' not found in root project 'android' (same for debug). Using gradle build and gradle installDebug did work.

In order to build for x86 I also had to edit app/build.gradle as it has the armeabi-v7a hardcoded.

Gradle also doens't seem to run in my gnome-terminal, I had to run it using xterm or add TERM=dumb before the command. Otherwise it would complain about not being able to get the termcap entry.

I haven't gotten the apk to actually run without crashing, but I'll just wait with that until SFML 2.6, hopefully things will be more stable by then.

@MarioLiebisch
Copy link
Member Author

MarioLiebisch commented Apr 8, 2018

ah, sorry, yeah, the correct/valid targets are build (or assemble), assembleDebug, and assembleRelease (plus install variants.).

@binary1248
Copy link
Member

Are you really sure? 😁 I tried those and they didn't work. I ended up having to run gradle assembleDebug and gradle assembleRelease instead.

@MarioLiebisch
Copy link
Member Author

Hm yeah, haven't touched it for too long it seems. For some reason there's a target build, but not buildRelease or buildDebug. There's assemble for all three though.

@eXpl0it3r eXpl0it3r moved this from Requires Adjustments to Ready in SFML 2.5.0 Apr 8, 2018
@eXpl0it3r eXpl0it3r force-pushed the feature/android-build-updates branch from 64578a3 to f4c25ac Compare April 14, 2018 08:02
@eXpl0it3r eXpl0it3r merged commit f4c25ac into master Apr 14, 2018
SFML 2.5.0 automation moved this from Ready to Merged / Superseded Apr 14, 2018
@eXpl0it3r eXpl0it3r deleted the feature/android-build-updates branch April 14, 2018 08:12
@eXpl0it3r
Copy link
Member

@MarioLiebisch Can you check why this fails? https://ci.sfml-dev.org/#/builders/12/builds/143

@MarioLiebisch
Copy link
Member Author

Patching fails due to missing file or file permission. No idea, but that's not really related to the changes from what I can see.

@binary1248
Copy link
Member

It was still based on a revision before this PR was merged. Can be safely ignored.

@MarioLiebisch
Copy link
Member Author

If that's not the issue, what's the output of gradle tasks?

@binary1248
Copy link
Member

Whatever it is supposed to be. 😁

All the other branches based off a revision after this PR build correctly, so no need to invest more effort here.

@MarioLiebisch
Copy link
Member Author

Ah okay, so it was really just that patching issue then. Fine with me. :D

@eXpl0it3r
Copy link
Member

Ah sorry didn't think it through properly 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
SFML 2.5.0
  
Merged / Superseded
Development

Successfully merging this pull request may close these issues.

None yet

5 participants