1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-25 02:58:02 +02:00

Packman improvements

This commit is contained in:
Brian Fiete 2024-10-22 09:06:54 -04:00
parent 99aded7951
commit bc5c425d1b
4 changed files with 240 additions and 11 deletions

View file

@ -811,7 +811,26 @@ namespace IDE.ui
if (verSpecPtr == null)
{
if (verSpec case .Git(let url, let ver))
updateProjectLock = true;
{
bool matchesWorkspace = false;
for (var projectSpec in gApp.mWorkspace.mProjectSpecs)
{
if (projectSpec.mProjectName == projectName)
{
if (projectSpec.mVerSpec case .Git(let checkURL, let checkVer))
{
if ((checkURL == url) && (checkVer == ver))
matchesWorkspace = true;
}
}
}
if (!matchesWorkspace)
{
// This added new spec matches the workspace so we it doesn't affect any locking
updateProjectLock = true;
}
}
var dep = new Project.Dependency();
dep.mProjectName = new String(listViewItem.mLabel);

View file

@ -874,14 +874,40 @@ namespace IDE.ui
for (var projectSpec in gApp.mWorkspace.mProjectSpecs)
{
String bestConstraint = scope .();
String bestURL = scope .();
if (projectSpec.mProjectName == projectName)
{
if (projectSpec.mVerSpec case .Git(let url, let ver))
{
dependencyEntry.SetValue(1, url);
dependencyEntry.SetValue(2, ver.mVersion);
bestConstraint.Set(ver.mVersion);
bestURL.Set(url);
}
}
for (var project in gApp.mWorkspace.mProjects)
{
for (var dep in project.mDependencies)
{
if (dep.mVerSpec case .Git(let url, let ver))
{
if (bestURL.IsEmpty)
bestURL.Set(url);
else if (url != bestURL)
continue;
String highConstraint = scope .();
if ((ver.mVersion != null) && (SemVer.GetHighestConstraint(bestConstraint, ver.mVersion, highConstraint)))
{
bestConstraint.Set(highConstraint);
}
}
}
}
dependencyEntry.SetValue(1, bestURL);
dependencyEntry.SetValue(2, bestConstraint);
}
var propEntries = mPropPage.mPropEntries[listViewItem];
UpdatePropertyValue(propEntries);