Example #1
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();
            }
        }
Example #2
0
        public void CheckForUpfileAbsentTest()
        {
            string pwd    = Directory.GetCurrentDirectory();
            string tmpDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());

            Directory.CreateDirectory(tmpDir);
            try
            {
                Directory.SetCurrentDirectory(tmpDir);

                Assert.IsFalse(Upfile.CheckForUpfile());
            }
            finally
            {
                Directory.SetCurrentDirectory(pwd);
                Directory.Delete(tmpDir, true);
            }
        }
Example #3
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();
        }
Example #4
0
        public void CheckForUpfilePresentTest()
        {
            string pwd    = Directory.GetCurrentDirectory();
            string tmpDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());

            Directory.CreateDirectory(tmpDir);
            try
            {
                Directory.SetCurrentDirectory(tmpDir);

                // Create dummy Upfile
                File.Create("Upfile.xml").Dispose();

                Assert.IsTrue(Upfile.CheckForUpfile());
            }
            finally
            {
                Directory.SetCurrentDirectory(pwd);
                Directory.Delete(tmpDir, true);
            }
        }
Example #5
0
 private static bool CheckForUpfile()
 {
     return(!Upfile.CheckForUpfile());
 }