phonegap / build

This is the public repository for PhoneGap Build source and bug tracking
92 stars 33 forks source link

Build Code from GitHub repository - missing all .js and subdirectories #94

Closed obsidiandesign closed 11 years ago

obsidiandesign commented 11 years ago

I'm in the process of modifying a basic app using the phone-gap start code. However, when I build the app using build.phonegap.com, any additional .js files or subdirectories of /www/ are ignored when build.phonegap.com pulls the repository from github.

GitHub Repository: https://github.com/obsidiandesign/phonegap-start (forked from phonegap-start) build.phonegap.com link: http://build.phonegap.com/apps/320572/builds

Steps to reproduce:

  1. Create new app on build.phonegap.com
  2. Link to the GitHub repository, let build process complete
  3. Download .apk and open with a zip application - all subdirectories and .js are missing in the assets/www folder.

If, however, I create my own .zip file from all of the code and upload it as a private application, the files are properly saved into the .apk's assets/www folder.

Thanks!

mwbrooks commented 11 years ago

I chatted the @obsidiandesign on IRC and was able to recreate the issue.

Projects from a Zip source: work fine.

Projects from a Git source: do not include subdirectories in the www/ directory.

mwbrooks commented 11 years ago

I looked into the issue a little bit more:

wildabeast commented 11 years ago

Looking into it now -- was only able to reproduce with your repository, not the original phonegap-start repo or any others. Seems to be a pre-build problem -- Build isn't even finding / parsing the config.xml before sending off for building.

wildabeast commented 11 years ago

OK problem is that Build is using www/DrupalGap/pages as your root folder.

Currently, if Build doesn't find an index.html file in the root of your repo, it recursively looks for an index.html file in your directory structure, and when found, uses the location of the index.html as the root folder. The order it returns the found instances seems to be arbitrary.

This should be changed to use the index.html file found at the lowest directory depth. Maybe even prioritize www/, i.e. order like this:

In the meantime, you can get around this by either:

a) moving everything in www/ into the root directory, or b) deleting your DrupalGap folder (looks like you might've copied them all to your www/ directory)

mwbrooks commented 11 years ago

Awesome, thanks @wildabeast

I definitely would not have tracked down that cause by myself!

I agree, the way that PG/Build scans for index.html should be changed to prioritize the lowest depth.

obsidiandesign commented 11 years ago

@wildabeast Thanks for the info - it would definitely be helpful to have the behavior of scanning for index.html changed or outlined as a warning in the documentation. This definitely helps!

wildabeast commented 11 years ago

Created a new issue https://github.com/phonegap/build/issues/95