facebook

Sharing Javascript Ressources between PhoneGap Projects

  1. MyEclipse IDE
  2.  > 
  3. Mobile Tooling
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #476290 Reply

    Pascal Curdy
    Participant

    Hi there,
    I’ve several PhoneGap Android Projects using the same Javascript ressources.
    Now, I want to put these ressources in a single Folder (sort of repository).
    When I create a new Project, I import these ressources from the FileSystem into the folder www/js (see screenshot), creating links in Workspace.
    All seems to be good and I have no problem running my App as long as I use the simulator.
    The problem appears when I build (locally) the App.
    None of the imported scripts are copied into the folder assets/www.
    Did I miss some settings ?

    Thanks in advance for your help

    Best Regards

    Attachments:
    You must be logged in to view attached files.
    #476583 Reply

    support-swapna
    Moderator

    Pascal,

    I could replicate the issue at my end. It looks like a known issue with PhoneGap build not recognizing the linked files to copy to the .apk during build.

    Some of the users got it working by creating filesystem links outside of Eclipse. You can check this thread for more suggestions : http://stackoverflow.com/questions/6843181/how-to-link-assets-www-folder-in-eclipse-phonegap-android-project

    Hope this helps. Let us know if you have any questions.

    –Swapna
    MyEclipse Support

    #476746 Reply

    Pascal Curdy
    Participant

    Hi Swapna,
    I find it’s quite a pity to have to set things outside myEclipse (I don’t like this ;-))

    While googling, I just found the following information:

    http://stackoverflow.com/questions/24022094/android-how-to-copy-files-to-asset-folder-during-build

    They talk about modifying Ant build script or even create a prebuild script.

    Where can I find Build (and eventually, pre-build) scripts in a phonegap project filesystem ?

    Thanks in advance for your feedback.

    • This reply was modified 8 years, 7 months ago by Pascal Curdy.
    #477245 Reply

    support-michael
    Keymaster

    Hi Pascal,
    I just saw your post. In an early version of Cordova/PhoneGap you had to manually copy icons & images into your platform area. We did that using scripts known as hooks that were called by the PhoneGap/Cordova build system at different points in the build life-cycle. I’m a little rusty now on extending the various PhoneGap/Cordova CLI actions with hooks such as moving files.

    Here’s the Cordova/PhoneGap guide on hooks: https://cordova.apache.org/docs/en/5.1.1/guide/appdev/hooks/

    See the last example in this article for copying files in a hook script:
    http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Sharing Javascript Ressources between PhoneGap Projects

You must be logged in to post in the forum log in