The next version of MyComponent will add System Settings to a package for you. In fact, it will do everything but cook you breakfast.
PackMan is a great tool, but it is not meant to handle complex packages and if you intend to work on new releases for an extra down the road, you will definitely want a real build script.
I'm refactoring MyComponent pretty much from the ground up and it's not even really an alpha version (the directories will be reorganized). It's also pretty severe about how a project must be organized.
That said, you can actually use it to create a build script that creates and sets new System Settings and handles pretty much everything but users and security stuff.
You can clone or download from here:
https://github.com/BobRay/MyComponent/tree/refactor.
There's no tutorial yet, but here (I think) is what you need to know (off the top of my head, so probably not completely correct):
(Replace myproject with the name of your extra.)
1. Create a directory in your MODX assets folder called mycomponents (note the 's').
2. Get the package from GitHub -- you should then have /assets/mycomponents/mycomponent/ with _build under that. (Be sure you're on the 'refactor' branch at GitHub.)
3. In the _build/utilities/config directory, duplicate the example.config.php file, call it myproject.config.php
4. In the _build directory, edit the build.config.php file. Change line 10 to
$configFileName = 'myproject.config.php
5. Load up myproject.config.php file from step three. This is your project config file and the only thing you need to mess in MyComponent from here on). Edit the crap out of it. It basically specifies everything you want in the package. The comments in the file should tell you what goes where. I'd avoid having any static elements with this version.
At this point, you're ready to rock and roll.
6. Load the file bootstrap.php in the _build directory. Run it. It should be completely non-destructive. In theory, it won't touch existing files or MODX objects. When you're done, you'll have a hefty project directory: assets/mycomponents/myproject containing a universal build file and most of the files you'll need. the Bootstrap script will also create dummy versions of all the objects if they don't exist already.
7. Go into MODX and check everything out. Create properties for any objects that need them, set the fields of System Settings (important: set the namespace to the lowercase category of your project). Get everything working if it isn't already.
8. Double-check the 'process' element near the end of the project config file to make sure it lists all your objects.
9. In the MyComponent/_build directory, find the exportobjects.php file. Run it.
10. Have a beer.
11. Cross your fingers and run the build.transport.php file in the mycomponent/_build directory. If everything worked, you'll get no error messages and will see a package in the core/packages directory myproject-xx-xx.build.transport.zip that can be installed on any MODX site.
If it's a package for release, you'll want to edit the files in the docs directory. Planned utilities will let you check the the completeness of your properties files and create a properties table for your documentation). You'll also want to create language strings for the project (the lexiconhelper utility isn't finished yet -- it will help a lot with that).
Let me know if you run into trouble.
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html
[ed. note: BobRay last edited this post 14 years, 1 month ago.]