Esempio n. 1
0
        private AddItemTransform <IncludeContext> AddMappingToTransform(
            AddItemTransform <IncludeContext> addItemTransform,
            string targetPath)
        {
            var targetIsFile             = MappingsTargetPathIsFile(targetPath);
            var msbuildLinkMetadataValue = ConvertTargetPathToMsbuildMetadata(targetPath, targetIsFile);

            return(addItemTransform.WithMetadata("Link", msbuildLinkMetadataValue));
        }
Esempio n. 2
0
        private void CreateTransformSet()
        {
            var includeFilesExcludeFilesTransformation = new AddItemTransform <IncludeContext>(
                _itemName,
                includeContext => FormatPatterns(includeContext.IncludeFiles, includeContext.SourceBasePath),
                includeContext => FormatPatterns(includeContext.ExcludeFiles, includeContext.SourceBasePath),
                includeContext => includeContext != null && includeContext.IncludeFiles.Count > 0);

            var includeExcludeTransformation = new AddItemTransform <IncludeContext>(
                _itemName,
                includeContext =>
            {
                var fullIncludeSet = includeContext.IncludePatterns.OrEmptyIfNull()
                                     .Union(includeContext.BuiltInsInclude.OrEmptyIfNull());

                return(FormatPatterns(fullIncludeSet, includeContext.SourceBasePath));
            },
                includeContext =>
            {
                var fullExcludeSet = includeContext.ExcludePatterns.OrEmptyIfNull()
                                     .Union(includeContext.BuiltInsExclude.OrEmptyIfNull())
                                     .Union(includeContext.ExcludeFiles.OrEmptyIfNull());

                return(FormatPatterns(fullExcludeSet, includeContext.SourceBasePath));
            },
                includeContext =>
            {
                return(includeContext != null &&
                       (
                           (includeContext.IncludePatterns != null && includeContext.IncludePatterns.Count > 0)
                           ||
                           (includeContext.BuiltInsInclude != null && includeContext.BuiltInsInclude.Count > 0)
                       ));
            });

            foreach (var metadata in _metadata)
            {
                includeFilesExcludeFilesTransformation.WithMetadata(metadata);
                includeExcludeTransformation.WithMetadata(metadata);
            }

            _transformSet = new []
            {
                includeFilesExcludeFilesTransformation,
                includeExcludeTransformation
            };
        }
Esempio n. 3
0
 private AddItemTransform <IncludeContext> AddMappingToTransform(
     AddItemTransform <IncludeContext> addItemTransform,
     string targetPath)
 {
     return(_mappingsToTransfrom(addItemTransform, targetPath));
 }