I know the config file is scary at first, but you can't go too far wrong as long as it stays as valid PHP code. The only danger is that you'll have a few extra pieces that you don't need. The only things you really need to change at the top are your name and the package name.
About 90% of it can be deleted and it will still work. Except for the name of the package, the author, and the paths (which you don't have to touch), pretty much everything else is optional.
If you have no elements, for example, the whole elements section can be replaced with this:
(Actually, I think you can just delete it, but I'm not positive.)
I've been meaning to add some config file templates for simpler packages but just haven't had the time. The current Example config contains an example of everything that you can possibly do so whatever you need will already be there.
Someday, there will be a CMP Wizard to create the config file for you.
Here's something to get you started:
Create a new project called MoveResources.
Paste the following code into core/components/mycomponent/_build/config/moveresources.config.php file (replacing everything that's there):
<?php
$packageNameLower = 'moveresources'; /* No spaces, no dashes */
$components = array(
/* These are used to define the package and set values for placeholders */
'packageName' => 'MoveResources', /* No spaces, no dashes */
'packageNameLower' => $packageNameLower,
'packageDescription' => 'Move Resources from one site to another',
'version' => '1.0.0',
'release' => 'beta1',
'author' => 'Your Name',
'email' => '<your@email>',
'authorUrl' => 'your site',
'authorSiteName' => "your sitename",
'packageDocumentationUrl' => '',
'copyright' => '2013',
/* no need to edit this except to change format */
'createdon' => strftime('%m-%d-%Y'),
//'gitHubUsername' => 'BobRay',
// 'gitHubRepository' => 'MoveResources',
/* two-letter code of your primary language */
'primaryLanguage' => 'en',
/* Set directory and file permissions for project directories */
'dirPermission' => 0755, /* No quotes!! */
'filePermission' => 0644, /* No quotes!! */
/* Define source and target directories */
/* path to MyComponent source files */
'mycomponentRoot' => $this->modx->getOption('mc.root', null,
MODX_CORE_PATH . 'components/mycomponent/'),
/* path to new project root */
'targetRoot' => MODX_ASSETS_PATH . 'mycomponents/' . $packageNameLower . '/',
/* ************************* RESOURCES ****************************
Important: This list only affects Bootstrap. There is another
list of resources below that controls ExportObjects.
* ************************************************************** */
/* Array of Resource pagetitles for your Extra; All other fields optional.
You can set any resource field here */
/* If the resources already exist, you don't need this section */
'resources' => array(
/*'Resource1' => array(
'pagetitle' => 'Resource1',
'alias' => 'resource1',
'context_key' => 'web',
),
'Resource2' => array(
'pagetitle' => 'Resource2',
'alias' => 'resource2',
'context_key' => 'web',
'parent' => 'Resource1',
'template' => 'Template2',
'richtext' => false,
'published' => true,
'tvValues' => array(
'Tv1' => 'SomeValue',
'Tv2' => 'SomeOtherValue',
),
),*/
),
'hasAssets' => false,
'assetsDirs' => array(
/* 'css' => true, */
),
/* ********************************************* */
/* Define basic directories and files to be created in project*/
'docs' => array(
'readme.txt',
'license.txt',
'changelog.txt',
'tutorial.html'
),
/* (optional) Description file for GitHub project home page */
'readme.md' => false,
/* assume every package has a core directory */
'hasCore' => false,
'createCmpFiles' => false,
/* *******************************************
* These settings control exportObjects.php *
******************************************* */
/* ExportObjects will update existing files. If you set dryRun
to '1', ExportObjects will report what it would have done
without changing anything. Note: On some platforms,
dryRun is *very* slow */
'dryRun' => '0',
/* Array of elements to export. All elements set below will be handled.
*
* To export resources, be sure to list pagetitles and/or IDs of parents
* of desired resources
*/
'process' => array(
'resources',
),
/* Array of resources to process. You can specify specific resources
or parent (container) resources, or both.
They can be specified by pagetitle or ID, but you must use the same method
for all settings and specify it here. Important: use IDs if you have
duplicate pagetitles */
'getResourcesById' => false,
'exportResources' => array(
'Resource1',
'Resource2',
/* Add more here */
),
/* Array of resource parent IDs to get children of. */
'parents' => array(),
/* Also export the listed parent resources
(set to false to include just the children) */
'includeParents' => false,
);
return $components;
List your resources in the 'exportResources' array just above.
Run Bootstrap
Run ExportObject
Run Build
Your package will be in core/packages -- be sure the transfer the one that ends in transport.zip.
One drawback: no TV values will be transferred. I don't think there's a way to do that at this point.