Browse Source

[studio] Improve package installing

pull/10363/head
Yunus Emre Kalkan 5 years ago
parent
commit
8cde546db1
  1. 22
      studio/src/Volo.Abp.Studio.Domain.CommonServices/Volo/Abp/Studio/Modifying/CsprojFileManager.cs
  2. 148
      studio/src/Volo.Abp.Studio.Domain.CommonServices/Volo/Abp/Studio/Package/PackageTypes.cs

22
studio/src/Volo.Abp.Studio.Domain.CommonServices/Volo/Abp/Studio/Modifying/CsprojFileManager.cs

@ -143,23 +143,29 @@ namespace Volo.Abp.Studio.Packages.Modifying
var packageReferenceNodes = document.SelectNodes($"/Project/ItemGroup/PackageReference"); var packageReferenceNodes = document.SelectNodes($"/Project/ItemGroup/PackageReference");
var projectReferenceNodes = document.SelectNodes($"/Project/ItemGroup/ProjectReference"); var projectReferenceNodes = document.SelectNodes($"/Project/ItemGroup/ProjectReference");
foreach (XmlNode packageReferenceNode in packageReferenceNodes) if (packageReferenceNodes != null && packageReferenceNodes.Count > 0)
{ {
result.Add( foreach (XmlNode packageReferenceNode in packageReferenceNodes)
{
result.Add(
new PackageDependency( new PackageDependency(
packageReferenceNode.Attributes["Include"].Value, packageReferenceNode.Attributes["Include"].Value,
packageReferenceNode.Attributes["Version"].Value packageReferenceNode.Attributes["Version"].Value
) )
); );
}
} }
foreach (XmlNode projectReferenceNode in projectReferenceNodes) if (projectReferenceNodes != null && projectReferenceNodes.Count > 0)
{ {
result.Add( foreach (XmlNode projectReferenceNode in projectReferenceNodes)
{
result.Add(
new PackageDependency( new PackageDependency(
Path.GetFullPath(Path.Combine(Path.GetDirectoryName(filePath), projectReferenceNode.Attributes["Include"].Value)) Path.GetFullPath(Path.Combine(Path.GetDirectoryName(filePath), projectReferenceNode.Attributes["Include"].Value))
) )
); );
}
} }
return result; return result;

148
studio/src/Volo.Abp.Studio.Domain.CommonServices/Volo/Abp/Studio/Package/PackageTypes.cs

@ -1,4 +1,6 @@
namespace Volo.Abp.Studio.Packages using System.Collections.Generic;
namespace Volo.Abp.Studio.Packages
{ {
public static class PackageTypes public static class PackageTypes
{ {
@ -95,5 +97,149 @@
_ => null _ => null
}; };
} }
// TODO: Rename this method, or (maybe and) write a summary. Also consider other suggestions
public static List<string> GetDddTargetProjectRole(string packageType)
{
if (packageType == DomainShared)
{
return new List<string>()
{
Domain,
ApplicationContracts
};
}
if (packageType == Domain)
{
return new List<string>()
{
Application
};
}
if (packageType == ApplicationContracts)
{
return new List<string>()
{
Application,
Mvc,
Blazor,
BlazorServer,
BlazorWebAssembly,
HttpApi
};
}
if (packageType == Application)
{
return new List<string>()
{
Application,
HostMvc,
HostBlazorServer,
HostBlazorWebAssembly,
HostHttpApi
};
}
if (packageType == EntityFrameworkCore)
{
return new List<string>()
{
HostMvc,
HostBlazorServer,
HostBlazorWebAssembly,
HostHttpApi
};
}
if (packageType == MongoDB)
{
return new List<string>()
{
HostMvc,
HostBlazorServer,
HostBlazorWebAssembly,
HostHttpApi
};
}
if (packageType == HttpApi)
{
return new List<string>()
{
HostMvc,
HostBlazorServer,
HostBlazorWebAssembly,
HostHttpApi
};
}
if (packageType == HttpApiClient)
{
return new List<string>()
{
HostMvc,
HostBlazorServer,
HostBlazorWebAssembly,
HostHttpApi
};
}
if (packageType == HttpApiClient)
{
return new List<string>()
{
HostMvc,
HostBlazorServer,
HostBlazorWebAssembly,
HostHttpApi
};
}
if (packageType == Mvc)
{
return new List<string>()
{
HostMvc
};
}
if (packageType == Blazor)
{
return new List<string>()
{
BlazorServer,
BlazorWebAssembly
};
}
if (packageType == BlazorServer)
{
return new List<string>()
{
HostBlazorServer
};
}
if (packageType == BlazorWebAssembly)
{
return new List<string>()
{
HostBlazorWebAssembly
};
}
if (packageType == Test)
{
return new List<string>()
{
Test
};
}
return new List<string>();
}
} }
} }

Loading…
Cancel
Save