Example #1
0
        void Patch(PatchOptions options)
        {
            if (options.GitExePath == null)
            {
                options.GitExePath = GitUtils.FindGit();
            }
            if (options.GitExePath == null)
            {
                throw new ProgramException("Could not find git.exe in the usual places. Use the --git option");
            }
            if (options.WindowsTargetPlatformVersion == null)
            {
                options.WindowsTargetPlatformVersion = Constants.DefaultWindowsTargetPlatformVersion;
            }
            if (options.PlatformToolset == null)
            {
                options.PlatformToolset = Constants.DefaultPlatformToolset;
            }
            var patcher = new Patcher(options.UnityVersion, options.UnityGitHash, options.UnityRepoPath, options.DnSpyUnityMonoRepoPath, options.GitExePath, options.WindowsTargetPlatformVersion, options.PlatformToolset);

            patcher.Patch();
        }
Example #2
0
        void Patch(PatchOptions options)
        {
            if (options.GitExePath == null)
            {
                options.GitExePath = GitUtils.FindGit();
            }
            if (options.GitExePath == null)
            {
                throw new ProgramException("Could not find git executable in the usual places. Use the --git option");
            }
            if (options.WindowsTargetPlatformVersion == null)
            {
                options.WindowsTargetPlatformVersion = Constants.DefaultWindowsTargetPlatformVersion;
            }
            if (options.PlatformToolset == null)
            {
                options.PlatformToolset = Constants.DefaultPlatformToolset;
            }

            Patcher patcher;

            switch (GetPatcherKind(options.UnityVersion))
            {
            default:
            case PatcherKind.Unknown:
                throw new ProgramException("Invalid version number");

            case PatcherKind.V35:
                patcher = new V35.PatcherV35(options.UnityVersion, options.UnityGitHash, options.UnityRepoPath, options.DnSpyUnityMonoRepoPath, options.GitExePath, options.WindowsTargetPlatformVersion, options.PlatformToolset);
                break;

            case PatcherKind.V40:
                patcher = new V40.PatcherV40(options.UnityVersion, options.UnityGitHash, options.UnityRepoPath, options.DnSpyUnityMonoRepoPath, options.GitExePath, options.WindowsTargetPlatformVersion, options.PlatformToolset);
                break;
            }
            patcher.Patch();
        }