VCMI for Android

Itā€™s exactly what Iā€™m talking about. Is there reason you canā€™t just download them within build process?
GitHub have 1GB soft limit and your repo already 168MB and itā€™s just bad practice to store binaries in git.

So would be better if Travis would just download them from our server (if there no other way to get them) during build process. Then we can rewrite repository history with rebase so itā€™s wonā€™t be 160MB. :wink:

If you can implement it to generate package with name like that itā€™s would be great:

${TRAVIS_JOB_ID}-vcmi-${LAUNCHER_COMMIT}-develop-${DEVELOP_COMMIT}.apk

Once I find out why I canā€™t access encryption key on Travis for vcmi-android Iā€™ll setup artifact uploading.

Thanks. Itā€™s what I wanted to know.

Yeah, SDL addons would need to be either hosted somewhere and downloaded during build or mirrored on github and added as submodules.
Other than that, ā€œ./build.py fixpaths build-optionalā€ should build all of the non-cmake libs.

I added them to repo because it makes building the project much simpler/quicker and these libs donā€™t really need to be ever rebuilt unless we upgrade lib versions.

Keep in mind that ffmpeg takes quite a long time to build (around 20 mins per arch on my pc) + it needs to be checked if travis machines can handle asm out of the box (yasm).

I should be able to do it tomorrow.

Yep I understand why you added them to the when you tried to get it work. This is just something that need to be changed and if there are no ā€œready to useā€ binaries available in trusted source then we can just host our own, but certainly not on git.

If you can please generate SSH key and send me public part so I can provide you with SFTP access to special server where youā€™ll able to upload all dependencies needed. :wink:

Current repo version of launcher should create output apks with name [travis_job_id]-[launcher_git_sha]-vcmi-[vcmi_branch]-[vcmi_git_sha]-debug].apk. ("-debug" only in debug builds, travis job id only if thereā€™s such env variable, git-shas are first 7 chars).

Thanks. Is there any reason you want to stick to certain VCMI commit? Canā€™t you just build latest develop?

Asking since main reason to have Travis at all is to make sure we do not break building on Android.
Also I want Android builds to be generated and uploaded daily by Travis even when youā€™re away.

Do I? No idea. :stuck_out_tongue:
.gitmodules just specifies develop branch, not specific commit.

Oops, I certainly misunderstand reason for commit hash in GeneratedVersion.java.
Might be you can later just add current commit there.

Ok I uploaded test branch there, but I still want to get rid of those ā€œcommitted withā€ messages. :imp:

PS: Itā€™s looks like build works fine. :slight_smile:

/home/travis/build/vcmi/vcmi-android/project/vcmi-app/build/outputs/apk/243458287-vcmi-7609a0d-HEAD-fa02900-debug.apk

Also you can easily rewrite history on your own:

git rebase -i f92eec4c6af20783b08b4ba1c01f690a80bd01f0

Then set ā€œeditā€ to first commit and once itā€™s started:

git rm ext-output/* -r
git rebase --continue

And repeat many many times. :mrgreen:

SXX, looks like you failed rebase process

No. There was failed build because I made it output find of every file and Travis consider log over 4MB as failure. So other than ā€œcommited byā€ itā€™s looks fine and build passed.

Now I also fixed uploading, but we certainly need Release build instead of Debug.
Sadly itā€™s still show horrible red screen on my deviceā€¦ :frowning:

So I removed binaries from repository history:

$ du -hs ../BACKUP_ANDROID/vcmi-android/
301M    ../BACKUP_ANDROID/vcmi-android

$ du -hs ./vcmi-android
30M     ./vcmi-android

Canā€™t yet push it since master branch is protected. :cry:

Ok I made backup and force pushed it. Hopefully I wonā€™t break something for you. :slight_smile:

GeneratedVersion was just meant to hold current vcmi version + git sha, but it doesnā€™t update correctly (itā€™s generated in cmake script and cmake sometimes uses cache instead of rerunning it ā€“ I guess I could move it to gradle script since I added git sha checking there anyway).

Well, yeah. It always is confusing and usually I break stuff when rebasing. :stuck_out_tongue:

I think I should add some dedicated ā€œreleaseā€ singing keys to repo (either generate new ones or just reuse default androidā€™s debug keys because it doesnā€™t really matter).

Hmm, I guess this is the issue: bugzilla.libsdl.org/show_bug.cgi?id=2291 . I can try adding one of the possible solutions to the repo.

Well, yeah. It always is confusing and usually I break stuff when rebasing. :PItā€™s even more confusing since I had to mess with reflog. Also I still have no idea how to make GitHub purge orphan originals. I suppose itā€™s will remove them from reflog after default 2 week grace period, but weā€™ll see.

If some signing itā€™s the only difference in that case then I donā€™t care personally. I was worried ā€œdebugā€ build going to have worse performance since itā€™s might have some options disabled.

If you can please do. I still wish to attempt test of cross-platform multiplayer.

Debug does have worse performance and we should switch to release.

In debug mode gradle script automatically signs the package using ā€œinternalā€ android debug keystore.
For release build gradle by default doesnā€™t sign the package and requires dev to specify ā€œreleaseā€ keystore (like I did with actual release vcmi keys in github.com/vcmi/vcmi-android/bl ā€¦ radle#L149 (keeping them out of repo of course)). For release mode build on travis we need to specify some signing keys, but these can be any keys, including android ā€œinternalā€ keystore.

Iā€™ll do it later (maaaybe today).

Yep in that case we certainly need release builds and obviously Iā€™ll prefer to not expose signing keys even on our server.

Also I tested multiplayer itā€™s works flawlessly. Though Android client crashed in Linux Host + MXE Windows guest + Android guest game, but I expect this could be result of fact how itā€™s loaded some extra mods or something.

PS: I also enabled daily build for your repository by Travis and added notifications to Slack.
Now we can track if we break building on Android all the time.

I added possible fix for invalid colors here: github.com/Fayth/vcmi/blob/expe ā€¦ T.cpp#L410 ). Iā€™m not sure if you can somehow build it on your side or I should make a PR to develop?

I think I could just cherry-pick it, but would be handy if you can add some argument to Android build scripts that Travis trigger. So in future we can just create new branch in vcmi-android with modified Travis config and itā€™s will make build for us. :wink:

E.g like:

# Now we have
python3.5 ./build.py build-app
# But we can do
python3.5 ./build.py build-app HEAD
python3.5 ./build.py build-app develop
python3.5 ./build.py build-app experimental/sdl-color-fix

OR even better. Expose that argumnent and Iā€™ll implement travis script that let us trigger build by creating new branch in vcmi-andoid like:

buildForMe/feature/ambientSounds

And itā€™s will build ā€œfeature/ambientSoundsā€ branch from upstream.

Also in future we can just make Android builds on every commit / branch / PR just like we do for Linux GCC, Linux Clang, MXE and Mac. Sadly that would take time to implement and I have tons of other tasks on project right now.

Ok. For now itā€™s set to only build ā€œfa02900ā€ commit from develop.
Please make it always build develop HEAD and also get rid of ā€œinternalData.zipā€.