text: module.exports = function() {
      'use strict';
  
      var copysource = {};
  
      if (this.learn('initConfig.buildinfo.packagefiles')) {
  
          var install_test_files = this.learn('initConfig.buildinfo.install_test_files');
          var fileset = this.learn('initConfig.buildinfo.packagefiles.files') || [];
          if (install_test_files == true) {
              var test_fileset = this.learn('initConfig.buildinfo.packagefiles.files_for_test') || [];
              fileset = fileset.concat(test_fileset);
          }
          var files = [];
  
          for (var i = 0; i < fileset.length; i++) {
              var entry = fileset[i];
              files.push({
                  expand: true,
                  cwd: entry.dir,
                  src: entry.src,
                  dest: entry.dest,
                  nonull: true
              });
          }
  
          copysource['source'] = {
              options: {
                  mode: true,
              },
              files: files
          }
      }
  
      copysource['update_license'] = {
          expand: true,
          cwd: 'contrib/common/misc',
          src: ['license-eula.txt', 'license-eula.rtf'],
          dest: 'stage',
          nonull: true
      };
  
      var main_app = this.learn('initConfig.buildinfo.packagefiles.main_app');
      if (!main_app) {
          main_app = this.learn('initConfig.buildinfo.name');
      }
  
      copysource['update_license_appsuite'] = {
          expand: true,
          cwd: 'contrib/common/misc',
          src: ['license-eula.txt', 'license-eula.rtf'],
          dest: 'stage/' + main_app,
          nonull: true
      };
  
      copysource['commoncomponent_ui'] = {
          options: {
              mode: true,
          },
          files: [{
              expand: true,
              src: ['bower.json'],
              dest: 'build/<%=buildinfo.name%>'
          },{
              expand: true,
              src: ['package.json'],
              dest: 'build/<%=buildinfo.name%>'
          },{
              expand: true,
              src: [main_app + ".js"],
              dest: 'build/<%=buildinfo.name%>'
          }, {
              expand: true,
              src: [main_app + "/**/*"],
              dest: 'build/<%=buildinfo.name%>'
          }, {
              expand: true,
              src: ['resources/**/*'],
              dest: 'build/<%=buildinfo.name%>'
          }]
      };
  
      copysource['commoncomponent_lib'] = {
          options: {
              mode: true,
          },
          files: [{
              expand: true,
              cwd: '<%=buildinfo.name%>',
              src: ['**/*'],
              dest: 'build/<%=buildinfo.name%>'
          }]
      };
  
      copysource['commoncomponent_api'] = {
          options: {
              mode: true,
          },
          files: [
              // includes files within path
              {expand: true, cwd: 'src/python/', src: ['**/*.py'], dest: 'build/<%=buildinfo.name%>/'},
              {expand: true, cwd: 'src/python/', src: ['__init__.py'], dest: 'build/<%=buildinfo.name%>/'},
              {expand: true, cwd: 'src/python/', src: ['**/*.json'], dest: 'build/<%=buildinfo.name%>/'},
              {expand: true, cwd: 'src/resources/', src: ['**/**'], dest: 'build/<%=buildinfo.name%>/resources/'},
              {expand: true, cwd: './', src: ['setup.py'], dest: 'build/'},
              {expand: true, cwd: './', src: ['MANIFEST.in'], dest: 'build/'},
              {expand: true, cwd: './', src: ['README'], dest: 'build/'},
              {expand: true, cwd: './', src: ['requirements.txt'], dest: 'build/'},
              {expand: true, cwd: './', src: ['release_notes.txt'], dest: 'build/'},
  
              {expand: true, cwd: 'tests', src: ['rest_imports_*.py'], dest: 'stage/<%=buildinfo.name%>/bin/'},
              {expand: true, cwd: 'src/python/', src: ['**/*.py'], dest: 'stage/<%=buildinfo.name%>/lib/app_common/<%=buildinfo.name%>/'},
              {expand: true, cwd: 'src/python/', src: ['**/*.json'], dest: 'stage/<%=buildinfo.name%>/lib/app_common/<%=buildinfo.name%>/'},
              {expand: true, cwd: 'src/python/', src: ['__init__.py'], dest: 'stage/<%=buildinfo.name%>/lib/'},
              {expand: true, cwd: 'src/python/', src: ['__init__.py'], dest: 'stage/<%=buildinfo.name%>/lib/app_common/'},
              {expand: true, cwd: 'pypi_modules/', src: ['**'], dest: 'stage/<%=buildinfo.name%>/lib/app_common'},
              {expand: true, cwd: 'tests', src: ['*.conf'], dest: 'stage/<%=buildinfo.name%>/default/'},
              {expand: true, cwd: 'tests', src: ['**'], dest: 'stage/<%=buildinfo.name%>/tests/'}
          ]
      };
  
      copysource['sample_app_files'] = {
          options: {
              mode: true,
          },
          files: [{
              expand: true,
              cwd: 'resources/images',
              src: ['**/*'],
              dest: 'stage/app-<%=buildinfo.name%>/appserver/static/images'
          }, {
              expand: true,
              cwd: 'test/api',
              src: ['**/*'],
              dest: 'stage/app-<%=buildinfo.name%>/bin'
          }, {
              expand: true,
              cwd: 'resources/css',
              src: ['**/*'],
              dest: 'stage/app-<%=buildinfo.name%>/appserver/static/css'
          }, {
              expand: true,
              cwd: 'resources/conf',
              src: ['**/*'],
              dest: 'stage/app-<%=buildinfo.name%>/default'
          }, {
              expand: true,
              cwd: 'test/conf',
              src: ['**/*'],
              dest: 'stage/app-<%=buildinfo.name%>/default'
          }, {
              expand: true,
              cwd: 'test/nav',
              src: ['**/*'],
              dest: 'stage/app-<%=buildinfo.name%>/default/data/ui/nav'
          }, {
              expand: true,
              cwd: 'test/xml',
              src: ['**/*'],
              dest: 'stage/app-<%=buildinfo.name%>/default/data/ui/views'
          }, {
              expand: true,
              cwd: 'test/spec',
              src: ['test-<%=buildinfo.name%>.js'],
              dest: 'stage/app-<%=buildinfo.name%>/appserver/static/js/pages/'
          }, {
              expand: true,
              cwd: 'test',
              src: ['*.html'],
              dest: 'stage/app-<%=buildinfo.name%>/appserver/templates/'
          }, {
              expand: true,
              cwd: 'common',
              src: ['**/*'],
              dest: 'stage/app-<%=buildinfo.name%>/appserver/static/js/components/common'
          }]
      };
  
      return copysource;
  };
  