Captures a path that must be added to the PATH environment variable. When IsDynamicPattern is true, the path is expansed and/or gobbled dynamically instead of beeing resolved at the very beginning of the build script execution.
Exemple #1
0
 /// <summary>
 /// Adds a path to <see cref="EnvironmentAddedPaths"/> or <see cref="EnvironmentDynamicPaths"/>.
 /// </summary>
 /// <param name="p">The path to add.</param>
 public void AddPath(EnvironmentAddedPath p)
 {
     if (p.IsDynamicPattern)
     {
         if (!_dynamicPaths.Contains(p.Path))
         {
             _dynamicPaths.Add(p.Path);
         }
     }
     else
     {
         string expansed = Environment.ExpandEnvironmentVariables(p.Path);
         foreach (var final in _globber.GetDirectories(expansed).Select(d => d.FullPath))
         {
             if (!_addedPaths.Contains(final))
             {
                 _addedPaths.Add(final);
             }
         }
     }
 }
 /// <summary>
 /// Adds a path to <see cref="EnvironmentAddedPaths"/> or <see cref="EnvironmentDynamicPaths"/>.
 /// </summary>
 /// <param name="p">The path to add.</param>
 public void AddPath( EnvironmentAddedPath p )
 {
     if( p.IsDynamicPattern )
     {
         if( !_dynamicPaths.Contains( p.Path ) ) _dynamicPaths.Add( p.Path );
     }
     else
     {
         string expansed = Environment.ExpandEnvironmentVariables( p.Path );
         foreach( var final in _globber.GetDirectories( expansed ).Select( d => d.FullPath ) )
         {
             if( !_addedPaths.Contains( final ) ) _addedPaths.Add( final );
         }
     }
 }