示例#1
0
        private void GenerateLockfile(LockfileSnapshot snapshot)
        {
            string result = "# UPFILE DEPENDENCIES\n";

            foreach (DependencyDefinition def in snapshot.upfileDependencies)
            {
                result += string.Format("{0} ({1})\n", def.Name, def.Version);
            }

            result += "\n# SOLVED DEPENDENCIES\n";

            foreach (PackageRepo pr in snapshot.installableDependencies)
            {
                Upset package = pr.Package;
                result += string.Format("{0} ({1})\n", package.PackageName, package.PackageVersion);
                if (package.Dependencies != null && package.Dependencies.Length != 0)
                {
                    foreach (DependencyDefinition dependency in package.Dependencies)
                    {
                        result += string.Format("\t{0} ({1})\n", dependency.Name, dependency.Version);
                    }
                }
            }

            using (StreamWriter file = new StreamWriter(lockfilePath, false))
            {
                file.WriteLine(result);
            }

            LockFileTracker.SaveState();
        }
示例#2
0
        static Initialize()
        {
            Debug.Log("Using Uplift version " + About.Version);
            if (!Upfile.CheckForUpfile())
            {
                Debug.Log("No Upfile was found at the root of your project, Uplift created a sample one for you to start working on");
                SampleFile.CreateSampleUpfile();
            }

            if (LockFileTracker.HasChanged())
            {
                UpliftManager.ResetInstances();
                UpliftManager.Instance().InstallDependencies(strategy: UpliftManager.InstallStrategy.ONLY_LOCKFILE);
                LockFileTracker.SaveState();
            }

            Updater.CheckForUpdate();
        }