How to include external files in a module before packaging it

    • 36 posts
    August 15, 2018 5:36 AM EDT

    I have created a SocialEngine module named MyAwesomeModule that adds a signup step to the default SocialEngine signup process. It is in application/modules/Myawesomemodule. Besides the files in this directory, it also depends on other files e.g. several created specifically for this module and placed in application/modules/User. The problem that I have is that when I build a package for this module in, it only includes the files residing within the module directory itself. Other files that are required for this module to work and need to be copied to external directories (application/modules/User) are not included in the package. However, I have seen some module packages when built from the admin panel contain several folders under "application/modules".   

    I tried adding the list of external files inside package info file i.e.application/packages/module-myawesomemodule-4.0.0.json  and temporary/package/packages/module-myawesomemodule-4.0.0/package.json before building the package as follows: 


    "application\/modules\/User": { "type": "directory", "path": "application\/modules\/User", "structure": [ { "path": "Plugin\/Signup\/Phone.php", "dir": false, "file": true, "perms": "0644", "size": 0, "sha1": null }, { "path": "Form\/Signup\/Phone.php", "dir": false, "file": true, "perms": "0644", "size": 0, "sha1": null }, { "path": "controllers\/PhoneController.php", "dir": false, "file": true, "perms": "0644", "size": 0, "sha1": null } ] }

    But, this had no effect. The jar package file I get from the panel contains only the Myawesomemodule folder under application/modules. What can I do?

    This post was edited by socialenginestaff at August 15, 2018 8:27 AM EDT
    • Moderator
    • 6923 posts
    August 15, 2018 8:32 AM EDT

    normally, we delete posts that don't conform to our posted rules. I have edited yours to add the coding tags. Please in the future always post code with the required tags as shown in the community posting rules. 

    You need to add the required files in your manifest file. Such as this:

    'files' => array( 'application/languages/en/hello-world.csv', ),


    which is from the tutorial for making a plugin found in the Technical Overview tutorial. It has the Hello World example.

    • 36 posts
    August 16, 2018 2:51 AM EDT

    Thank you Donna

    Sorry, I didn't notice the Insert code icon. I'll do that from now on.

    • Moderator
    • 6923 posts
    August 16, 2018 4:34 AM EDT

    You're welcome