public static void ExportAllPackage()
        {
            var guids = FindAssetGuids(typeof(PackageExporterSetting));

            foreach (var guid in guids)
            {
                var path = AssetDatabase.GUIDToAssetPath(guid);
                PackageExporter.RunExpotPackage(AssetDatabase.LoadAssetAtPath <PackageExporterSetting>(path));
            }
        }
 public static void OpenExportPackageWindow()
 {
     PackageExporter.Open();
 }
Пример #3
0
        private void Release()
        {
            if (string.IsNullOrEmpty(_releaseParameter.TagName))
            {
                Debug.LogWarning("invalid tag name");
                return;
            }

            if (string.IsNullOrEmpty(_releaseParameter.UserName))
            {
                Debug.LogWarning("invalid user name");
                return;
            }

            if (string.IsNullOrEmpty(_releaseParameter.TokenValue))
            {
                Debug.LogWarning("invalid token");
                return;
            }

            if (_releaseSetting == null)
            {
                Debug.LogWarning("invalid setting");
                return;
            }

            EditorUserSettings.SetConfigValue(GetSaveKey(SaveKeyType.Branch), _releaseParameter.BranchName);
            EditorUserSettings.SetConfigValue(GetSaveKey(SaveKeyType.TagName), _releaseParameter.TagName);
            EditorUserSettings.SetConfigValue(GetSaveKey(SaveKeyType.UserName), _releaseParameter.UserName);
            EditorUserSettings.SetConfigValue(GetSaveKey(SaveKeyType.Token), _releaseParameter.TokenValue);

            _releaseParameter.UploadFilePaths.Clear();
            foreach (var packageSetting in _releaseSetting.UploadPackage)
            {
                PackageExporter.RunExpotPackage(packageSetting);
                _releaseParameter.UploadFilePaths.Add(PackageExporter.AddExportExtension(packageSetting.ExportName));
            }

            // リリース詳細
            try
            {
                var changeLog = File.ReadAllText(_releaseSetting.ChangeLogPath);

                var searchPattern = _releaseSetting.LogStartPattern.Replace(Utility.ReplaceTagText, _releaseParameter.TagName);
                var startMatch    = Regex.Match(changeLog, searchPattern);
                var searchIndex   = startMatch.Index + searchPattern.Length;
                var endMatch      = Regex.Match(
                    changeLog.Substring(searchIndex),
                    _releaseSetting.LogEndPattern.Replace(Utility.ReplaceTagText, _releaseParameter.TagName)
                    );

                var endIndex = endMatch.Index - 1;
                if (endIndex < 0)
                {
                    // マッチしない場合
                    endIndex = changeLog.Length - startMatch.Index;
                }
                else
                {
                    // マッチした場合
                    endIndex += searchPattern.Length;
                }

                _releaseParameter.Description = changeLog.Substring(startMatch.Index, endIndex);
            }
            catch (Exception e)
            {
                Debug.LogErrorFormat("Change Log Error: {0}", e);
            }

            _releaseParameter.ReleaseName    = _releaseParameter.TagName;
            _releaseParameter.RepositoryPath = _releaseSetting.RepositoryPath;

            var executor = CreateExecutor(_executorType);

            executor.Execute(_releaseParameter, () => Debug.Log("Release Complete"));
        }