mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Added UnversionedLibDir to config
This commit is contained in:
parent
d48d03c58b
commit
f258b4a25b
8 changed files with 81 additions and 39 deletions
19
IDE/dist/BeefConfig.toml
vendored
19
IDE/dist/BeefConfig.toml
vendored
|
@ -1,19 +1,6 @@
|
|||
Version = 1
|
||||
UnversionedLibDirs = ["../../BeefLibs"]
|
||||
|
||||
[Registry.minlib]
|
||||
Version = "1.0.0"
|
||||
Location = { Path = "../mintest/minlib" }
|
||||
|
||||
[Registry.corlib]
|
||||
Version = "1.0.0"
|
||||
Location = { Path = "../../BeefLibs/corlib" }
|
||||
|
||||
[Registry.Beefy2D]
|
||||
Version = "1.0.0"
|
||||
Location = { Path = "../../BeefLibs/Beefy2D" }
|
||||
|
||||
[Registry.SDL2]
|
||||
Version = "1.0.0"
|
||||
Location = { Path = "../../BeefLibs/SDL2" }
|
||||
|
||||
[Registry.MiniZ]
|
||||
Version = "1.0.0"
|
||||
Location = { Path = "../../BeefLibs/MiniZ" }
|
8
IDE/dist/BeefConfig_host.toml
vendored
8
IDE/dist/BeefConfig_host.toml
vendored
|
@ -1,8 +1,6 @@
|
|||
Version = 1
|
||||
UnversionedLibDirs = ["../../../BeefLibs"]
|
||||
|
||||
[Registry.minlib]
|
||||
Version = "1.0.0"
|
||||
Location = { Path = "../../mintest/minlib" }
|
||||
|
||||
[Registry.corlib]
|
||||
Version = "1.0.0"
|
||||
Location = { Path = "../../../BeefLibs/corlib" }
|
||||
|
||||
|
|
17
IDE/dist/BeefConfig_install.toml
vendored
17
IDE/dist/BeefConfig_install.toml
vendored
|
@ -1,15 +1,2 @@
|
|||
[Registry.corlib]
|
||||
Version = "1.0.0"
|
||||
Location = { Path = "../BeefLibs/corlib" }
|
||||
|
||||
[Registry.SDL2]
|
||||
Version = "1.0.0"
|
||||
Location = { Path = "../BeefLibs/SDL2" }
|
||||
|
||||
[Registry.MiniZ]
|
||||
Version = "1.0.0"
|
||||
Location = { Path = "../BeefLibs/MiniZ" }
|
||||
|
||||
[Registry.Beefy2D]
|
||||
Version = "1.0.0"
|
||||
Location = { Path = "../BeefLibs/Beefy2D" }
|
||||
Version = 1
|
||||
UnversionedLibDirs = ["../BeefLibs"]
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace IDE
|
|||
regEntry.mLocation.Parse(data).IgnoreError();
|
||||
}
|
||||
|
||||
for (data.Enumerate("LibDirs"))
|
||||
for (data.Enumerate("UnversionedLibDirs"))
|
||||
{
|
||||
String dirStr = scope .();
|
||||
data.GetCurString(dirStr);
|
||||
|
@ -74,6 +74,39 @@ namespace IDE
|
|||
libDir.mPath = new String(dirStr);
|
||||
libDir.mConfigFile = configFile;
|
||||
mLibDirectories.Add(libDir);
|
||||
|
||||
String absPath = scope .();
|
||||
Path.GetAbsolutePath(libDir.mPath, configFile.mConfigDir, absPath);
|
||||
|
||||
for (var entry in Directory.EnumerateDirectories(absPath))
|
||||
{
|
||||
String projName = scope .();
|
||||
entry.GetFileName(projName);
|
||||
|
||||
String filePath = scope .();
|
||||
entry.GetFilePath(filePath);
|
||||
|
||||
String projFilePath = scope .();
|
||||
projFilePath.Concat(filePath, "/BeefProj.toml");
|
||||
|
||||
if (File.Exists(projFilePath))
|
||||
{
|
||||
RegistryEntry regEntry = new RegistryEntry();
|
||||
regEntry.mProjName = new String(projName);
|
||||
mRegistry.Add(regEntry);
|
||||
|
||||
regEntry.mConfigFile = configFile;
|
||||
|
||||
var verString = scope String();
|
||||
data.GetString("Version", verString);
|
||||
regEntry.mVersion = new SemVer();
|
||||
regEntry.mVersion.Parse("0.0.0");
|
||||
|
||||
regEntry.mLocation = new VerSpecRecord();
|
||||
using (data.Open("Location"))
|
||||
regEntry.mLocation.SetPath(filePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,6 +115,11 @@ namespace IDE
|
|||
return .Ok;
|
||||
}
|
||||
|
||||
public void Refresh()
|
||||
{
|
||||
Load().IgnoreError();
|
||||
}
|
||||
|
||||
public void QueuePaths(StringView topLevelDir)
|
||||
{
|
||||
let dir = scope String(topLevelDir);
|
||||
|
@ -96,7 +134,7 @@ namespace IDE
|
|||
if (File.Exists(path))
|
||||
{
|
||||
if (mConfigPathQueue.Contains(path))
|
||||
break; // We have this and everthing under it already
|
||||
break; // We have this and everything under it already
|
||||
mConfigPathQueue.Add(new String(path));
|
||||
}
|
||||
|
||||
|
@ -116,6 +154,9 @@ namespace IDE
|
|||
|
||||
public Result<void> Load()
|
||||
{
|
||||
ClearAndDeleteItems(mRegistry);
|
||||
ClearAndDeleteItems(mConfigFiles);
|
||||
|
||||
for (int i = mConfigPathQueue.Count - 1; i >= 0; i--)
|
||||
{
|
||||
let path = mConfigPathQueue[i];
|
||||
|
|
|
@ -2225,6 +2225,8 @@ namespace IDE
|
|||
|
||||
if (StructuredLoad(data, workspaceFileName) case .Err(let err))
|
||||
{
|
||||
mBeefConfig.Refresh();
|
||||
|
||||
switch (err)
|
||||
{
|
||||
case .FormatError(int lineNum):
|
||||
|
|
|
@ -1762,6 +1762,30 @@ namespace IDE
|
|||
}
|
||||
}
|
||||
|
||||
[IDECommand]
|
||||
public void AssertIsAtColumn(String fileName, int column)
|
||||
{
|
||||
String filePath = scope String();
|
||||
FixSrcPath(fileName, filePath);
|
||||
|
||||
var sourceViewPanel = GetActiveSourceViewPanel();
|
||||
if (sourceViewPanel == null)
|
||||
return;
|
||||
|
||||
if (!Path.Equals(filePath, sourceViewPanel.mFilePath))
|
||||
{
|
||||
ScriptManager.sActiveManager.Fail("Expected source file '{0}', got '{1}'", filePath, sourceViewPanel.mFilePath);
|
||||
return;
|
||||
}
|
||||
|
||||
let atColumn = sourceViewPanel.mEditWidget.mEditWidgetContent.CursorLineAndColumn.mColumn + 1;
|
||||
if (atColumn != column)
|
||||
{
|
||||
ScriptManager.sActiveManager.Fail("Expected column '{0}', got '{1}'", column, atColumn);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
[IDECommand]
|
||||
public void GotoTextSkip(String findText, int skipIdx)
|
||||
{
|
||||
|
|
|
@ -1291,7 +1291,7 @@ namespace IDE.ui
|
|||
projectsReferenced.Add(selectedProjectItem.mProject);
|
||||
folderCount++;
|
||||
}
|
||||
else if (selectedProjectItem is ProjectItem)
|
||||
else
|
||||
{
|
||||
projectsReferenced.Add(selectedProjectItem.mProject);
|
||||
fileCount++;
|
||||
|
@ -1749,6 +1749,8 @@ namespace IDE.ui
|
|||
void ImportProject()
|
||||
{
|
||||
#if !CLI
|
||||
gApp.mBeefConfig.Refresh();
|
||||
|
||||
var fileDialog = scope OpenFileDialog();
|
||||
fileDialog.ShowReadOnly = false;
|
||||
fileDialog.Title = "Import Project";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue