Microsoft .NET Framework 2.0
General Usage & Command Line Arguments
USAGE: SmoothCopy PathOfConfigFile [-s|--source-root=path]
[-r|--destination-root=path]
[-n|--inject=string]
[-d|--distribution=type1[, typei]]
[-o|--omit-inject-at-destination]
[-i|--ignore-hidden]
[-?|-h|--help]
EXAMPLE: SmoothCopy "c:\config.xml" --source-root="c:\dev\build_dir" --destination-root="c:\dev\test_dir" --inject=DEBUG --distribution=doc,client,installer -o -i
REQUIRED PARAMETERS
PathOfConfigFile Provides a path to an XML configuration file with information about the files to be copied.
OPTIONAL PARAMETERS
source-root The default source root path for all files. If omitted, config file must use absolute paths.
destination-root The default target root path for all files. If omitted, config file must use absolute paths.
inject An arbitary text string that replaces <inject> tags in the configuration file.
distribution A comma delimited list of the desired sections to copy. Sections are defined in the config file. If omitted, all sections copied.
-o Omits <inject> at the destination.
-i Omits hidden folders.
-h --help Displays this screen.
COMMENTS
If you omit 'source-root' the paths in your config file should be either relative to the SmoothCopy-Console.exe or they should be absolute. Same deal if you omit 'destination-root'
If you omit 'inject', you better not have <inject> tags in your config file.
If you omit 'distribution', you will get everything
If you have directories in your config file, that is fine, but they MUST end with a trailing slash.
Example Usage
When I create SmoothCopy on my own computer, I have the following:
C:\
DEV\
SmoothCopy\
Docs\
UsersGuide.html
SmoothCopy-Core\
bin\
debug\
SmoothCopy-Core.dll
release\
SmoothCopy-Core.dll
SmoothCopy-Console\
bin\
debug\
SmoothCopy-Console.exe
release\
SmoothCopy-Console.exe
Heyes.GetOpt
bin\
debug\
Heyes.GetOpt.dll
release\
Heyes.GetOpt.dll
With this file structure, I have a need to perform several actions:
- Copy "debug" builds (without documentation) to my local testing directory (c:\program files\black knight technology\smoothcopy)
- Copy "release" builds to my desktop in preparation of uploading to SourceForge.
- Copy "release" builds to my office's file server for archival purposes.
If I were to rely on batch files, I would need one for each task. That would mean I would have 3 batch files to maintain in the event of a file rename or other change to the project. As the task grows in size and complexity, managing these batch files becomes prohibitive. This is a case that SmoothCopy can help with. One SmoothCopy configuration file can replace many batch files.
To accomplish all three tasks above, I would make the following SmoothCopy configuration file (aka grabpack):
GetCurrentBuildSC.xml
<grabpack>
<client>
<component>
<source>c:\dev\SmoothCopy\SmoothCopy-Console\bin\<inject/>\SmoothCopy-Console.exe</source>
<destination>SmoothCopy\SmoothCopy-Console.exe</destination>
</component>
</client>
<libs>
<component>
<source>c:\dev\SmoothCopy\SmoothCopy-Core\bin\<inject/>\SmoothCopy-Core.dll</source>
<destination>SmoothCopy\SmoothCopy-Core.dll</destination>
</component>
<component>
<source>c:\dev\SmoothCopy\Heyes.GetOpt\bin\<inject/>\Heyes.GetOpt.dll</source>
<destination>SmoothCopy\Heyes.GetOpt.dll</destination>
</component>
</libs>
<doc>
<component>
<source>c:\dev\SmoothCopy\Docs\UsersGuide.html</source>
<destination>SmoothCopy\UsersGuide.html</destination>
</component>
</doc>
</grabpack>
With this one grabpack, I now have the means to easily perform all 3 of the tasks outlined above:
Task | SmoothCopy Command Line Arguments |
Copy "debug" builds (without documentation) to my local testing directory (c:\program files\black knight technology\smoothcopy)
| SmoothCopy-Console.exe GetCurrentBuildSC.xml --destination-root="c:\program files\black knight technology" --distribution=libs,client --inject=debug |
Copy "release" builds to my desktop in preparation of uploading to SourceForge. |
SmoothCopy-Console.exe GetCurrentBuildSC.xml --destination-root="C:\Documents and Settings\Me\Desktop" --inject=release |
Copy "release" builds to my office's file server for archival purposes. |
SmoothCopy-Console.exe GetCurrentBuildSC.xml --destination-root="Z:\Archive\SmoothCopy" --inject=release |
The <component> parent tags (<libs>, <doc>, <client> in this example) are user specified.
They can be any arbitrary text label. They allow you to break your grabpack into logical subtasks for situations where you need to copy a subset of files (in conjuction is the --distribution parameter). If you do not include these parent tags, everything will still work, but you will lose the fine grain control of being able to copy subsets of files.
Please consult the example configuration files provided with the tool for more samples on configuring and using SmoothCopy.
Getting Help and Reporting Bugs
Please use the provided Sourceforge resources
Copyright and Licensing
Copyright (c) 2006, Black Knight Technology Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the Owner (Black Knight Technology Inc.) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.