コード例 #1
0
        static TaskProxy()
        {
#if !NET461
            GitLoaderContext.Init("GitVersionCore", "LibGit2Sharp");
#endif
            LibGit2SharpLoader.LoadAssembly("GitVersionTask");

            var type = LibGit2SharpLoader.Instance.Assembly.GetType("GitVersionTask.GitVersionTasks", throwOnError: true).GetTypeInfo();

            GetVersion = GetMethod <GetVersion>(type, nameof(GetVersion));
            GenerateGitVersionInformation = GetMethod <GenerateGitVersionInformation>(type, nameof(GenerateGitVersionInformation));
            UpdateAssemblyInfo            = GetMethod <UpdateAssemblyInfo>(type, nameof(UpdateAssemblyInfo));
            WriteVersionInfoToBuildLog    = GetMethod <WriteVersionInfoToBuildLog>(type, nameof(WriteVersionInfoToBuildLog));
        }
コード例 #2
0
ファイル: TaskProxy.cs プロジェクト: zionyx/GitVersion
        static TaskProxy()
        {
            try
            {
#if !NETFRAMEWORK
                GitLoaderContext.Init(typeof(TaskProxy).Assembly);
#endif
                LibGit2SharpLoader.LoadAssembly("GitVersionTask");

                var type = LibGit2SharpLoader.Instance.Assembly.GetType("GitVersion.MSBuildTask.GitVersionTasks", throwOnError: true).GetTypeInfo();

                GetVersion = GetMethod <GetVersion>(type, nameof(GetVersion));
                GenerateGitVersionInformation = GetMethod <GenerateGitVersionInformation>(type, nameof(GenerateGitVersionInformation));
                UpdateAssemblyInfo            = GetMethod <UpdateAssemblyInfo>(type, nameof(UpdateAssemblyInfo));
                WriteVersionInfoToBuildLog    = GetMethod <WriteVersionInfoToBuildLog>(type, nameof(WriteVersionInfoToBuildLog));
            }
            catch (Exception e)
            {
                InitialiseException = e;
            }
        }