Dynamically define variables

Issue #13 closed
Denis Kuzmin repo owner created an issue
  • suggested format:
temporary - at runtime:

    $(var=value)
    $(var=value:project)
persistence - writes into standard projects containers ~.csproj,.vcxproj,etc.:

    $(#var=value)
    $(#var=value:project)

  • sample of use:
$(slnDir=$(SolutionDir.Replace('\', '/')))
$(prgDir=$(ProjectDir.Replace('\', '/'):vsSolutionBuildEvent))
$(prgDirVer=$(ProjectDir.Replace('\', '/'):Version))

"$(TargetPath.Replace('\', '/'):Version)" 
"$(slnDir)_version" "$(slnDir).git" "$(prgDirVer)Version.tpl" "$(prgDir)Version.cs" "$(prgDir)source.extension.vsixmanifest"

/ find conflicts: MSBuild Concepts - Property Functions

Comments (7)

  1. Denis Kuzmin reporter

    new structure:

    public struct TPreparedData
    {
        /// <summary>
        /// Dynamically define variables
        /// </summary>
        public TVar variable;
        /// <summary>
        /// Unit of properties
        /// </summary>
        public TProperty property;
    
        public struct TVar
        {
            /// <summary>
            /// Storage if present
            /// </summary>
            public string name;
            /// <summary>
            /// Specific project where to store.
            /// null value - project by default
            /// </summary>
            public string project;
            /// <summary>
            /// Storing in the projects files ~ .csproj, .vcxproj, ..
            /// </summary>
            /// <remarks>reserved</remarks>
            public bool isPersistence;
        }
    
        public struct TProperty
        {
            /// <summary>
            /// Complex phrase or simple property
            /// </summary>
            public bool complex;
            /// <summary>
            /// has escaped property
            /// </summary>
            public bool escaped;
            /// <summary>
            /// Contain all prepared data from specific projects. Not complete evaluation!
            /// i.e.: prepares only all $(..:project) data
            /// </summary>
            public string unevaluated;
            /// <summary>
            /// Specific project for unevaluated data
            /// </summary>
            public string project;
            /// <summary>
            /// Step of handling
            /// </summary>
            public bool completed;
            /// <summary>
            /// Raw unprepared data without(in any case) storage variable
            /// </summary>
            public string raw;
        }
    }
    

    6156b49 - currently not parsed all internal projects from variable

  2. Log in to comment