private void OnExport()
        {
            if (selectedSetting == null)
            {
                return;
            }
            ClearLogs();
            SaveSettings();
            OutLog("Start exporting with validation.");
            var baseFolderPath = AssetDatabase.GetAssetPath(baseFolder);

            result = ValidatedExporter.ValidatedExport(baseFolderPath, selectedSetting, forceExport);
            AssetDatabase.Refresh();
            var header = string.Format("- version:{0}", ProductInfoUtility.GetVersion()) + Environment.NewLine;

            header += string.Format("- Rule set:{0}", selectedSetting.SettingName) + Environment.NewLine;
            header += string.Format("- Base folder:{0}", baseFolderPath) + Environment.NewLine;
            if (forceExport)
            {
                header += string.Format("- Force export:{0}", forceExport) + Environment.NewLine;
            }
            var log = header + result.GetValidationLog() + result.GetExportLog() + result.log;

            forceExport = false;
            SetMessages(header, result);
            OutLog(log);
            OutLog("Export completed.");
        }
Beispiel #2
0
        public static bool IsLatest()
        {
            string localVersion  = ProductInfoUtility.GetVersion();
            string latestVersion = JsonReleaseInfo.GetVersion();

            return(string.Equals(localVersion, latestVersion));
        }
 public static string GetReleaseUrl()
 {
     return(Path.Combine(
                ProductInfoUtility.GetDeveloperLinkURL()
                .Replace("https://github.com/", "https://raw.githubusercontent.com/"),
                JsonReleaseInfo.ReleaseBranchName,
                JsonReleaseInfo.VitDeckRootPath,
                JsonReleaseInfo.JsonReleaseInfoPath
                ));
 }
 private static void Export()
 {
     AssetDatabase.ExportPackage(
         AssetDatabase.GetAllAssetPaths().Where(path => path == ToolExporter.RootPath ||
                                                path.StartsWith(ToolExporter.RootPath + "/") && !ToolExporter.IgnorePattern.IsMatch(path))
         .ToArray(),
         Path.Combine(
             ToolExporter.DestinationFolderPath,
             $"{ProductInfoUtility.GetDeveloperLinkTitle()}-{ProductInfoUtility.GetVersion()}.unitypackage"
             )
         );
 }
Beispiel #5
0
 private static void SaveReleaseInfo()
 {
     File.WriteAllText(Path.Combine(
                           Path.GetDirectoryName(Application.dataPath),
                           JsonReleaseInfo.VitDeckRootPath,
                           JsonReleaseInfo.JsonReleaseInfoPath
                           ), JsonUtility.ToJson(new JsonReleaseInfo.ReleaseInfo()
     {
         version      = ProductInfoUtility.GetVersion(),
         package_name = ProductInfoUtility.GetDeveloperLinkTitle(),
         download_url = $"{ProductInfoUtility.GetDeveloperLinkURL()}/releases/download/v{ProductInfoUtility.GetVersion()}/{ToolExporter.GetPackageName()}",
     }, true));
     AssetDatabase.Refresh();
 }
Beispiel #6
0
 private void Init()
 {
     versionLabel       = "Version : " + ProductInfoUtility.GetVersion();
     developerLinkTitle = ProductInfoUtility.GetDeveloperLinkTitle();
     developerLinkURL   = ProductInfoUtility.GetDeveloperLinkURL();
     if (UpdateCheck.Enabled)
     {
         var version = UpdateCheck.GetLatestVersion();
         if (version == null)
         {
             latestVersion = "None";
         }
         else
         {
             latestVersion = version;
         }
         latestVersionLabel = "Latest Version : " + latestVersion;
     }
 }
        protected override void Logic(ValidationTarget target)
        {
            if (!UpdateCheck.Enabled)
            {
                this.AddIssue(new Issue(
                                  target: null,
                                  IssueLevel.Warning,
                                  "VitDeckのバージョンチェックが無効になっています。",
                                  this.solution,
                                  this.solutionURL
                                  ));
                return;
            }

            var latestVersion = UpdateCheck.GetLatestVersion();

            if (latestVersion == null)
            {
                this.AddIssue(new Issue(
                                  target: null,
                                  IssueLevel.Warning,
                                  "VitDeckの最新バージョン番号の取得に失敗しました。",
                                  this.solution,
                                  this.solutionURL
                                  ));
                return;
            }

            var currentVersion = ProductInfoUtility.GetVersion();

            if (currentVersion != latestVersion)
            {
                this.AddIssue(new Issue(
                                  target: null,
                                  IssueLevel.Error,
                                  $"VitDeckが最新バージョンではありません。\n現在のバージョン: {currentVersion}\n最新バージョン: {latestVersion}",
                                  this.solution,
                                  this.solutionURL
                                  ));
            }
        }
Beispiel #8
0
        private void OnValidate()
        {
            if (selectedRuleSet == null)
            {
                return;
            }
            ClearLogs();
            SaveSettings();
            var baseFolderPath = AssetDatabase.GetAssetPath(baseFolder);

            OutLog("Starting validation.");
            results = Validator.Validate(selectedRuleSet, baseFolderPath);
            var header = string.Format("- version:{0}", ProductInfoUtility.GetVersion()) + Environment.NewLine;

            header += string.Format("- Rule set:{0}", selectedRuleSet.RuleSetName) + Environment.NewLine;
            header += string.Format("- Base folder:{0}", baseFolderPath) + Environment.NewLine;
            var log = header;

            log += GetResultLog(results, isHideInfoMessage ? IssueLevel.Warning : IssueLevel.Info);
            SetMessages(header, results);
            OutLog(log);
            OutLog("Validation complete.");
        }
Beispiel #9
0
 private static string GetPackageName()
 {
     return($"{ProductInfoUtility.GetDeveloperLinkTitle().Replace(" ", "-")}-{ProductInfoUtility.GetVersion()}.unitypackage");
 }
Beispiel #10
0
        public void TestGetVersion()
        {
            var version = ProductInfoUtility.GetVersion();

            Assert.That(version, Is.EqualTo("1.0.0-dev"));
        }
Beispiel #11
0
        public void TestGetDeveloperLinkURL()
        {
            var url = ProductInfoUtility.GetDeveloperLinkURL();

            Assert.That(url, Is.EqualTo("https://github.com/vitdeck/VitDeck"));
        }
Beispiel #12
0
        public void TestGetDeveloperLinkTitle()
        {
            var title = ProductInfoUtility.GetDeveloperLinkTitle();

            Assert.That(title, Is.EqualTo("VitDeck on GitHub"));
        }