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

put bin/ in builddir if specified in buildozer.spec #274

Merged
merged 3 commits into from
May 8, 2016
Merged

put bin/ in builddir if specified in buildozer.spec #274

merged 3 commits into from
May 8, 2016

Conversation

jabbalaci
Copy link
Contributor

I prefer to keep generated (thus reproducable) things outside of my project folder. Thus, I added this to my buildozer.spec file (example):

[buildozer]
builddir = /home/jabba/.kivy_builddirs/kivy_project

Now, if I launch buildozer android debug deploy run, the local folder .buildozer is created in this specified builddir instead of the project's folder. However, bin/ is still created in the project's folder, littering it with a big .apk file.

My patch does the following: if builddir is specified (as seen above), then bin/ (similarly to .buildozer/) will be created in the builddir. This way the project folder has the source files and things necessary for the build process are nicely separated.

Rationale: I keep my projects in my Dropbox folder and I like to keep their sizes to the minimum. Build stuff should go somewhere else.

@tito
Copy link
Member

tito commented Jan 24, 2016

Hi, thanks for your patch!
However, i think that must be a separated option, such as bin_dir or something like that. It's not build, and deleting your builddir would also delete all the generate version of your application.

I think bin_dir option would be better either for provisioning another directory from the generated apk.

Would you mind to reflect thoses changes on your PR? That would be cool :D

@jabbalaci
Copy link
Contributor Author

OK, I can do that. But what should it be called? builddir has no underscore. Should it be bindir or bin_dir? It'd work this way:

[buildozer]
bin_dir = /home/jabba/.kivy_builddirs/kivy_project

Then /home/jabba/.kivy_builddirs/kivy_project/bin would be created and the .apk files will go there. Is it OK like that?

@tito
Copy link
Member

tito commented Jan 24, 2016

bin_dir with underscore. builddir without underscore is a mistake. And no, you don't append bin/ to the bid_dir, that's the point of it :)

@jabbalaci
Copy link
Contributor Author

The pull request is updated. Here is how to use it in the spec file (example):

[buildozer]
builddir = /home/jabba/.kivy_builddirs/kivy_project
bin_dir = /home/jabba/.kivy_builddirs/kivy_project

Now the bin/ dir. is created in this folder. If it's not specified, then it's created in the project folder.

@tito
Copy link
Member

tito commented Jan 25, 2016

I guess we misunderstood, you don't append bin/ to the bin_dir. The end result must be:

[buildozer]
builddir = /home/jabba/.kivy_builddirs/kivy_project
bin_dir = /home/jabba/.kivy_builddirs/kivy_project/bin

You can even imagine something like:

bin_dir = /home/jabba/releases/my_projects/

The bin/ suffix is the default of bin_dir, or if bin_dir is specificed, use it as it is

@jabbalaci
Copy link
Contributor Author

OK, corrected. I misunderstood when you wrote "you don't append bin/ to the bin_dir", I thought you meant the spec file.

However, this behaviour is not consistent. In the case of builddir, something is appended automagically. In the case of bin_dir, nothing is appended. It can be confusing for the users.

@jabbalaci
Copy link
Contributor Author

Should I do something more?

@SandervanNoort
Copy link

Maybe correct the mistake of the name "builddir", by creating a new config option "build_dir", which will not contain the subfolder ".builddir". That way the config "builddir" could be kept for backwards compatibility.

Related, when specifying a builddir, there is currently an error if there is no directory "bin/" in the main kivy source dir.

File "/usr/lib/python2.7/dist-packages/buildozer/targets/android.py", line 749, in build_package
copyfile(join(dist_dir, 'bin', apk), join(self.buildozer.bin_dir, apk))
File "/usr/lib/python2.7/shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 2] No such file or directory

@kived
Copy link
Contributor

kived commented May 7, 2016

This looks good to me, if nobody (@tito? :P) has any objections I'll merge this tomorrow for our release.

@kived kived merged commit fcc0c60 into kivy:master May 8, 2016
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

Successfully merging this pull request may close these issues.

4 participants