Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Ungureanu <teromario@yahoo.com>2016-06-17 18:42:03 +0300
committerGitHub <noreply@github.com>2016-06-17 18:42:03 +0300
commit3ea718ee98e217cc1d3f870443425bcafe8afc03 (patch)
treed050aa7ae5ea7fb91b0064c1f6a1dfddfc8b900d
parentbb80c8bacb3418b787ea314d4b39eee000b70c59 (diff)
parentbcf29c8828fa64e0e091dfa6ef5b31fb3614d56c (diff)
Merge pull request #1514 from mono/cycle7-sr0-svn-climonodevelop-6.0.1.6
[Svn] Implement support to install Command Line Tools on demand.
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix.csproj5
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix/SvnClient.cs43
2 files changed, 48 insertions, 0 deletions
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix.csproj
index 39a4ab53a3..e078d74d74 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix.csproj
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix.csproj
@@ -97,6 +97,11 @@
<Name>Mono.Addins</Name>
<Private>False</Private>
</ProjectReference>
+ <ProjectReference Include="..\..\..\core\MonoDevelop.Ide\MonoDevelop.Ide.csproj">
+ <Project>{27096E7F-C91C-4AC6-B289-6897A701DF21}</Project>
+ <Name>MonoDevelop.Ide</Name>
+ <Private>False</Private>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="MonoDevelop.VersionControl.Subversion.Unix.addin.xml">
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix/SvnClient.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix/SvnClient.cs
index fabd3868a6..c5dc8a728b 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix/SvnClient.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix/SvnClient.cs
@@ -13,6 +13,8 @@ using off_t = System.Int64;
using MonoDevelop.Projects.Text;
using System.Threading;
using System.Linq;
+using MonoDevelop.Ide;
+using System.Diagnostics;
namespace MonoDevelop.VersionControl.Subversion.Unix
{
@@ -114,6 +116,9 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
internal static bool CheckInstalled ()
{
+ if (IsDependentOnXcodeCLITools.Value)
+ return true;
+
// libsvn_client may be linked to libapr-0 or libapr-1, and we need to bind the LibApr class
// to the same library. The following code detects the required libapr version and loads it.
int aprver = GetLoadAprLib (-1);
@@ -198,11 +203,49 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
return new UnixSvnBackend ();
}
+ static bool FallbackProbeDirectoryDotSvn (FilePath path)
+ {
+ while (!path.IsNullOrEmpty) {
+ if (Directory.Exists (path.Combine (".svn")))
+ return true;
+ path = path.ParentDirectory;
+ }
+ return false;
+ }
+
+ const string commandLineToolsSvn = "/Library/Developer/CommandLineTools/usr/lib/libsvn_client-1.0.dylib";
+ static Lazy<bool> IsDependentOnXcodeCLITools = new Lazy<bool> (
+ () => Platform.IsMac && Environment.Is64BitOperatingSystem && !File.Exists (commandLineToolsSvn)
+ );
+
+ bool macDisabled;
public override string GetDirectoryDotSvn (FilePath path)
{
+ if (macDisabled)
+ return string.Empty;
+
if (path.IsNullOrEmpty)
return string.Empty;
+ // For Mac 64bits, we need to have Xcode Command Line Tools installed.
+ if (IsDependentOnXcodeCLITools.Value) {
+ if (!FallbackProbeDirectoryDotSvn (path))
+ return string.Empty;
+
+ var button = new AlertButton (GettextCatalog.GetString ("Install"));
+ if (MessageService.AskQuestion (
+ GettextCatalog.GetString ("This solution may be using Subversion. Do you want to install Xcode Command Line Tools now?"),
+ BrandingService.BrandApplicationName (
+ GettextCatalog.GetString ("Xcode Command Line Tools are not currently installed, and are required to use Subversion.\nPlease restart MonoDevelop after the installation to enable Subversion support.")),
+ AlertButton.Cancel,
+ button) == button) {
+ var p = Process.Start ("xcode-select", "--install");
+ p.WaitForExit ();
+ }
+ macDisabled = true;
+ return string.Empty;
+ }
+
if (Pre_1_7)
return base.GetDirectoryDotSvn (path);