Skip to content

Fix android data paths fixes #2697 #3004

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

danzeeeman
Copy link
Member

Moved the data folder out of $PROJECT_ROOT/bin to $PROJECT_ROOT. Fixes #2697

@bilderbuchi
Copy link
Member

A pity that this breaks the systematic structure we have across all OF applications. Is there really no better way, maybe with a new Eclipse version?
In any case, you'll also have to special-case the android examples in this gitignore section, and I guess the project generator will also need to be updated (to generate new projects correctly).

pinging @openframeworks/android

@arturoc
Copy link
Member

arturoc commented Jun 3, 2014

yes there's no way to solve this while keeping bin/data, the android plugin for eclipse is hardcoded to clean everything in bin and to use bin for generating the binaries.

what we should add is some commands in the makefile's afterrun rule so it moves old bin/data to data, and probably add a ln -s in bin/data so multiarchitecture projects still work

@danzeeeman
Copy link
Member Author

Well I know Zach has been talking about how to change the project structure
to be better.

I did this because I kept blowing away my files with a clean.
On Jun 3, 2014 8:15 AM, "arturo" notifications@github.com wrote:

yes there's no way to solve this while keeping bin/data, the android
plugin for eclipse is hardcoded to clean everything in bin and to use bin
for generating the binaries.

what we should add is some commands in the makefile's afterrun rule so it
moves old bin/data to data, and probably add a ln -s in bin/data so
multiarchitecture projects still work


Reply to this email directly or view it on GitHub
#3004 (comment)
.

@ofZach
Copy link
Contributor

ofZach commented Jun 3, 2014

yeah that's terrible, I wonder if there's a pre or post build step that can
help.

regarding changes to the structure, I'm advocating for folders per platform
for project files so there some separation between src, project files and
bin -- This will help keep multiplatform projects sane. We have alot of
issues with codeblocks on linux and windows, for example, because of how
they are all expected to be in the same place.

  • zach

On Tue, Jun 3, 2014 at 8:56 AM, Dan Moore notifications@github.com wrote:

Well I know Zach has been talking about how to change the project
structure
to be better.

I did this because I kept blowing away my files with a clean.
On Jun 3, 2014 8:15 AM, "arturo" notifications@github.com wrote:

yes there's no way to solve this while keeping bin/data, the android
plugin for eclipse is hardcoded to clean everything in bin and to use
bin
for generating the binaries.

what we should add is some commands in the makefile's afterrun rule so
it
moves old bin/data to data, and probably add a ln -s in bin/data so
multiarchitecture projects still work


Reply to this email directly or view it on GitHub
<
https://github.com/openframeworks/openFrameworks/pull/3004#issuecomment-44956673>

.


Reply to this email directly or view it on GitHub
#3004 (comment)
.

@danzeeeman
Copy link
Member Author

I've also gotten into the habit of moving my data inside the App package on
OSX. It's like my apps put on big boy pants.
On Jun 3, 2014 9:01 AM, "ofZach" notifications@github.com wrote:

yeah that's terrible, I wonder if there's a pre or post build step that
can
help.

regarding changes to the structure, I'm advocating for folders per
platform
for project files so there some separation between src, project files and
bin -- This will help keep multiplatform projects sane. We have alot of
issues with codeblocks on linux and windows, for example, because of how
they are all expected to be in the same place.

  • zach

On Tue, Jun 3, 2014 at 8:56 AM, Dan Moore notifications@github.com
wrote:

Well I know Zach has been talking about how to change the project
structure
to be better.

I did this because I kept blowing away my files with a clean.
On Jun 3, 2014 8:15 AM, "arturo" notifications@github.com wrote:

yes there's no way to solve this while keeping bin/data, the android
plugin for eclipse is hardcoded to clean everything in bin and to use
bin
for generating the binaries.

what we should add is some commands in the makefile's afterrun rule so
it
moves old bin/data to data, and probably add a ln -s in bin/data so
multiarchitecture projects still work


Reply to this email directly or view it on GitHub
<

https://github.com/openframeworks/openFrameworks/pull/3004#issuecomment-44956673>

.


Reply to this email directly or view it on GitHub
<
https://github.com/openframeworks/openFrameworks/pull/3004#issuecomment-44960581>

.


Reply to this email directly or view it on GitHub
#3004 (comment)
.

@danoli3
Copy link
Member

danoli3 commented Jun 3, 2014

Making sure your project is on a git repo can really help too. Discard changes saves lives with the accidental clean with oF/Android at the moment.

@danzeeeman
Copy link
Member Author

@danoli3 that is a inelegant fix for this issue. It works but you have to remember to add your data files to your git as you go.

I'll make the changes @arturoc suggested yesterday. I'm also looking into implementing a way to read items from the resource folder and the assets folder from the cpp. When making an Android app that has equal parts Java and CPP it is a bit clunky that I need to include two copies of an assets: one in the standard location to access via the Android Java api and one in the ZIP for the CPP to use.

I was also working yesterday to integrate the dropbox datastore and sync libraries with an Android OF app so I can sync files between app installs on different devices and push new files to the OF app without having to reinstall the APK or make a HTTP GET from the cpp.

@arturoc arturoc added this to the 0.9.0 milestone Jul 3, 2014
@danzeeeman
Copy link
Member Author

I need to redo this

@arturoc
Copy link
Member

arturoc commented Oct 13, 2014

@danthemellowman do you think you can have this ready for the 0.9 deadline?

@danzeeeman
Copy link
Member Author

yup. I'll get cracking on it. Just wrapped a couple projects so I have some free time.

@danzeeeman danzeeeman self-assigned this Nov 12, 2014
@danoli3
Copy link
Member

danoli3 commented Nov 21, 2014

Problem with the above idea:

  • It breaks multiplatform projects.
  • oF is designed in all platforms to use the bin/data (and that is not changing)

An alternative idea, is to keep @danthemellowman 's idea of the data folder alternative for oF Android, however copy this folder into the bin/data pre-package (similar to what iOS does to the .app package).

This way for Multiplatform projects, say iOS the user could implement the exact same script copying the data/ to bin/data. And possibly keep the device specific targets seperate. However for iOS we can leave this up to the user. For Android, we need this change to prevent the clean nuke.

Since iOS Apps and Android Apps tend to go hand in hand these days, be a good idea to make this easier for oF users (As this is one of the many powers of oF)

Here is the modications required to each Project Makefile

# Attempt to load a config.make file.
# If none is found, project defaults in config.project.make will be used.

ifneq ($(wildcard config.make),)
    include config.make
endif

# make sure the the OF_ROOT location is defined
ifndef OF_ROOT
    OF_ROOT=../../..
endif

$(shell `cp -r "data" "bin/data"`; );

# call the project makefile!
include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk

All this needs is another line checking if bin/ and bin/data exists, if they don't make them first.

Note the only change is $(shell cp -r "data" "bin/data"; );

Possible issues with Makefile change.

  • If you removed something from data, this may be kept in bin/data... however this is a pretty standard issue which would be solved by a clean (something you have to do a lot in Android with cached versions of things).

@danzeeeman
Copy link
Member Author

I need to redo this PR today

@bilderbuchi bilderbuchi modified the milestones: 0.9.1, 0.9.0 May 3, 2015
@HalfdanJ
Copy link
Member

It seems this doesn't make so much sense anymore, since the eclipse plugin anyway is going away soon (hopefully 😉 #4549), and in Android Studio with gradle, this is not an issue.

@noyanc
Copy link
Contributor

noyanc commented Nov 18, 2015

We still use Eclipse extensively in Android development.

@arturoc arturoc modified the milestones: 0.10.0, 0.9.1 Nov 23, 2015
@noyanc
Copy link
Contributor

noyanc commented Dec 1, 2015

Is there any progress on this subject? We stopped upgrading from 0.8.0 to 0.9.0 and waiting a fix for this issue.

@HalfdanJ
Copy link
Member

HalfdanJ commented Dec 3, 2015

@noyanc there is more discussion going on here: #2995

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

Successfully merging this pull request may close these issues.

cleaning project deletes data folder
7 participants