-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from yuv4ik/usability_improvements
Strict ConvertToNetStandardHandler to support only C# portable libraries
- Loading branch information
Showing
9 changed files
with
71 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using System; | ||
namespace Mutatio | ||
{ | ||
public static class Consts | ||
{ | ||
public const string ProjectUrl = "https://github.com/yuv4ik/mutatio"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,31 @@ | ||
using MonoDevelop.Projects; | ||
using System; | ||
using MonoDevelop.Projects; | ||
|
||
namespace Mutatio.Extensions | ||
{ | ||
public static class DotNetProjectExtenions | ||
{ | ||
public static string GetCsProjFilePath(this DotNetProject proj) => $"{proj.BaseDirectory.FullPath}/{proj.Name}.csproj"; | ||
public static string GetPackagesFilePath(this DotNetProject proj) => $"{proj.BaseDirectory.FullPath}/packages.config"; | ||
public static string GetPropertiesDirPath(this DotNetProject proj) => $"{proj.BaseDirectory.FullPath}/Properties"; | ||
|
||
public static string GetProjFilePath(this DotNetProject proj) => proj.FileName.FullPath; | ||
public static string GetProjFileExtension(this DotNetProject proj) => proj.FileName.Extension; | ||
|
||
public static string GetAssemblyInfoFilePath(this DotNetProject proj) | ||
{ | ||
switch(proj.LanguageName) | ||
{ | ||
case "C#": | ||
return $"{proj.BaseDirectory.FullPath}/Properties/AssemblyInfo.cs"; | ||
case "F#": | ||
return $"{proj.BaseDirectory.FullPath}/AssemblyInfo.fs"; | ||
case "VBNET": | ||
return $"{proj.BaseDirectory.FullPath}/AssemblyInfo.vb"; | ||
default: | ||
throw new NotSupportedException($"{proj.LanguageName} is currently unsupported. Please create an issue on github: {Consts.ProjectUrl}"); | ||
} | ||
} | ||
|
||
public static bool IsCSharpProject(this DotNetProject proj) => proj.LanguageName.Equals("c#", StringComparison.OrdinalIgnoreCase); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Xml.Linq; | ||
|
||
namespace Mutatio | ||
{ | ||
public class PackagesFileParser | ||
{ | ||
public IEnumerable<Tuple<string, string>> GetPackages(string filePath) | ||
public IEnumerable<(string name, string version)> GetPackages(string filePath) | ||
{ | ||
var doc = XDocument.Load(filePath); | ||
return doc.Elements("packages").Descendants().Select(p => new Tuple<string, string>(p.Attribute("id").Value, p.Attribute("version").Value)); | ||
return doc.Elements("packages").Descendants().Select(p => (p.Attribute("id").Value, p.Attribute("version").Value)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
using Mono.Addins; | ||
using Mono.Addins.Description; | ||
using Mutatio; | ||
|
||
[assembly: Addin( | ||
"Mutatio", | ||
Namespace = "Mutatio", | ||
Version = "1.0" | ||
Version = "1.0.1" | ||
)] | ||
|
||
[assembly: AddinName("Mutatio")] | ||
[assembly: AddinCategory("IDE extensions")] | ||
[assembly: AddinDescription("Converts PCL to .NET Standard 2.0 automatically.")] | ||
[assembly: AddinDescription("Automatically convert projects from PCL to .NET Standard 2.0.")] | ||
[assembly: AddinAuthor("Evgeny Zborovsky")] | ||
[assembly: AddinUrl("https://github.com/yuv4ik/mutatio")] | ||
[assembly: AddinUrl(Consts.ProjectUrl)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.