Exemplo n.º 1
0
        public DependencyState[] GetDependenciesState(bool refresh = false)
        {
            if (refresh)
            {
                UpliftManager.ResetInstances();
            }
            Upbring upbring = Upbring.Instance();

            PackageRepo[] targets = GetTargets(GetDependencySolver(), InstallStrategy.UPDATE_LOCKFILE, false);

            bool anyInstalled =
                upbring.InstalledPackage != null &&
                upbring.InstalledPackage.Length != 0;

            List <DependencyState> dependenciesState = new List <DependencyState>();

            foreach (DependencyDefinition definition in upfile.Dependencies)
            {
                AppendDependencyState(
                    ref dependenciesState,
                    definition,
                    targets,
                    anyInstalled
                    );
            }

            return(dependenciesState.ToArray());
        }
Exemplo n.º 2
0
 public static void ResetInstances()
 {
     instance = null;
     Upfile.ResetInstance();
     Upbring.ResetInstance();
     InitializeInstance();
 }
Exemplo n.º 3
0
        private static void CheckDependencies()
        {
            using (LogAggregator LA = LogAggregator.InUnity(
                       "Dependencies state:",
                       "Dependencies state:",
                       "Dependencies state:"
                       ))
            {
                UpliftManager.DependencyState[] states = UpliftManager.Instance().GetDependenciesState();

                foreach (UpliftManager.DependencyState state in states)
                {
                    string message = string.Format("Package {0} ({1}) ", state.definition.Name, state.definition.Version);
                    if (state.installed != null)
                    {
                        if (state.installed.Version != state.bestMatch.Package.PackageVersion)
                        {
                            message += string.Format(
                                "is outdated. Best available version is {0} (from {1})",
                                state.bestMatch.Package.PackageVersion,
                                state.bestMatch.Repository.ToString()
                                );
                        }
                        else
                        {
                            message += "is up to date.";
                        }

                        if (!state.definition.Requirement.IsMetBy(state.installed.Version))
                        {
                            message += "\nWarning: the package currently installed does not match your requirements";
                        }
                    }
                    else
                    {
                        message += string.Format(
                            "is not installed. Best available version is {0} (from {1})",
                            state.bestMatch.Package.PackageVersion,
                            state.bestMatch.Repository.ToString()
                            );
                    }

                    if (state.latest.Package.PackageVersion != state.bestMatch.Package.PackageVersion)
                    {
                        message += string.Format(
                            "\nNote: there is a more recent version of the package ({0} from {1}), but it doesn't match your requirement",
                            state.latest.Package.PackageVersion,
                            state.bestMatch.Repository.ToString()
                            );
                    }

                    if (state.transitive)
                    {
                        message = "`--> " + string.Join("    \n", message.Split('\n'));
                    }

                    Debug.Log(message);
                }
            }
        }
Exemplo n.º 4
0
 private static void InstallDependencies()
 {
     Debug.Log("Installing Upfile dependencies");
     UpliftManager.ResetInstances();
     UpliftManager.Instance().InstallDependencies(strategy: UpliftManager.InstallStrategy.INCOMPLETE_LOCKFILE);
     AssetDatabase.Refresh();
 }
Exemplo n.º 5
0
 public static void ResetInstances()
 {
     Debug.Log("---> Resetting instances : ");
     instance = null;
     Upfile.ResetInstance();
     Upbring.ResetInstance();
     InitializeInstance();
 }
Exemplo n.º 6
0
 public void InstallDependencies(InstallStrategy strategy = InstallStrategy.UPDATE_LOCKFILE, bool refresh = false)
 {
     if (refresh)
     {
         UpliftManager.ResetInstances();
     }
     PackageRepo[] targets = GetTargets(GetDependencySolver(), strategy);
     InstallPackages(targets);
 }
Exemplo n.º 7
0
        private static void InstallLockfile()
        {
            Debug.Log("Installing from Lockfile : ");
            UpliftManager.ResetInstances();
            UpliftManager.Instance().InstallDependencies(strategy: UpliftManager.InstallStrategy.ONLY_LOCKFILE);

            Debug.Log("-> Resfreshing AssetDatabase");
            AssetDatabase.Refresh();
        }
Exemplo n.º 8
0
        static Initialize()
        {
            Debug.Log("Upfile loading...");
            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 (!IsInitialized())
            {
                UpliftManager.Instance().InstallDependencies(strategy: UpliftManager.InstallStrategy.ONLY_LOCKFILE, refresh: true);
                MarkAsInitialized();
            }
        }
Exemplo n.º 9
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();
        }
Exemplo n.º 10
0
 internal static void InitializeInstance()
 {
     instance        = new UpliftManager();
     instance.upfile = Upfile.Instance();
 }
Exemplo n.º 11
0
 internal static void InitializeInstance()
 {
     instance = new UpliftManager();
     instance.versionParser = new VersionParser();
 }
Exemplo n.º 12
0
 private static void NukePackages()
 {
     Debug.LogWarning("Nuking all packages!");
     UpliftManager.Instance().NukeAllPackages();
     AssetDatabase.Refresh();
 }
Exemplo n.º 13
0
 private static void RefreshUpfile()
 {
     UpliftManager.ResetInstances();
     Debug.Log("Upfile refreshed");
 }
Exemplo n.º 14
0
 private static void InstallLockfile()
 {
     UpliftManager.ResetInstances();
     UpliftManager.Instance().InstallDependencies(strategy: UpliftManager.InstallStrategy.ONLY_LOCKFILE);
     AssetDatabase.Refresh();
 }
Exemplo n.º 15
0
 private static void InstallDependencies()
 {
     Debug.Log("Installing Upfile dependencies");
     UpliftManager.Instance().InstallDependencies();
     AssetDatabase.Refresh();
 }