Exemple #1
0
        private static string ReplaceDependencyVersion(BuildTargetContext c, string fileContents, string dependencyPropertyName, string packageId)
        {
            Regex  regex      = new Regex($@"{dependencyPropertyName} = ""(?<version>.*)"";");
            string newVersion = c.GetNewVersion(packageId);

            return(regex.ReplaceGroupValue(fileContents, "version", newVersion));
        }
Exemple #2
0
        public static BuildTargetResult ReplaceCoreHostPackaging(BuildTargetContext c)
        {
            ReplaceFileContents(@"pkg\dir.props", contents =>
            {
                Regex regex = new Regex(@"Microsoft\.NETCore\.Platforms\\(?<version>.*)\\runtime\.json");
                string newNetCorePlatformsVersion = c.GetNewVersion("Microsoft.NETCore.Platforms");

                return(regex.ReplaceGroupValue(contents, "version", newNetCorePlatformsVersion));
            });

            return(c.Success());
        }