void OnValidate()
        {
            if (Application.internetReachability == NetworkReachability.NotReachable)
            {
                Debug.LogWarning("Validation suite requires network access and cannot be used offline.");
                return;
            }

            ValidationSuite.ValidatePackage(PackageVersion.versionId(), ValidationType.LocalDevelopment);
            PrepareTools.ShowValidationReport();
        }
        public void OnPackageSelectionChange(IPackageVersion packageVersion, VisualElement toolbar)
        {
            if (packageVersion == null || toolbar == null)
            {
                return;
            }

            PackageVersion = packageVersion;
            Toolbar        = toolbar;

            if (PrepareTools == null)
            {
                PrepareTools             = new PrepareTools(packageVersion, PackageTestRunner);
                PrepareTools.OnValidate += OnValidate;
            }
            if (PublishTools == null)
            {
                PublishTools = new PublishTools();
            }
            if (DevelopTools == null)
            {
                DevelopTools = new DevelopTools();
            }

            // Put the publish button right before the edit package manifest button, or at the end if it does not exists
            var rightItems          = toolbar.Q <VisualElement>(RightItemsName);
            var editPackageManifest = rightItems.Q <VisualElement>("editPackageManifest");
            var publishPosition     = editPackageManifest != null?rightItems.IndexOf(editPackageManifest) : rightItems.childCount;

            AddIfNotExists(toolbar.Q <VisualElement>(LeftItemsName), PrepareTools);
            AddIfNotExists(toolbar.Q <VisualElement>(LeftItemsName), DevelopTools);
            AddIfNotExists(rightItems, PublishTools, publishPosition);

            DevelopTools.SetPackage(packageVersion);
            PrepareTools.SetPackage(packageVersion);
            PublishTools.SetPackage(packageVersion);

            var publishTarget = PackageManagerState.Instance.ForPackage(PackageVersion)?.PublishTarget;
            var extension     = PackageManagerDevelopExtensions.GetPublishExtension(publishTarget);
        }