Forum index VCMI Project - Heroes 3: WoG recreated
Forum of the project aiming to recreate best turn-based strategy ever!

FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  StatisticsStatistics
RegisterRegister  Log inLog in  AlbumAlbum  DownloadDownload

Previous topic :: Next topic
Moved by: Warmonger
2014-02-23, 18:28
VCMI for Android
Author Message
SXX 
VCMI programmer

Age: 25
Joined: 04 Jul 2014
Posts: 374
Posted: 2017-06-14, 14:33   

I tried to setup deploy for Android build, but for some weird reason It's not appear in my Travis account. Might be something wrong with my permissions, but I'm not sure. Also there few question related to Travis build and Android.

First of all what the deal with all those dependencies in repository? Is there way to download them from somewhere? If no and you pre-built them from scratch we could instead put them on our server and setup caching on Travis. Tell me and I'll give you SFTP account to upload them.

Another thing is APK naming. Travis allow to make builds by "cron" so my plan now is to use this feature so new Android builds from develop are created daily or at least when there are changes in develop. Though we also want to have builds when you change actual APK structure so I suggest that would be cool if you generate package name similar to what I did in develop and then store it in some environment variable, e.g like:
Code:
VCMI-{LAUNCHER_COMMIT}-develop-{DEVELOP_COMMIT}.apk

So there will be a way to add simple SFTP upload afterwards.
 
     
SXX 
VCMI programmer

Age: 25
Joined: 04 Jul 2014
Posts: 374
Posted: 2017-06-14, 14:38   

And one more question: xyz originally didn't implement Qt launcher into package. Is there some reasons you didn't try to adopt it too?

Since it's you one maintain the code it's perfectly fine, but I still wonder what technical difficulties is there to use Qt application for that. I suppose launcher UI completely incompatible with phones, but that's not problem and can be rewritten. Mainly interested in this because I want to change mod distribution model and I wish we had one solution for all platforms.
 
     
Fay 
User defined rank


Joined: 07 Apr 2014
Posts: 53
Posted: 2017-06-14, 19:23   

Quote:
First of all what the deal with all those dependencies in repository? Is there way to download them from somewhere? If no and you pre-built them from scratch we could instead put them on our server and setup caching on Travis. Tell me and I'll give you SFTP account to upload them.
What dependencies?
* FFMPEG/iconv are added as submodules, (additionally, binaries added to repo in ext-output folder)
* SDL2 is a submodule pointing to my fork of SDL (that has changes that allow resolving touches as left/right click correctly; also available as a binary in main project repo),
* SDL2 addons need to be added manually (because SDL uses hg instead of git if I remember correctly) -- also precompiled in the repo
* boost needs to be added manually (I guess we could add it as a submodule from https://github.com/urho3d/android-ndk.git -- currently I use this repo in travis build)
Can't think of any other dependencies.

Quote:
VCMI-{LAUNCHER_COMMIT}-develop-{DEVELOP_COMMIT}.apk
Should be possible. Not sure if it can be automated from inside the gradle build but I definitely can make a script that passes hashes from git to gradle build script (hash is already included in app (saved in generated java file during cmake)).

Quote:
xyz originally didn't implement Qt launcher into package. Is there some reasons you didn't try to adopt it too?
To be honest, I didn't check if it's possible and went for "normal simple android app" route. It seems that qt does support android ( http://doc.qt.io/qt-5/android-support.html ).
I'm not sure if it's possible to easily do qt+java app (android SDL port uses java).
 
     
SXX 
VCMI programmer

Age: 25
Joined: 04 Jul 2014
Posts: 374
Posted: 2017-06-14, 20:29   

Fay wrote:
additionally, binaries added to repo in ext-output folder

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. ;-)

Fay wrote:
Should be possible. Not sure if it can be automated from inside the gradle build but I definitely can make a script that passes hashes from git to gradle build script (hash is already included in app (saved in generated java file during cmake)).
If you can implement it to generate package with name like that it's would be great:
Code:
${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.

Fay wrote:
To be honest, I didn't check if it's possible and went for "normal simple android app" route. It seems that qt does support android ( http://doc.qt.io/qt-5/android-support.html ).
I'm not sure if it's possible to easily do qt+java app (android SDL port uses java).
Thanks. It's what I wanted to know.
 
     
Fay 
User defined rank


Joined: 07 Apr 2014
Posts: 53
Posted: 2017-06-14, 20:45   

Quote:
So would be better if Travis would just download them from our server (if there no other way to get them) during build process.
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).

Quote:
If you can implement it to generate package with name like that it's would be great
I should be able to do it tomorrow.
 
     
SXX 
VCMI programmer

Age: 25
Joined: 04 Jul 2014
Posts: 374
Posted: 2017-06-14, 21:09   

Fay wrote:
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).

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. ;-)
 
     
Fay 
User defined rank


Joined: 07 Apr 2014
Posts: 53
Posted: 2017-06-15, 15:21   

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).
 
     
SXX 
VCMI programmer

Age: 25
Joined: 04 Jul 2014
Posts: 374
Posted: 2017-06-15, 15:52   

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.
 
     
Fay 
User defined rank


Joined: 07 Apr 2014
Posts: 53
Posted: 2017-06-15, 16:33   

Quote:
Is there any reason you want to stick to certain VCMI commit? Can't you just build latest develop?
Do I? No idea. :P
.gitmodules just specifies develop branch, not specific commit.
 
     
SXX 
VCMI programmer

Age: 25
Joined: 04 Jul 2014
Posts: 374
Posted: 2017-06-15, 17:03   

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

Age: 25
Joined: 04 Jul 2014
Posts: 374
Posted: 2017-06-16, 00:04   

Ok I uploaded test branch there, but I still want to get rid of those "committed with" messages. :evil:

PS: It's looks like build works fine. :-)
Code:
/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:
Code:
git rebase -i f92eec4c6af20783b08b4ba1c01f690a80bd01f0

Then set "edit" to first commit and once it's started:
Code:
git rm ext-output/* -r
git rebase --continue

And repeat many many times. :mrgreen:
 
     
AVS 

Joined: 25 Feb 2011
Posts: 554
Location: Russia
Posted: 2017-06-16, 00:40   

SXX, looks like you failed rebase process
 
     
SXX 
VCMI programmer

Age: 25
Joined: 04 Jul 2014
Posts: 374
Posted: 2017-06-16, 02:43   

AVS wrote:
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... :-(
 
     
SXX 
VCMI programmer

Age: 25
Joined: 04 Jul 2014
Posts: 374
Posted: 2017-06-16, 13:11   

So I removed binaries from repository history:
Code:

$ 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:
 
     
SXX 
VCMI programmer

Age: 25
Joined: 04 Jul 2014
Posts: 374
Posted: 2017-06-16, 14:36   

Ok I made backup and force pushed it. Hopefully I won't break something for you. :-)
 
     
Display posts from previous:   
Reply to topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Add this topic to your bookmarks
Printable version

Jump to:  

Powered by phpBB modified by Przemo © 2003 phpBB Group

Hosting provided by DigitalOcean
Page generated in 0.06 second. SQL queries: 13