How to link assets/www folder in Eclipse / Phonegap / Android project?

前端 未结 3 1199
广开言路
广开言路 2020-12-01 07:56

I am working on a PhoneGap app that is supposed to run on iOS and Android. My folder structure looks like this:

+-+-[app folder]
  |
  +-[android] (contains Ecl         


        
相关标签:
3条回答
  • 2020-12-01 08:39

    Don't know how does it work in MacOS but I guess you can create a symbolic link with ln, putting your www folder inside Eclipse's assets. I do it both in Windows and Linux and work ok.

    0 讨论(0)
  • 2020-12-01 08:40

    For windows use this command mklink /D link-name target-folder and for linux/mac use ln to create a source link. Both works for me.

    0 讨论(0)
  • 2020-12-01 08:46

    This can be accomplished creating a "Linked Folder" resource in Eclipse. It's essentially the same thing as what Xcode creates when you drag any file or folder into your project and tell it to create references - just nowhere near as easy.

    The ADT Eclipse plugin expects an "assets" folder at the top level of your project, so we're going to create an /assets linked folder that references ../www, sitting right next to your project folder.

    1. File menu > New > Folder
    2. Folder name: assets
    3. Click Advanced >>
    4. Select: Link to alternate location (Linked Folder)
      • You can use Browse to select the www folder and you're done, but this option creates the link using a full path which will usually break on other team members' systems
    5. Click Variables...
    6. New
      1. Name: SIBLING_WWW_FOLDER
      2. Location: ${PROJECT_LOC}/../www
    7. OK
    8. Select SIBLING_WWW_FOLDER and click OK
    9. Finish
    0 讨论(0)
提交回复
热议问题