diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 795b936..cfb1443 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -30,13 +30,13 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v5 with: - dotnet-version: '9.0.x' + dotnet-version: '10.0.x' cache: true cache-dependency-path: ${{ github.workspace }}/premake-manager-cli - name: Installing premake5 uses: Jarod42/install-premake5@v6 - name: run premake5 - run: premake5 vs2022 + run: premake5 vs2026 - name: Install dependencies run: dotnet restore ${{ github.workspace }} diff --git a/premake-manager-cli/src/common-index/CommonIndex.cs b/premake-manager-cli/src/common-index/CommonIndex.cs index 96ad9fc..f272af9 100644 --- a/premake-manager-cli/src/common-index/CommonIndex.cs +++ b/premake-manager-cli/src/common-index/CommonIndex.cs @@ -40,12 +40,12 @@ public static void WriteFileIndex(IndexView index, string filePath = "premakeInd public static MemoryStream? ReadLibraryFile(IndexView index, GithubRepo repo) { - if (index.libraries.TryGetValue(repo.owner, out IList? libraries)) + if (index.libraries.TryGetValue(repo.owner.ToLower(), out IList? libraries)) { - if (null == libraries.Where((lib) => lib.name == repo.name).FirstOrDefault()) + if (null == libraries.Where((lib) => lib.name.ToLower() == repo.name.ToLower()).FirstOrDefault()) return null; GithubRepo remote = Github.GetRepoFromLink(index.remote); - return ExtractUtils.ReadFile(PathUtils.GetRemotePath(remote.owner, remote.name), $"{repo}-main/libraries/{repo.owner}/{repo.name}/premake5.lua".ToLower()); + return ExtractUtils.ReadFile(PathUtils.GetRemotePath(remote.owner, remote.name), $"{remote.name}-main/libraries/{repo.owner}/{repo.name}/premake5.lua".ToLower()); } return null; //could not find library. } @@ -73,7 +73,7 @@ public static async Task ExtractLibraryFile(IndexView index, GithubRepo re MemoryStream? stream = ReadLibraryFile(index, repo); if (stream == null) return false; - using (FileStream libraryFile = File.OpenWrite(await LibraryManager.GetLibraryPath(repo))) + using (FileStream libraryFile = File.OpenWrite(Path.Combine((await LibraryManager.GetLibraryPath(repo)).ToLower(), "premake5.lua"))) { stream.WriteTo(libraryFile); } diff --git a/premake-manager-cli/src/libraries/LibraryManager.cs b/premake-manager-cli/src/libraries/LibraryManager.cs index 8519508..82b70c0 100644 --- a/premake-manager-cli/src/libraries/LibraryManager.cs +++ b/premake-manager-cli/src/libraries/LibraryManager.cs @@ -104,7 +104,7 @@ public static async Task InstallLibraryCtx(ProgressContext ctx, string githubLin string downloadUrl = await ResolveDownloadUrl(repo, version); await DownloadUtils.DownloadProgressCtx(ctx, downloadUrl, $"downloading {libconfig.name} library", Path.Combine(PathUtils.GetTempModulePath(repo.name), $"{repo.name}.zip")); - await ExtractUtils.ExtractZipProgressCtx(ctx, Path.Combine(PathUtils.GetTempModulePath(repo.name), $"{repo.name}.zip"), await GetLibraryPath(repo), $"extracting {libconfig.name}"); + await ExtractUtils.ExtractZipProgressCtx(ctx, Path.Combine(PathUtils.GetTempModulePath(repo.name), $"{repo.name}.zip"), (await GetLibraryPath(repo)).ToLower(), $"extracting {libconfig.name}"); await RemotesManager.InstallRemotesLibrary(repo); } diff --git a/premake-manager-cli/src/main.cs b/premake-manager-cli/src/main.cs index 8c7e06f..ae404f5 100644 --- a/premake-manager-cli/src/main.cs +++ b/premake-manager-cli/src/main.cs @@ -15,7 +15,6 @@ public class main { static async Task Main(string[] args) { - string sessionToken = ""; #if DEBUG bool interactive = true; #else @@ -27,14 +26,6 @@ static async Task Main(string[] args) { interactive = true; } - if (arg.StartsWith("--session=")) - { - // Extracts the part after "--session=" - sessionToken = arg.Substring("--session=".Length).Trim('"'); - await Github.SetSession(sessionToken); - - } - } diff --git a/premake-manager-cli/src/utils/ExtractUtils.cs b/premake-manager-cli/src/utils/ExtractUtils.cs index 715c538..e447cb5 100644 --- a/premake-manager-cli/src/utils/ExtractUtils.cs +++ b/premake-manager-cli/src/utils/ExtractUtils.cs @@ -111,6 +111,7 @@ await AnsiConsole.Progress() public static async Task ExtractZipProgressCtx(ProgressContext ctx, string sourcePath, string destinationExtractDirectory, string description, bool deleteSource = true) { + ProgressTask extractTask = ctx.AddTask($"[green]{description}[/]"); ProgressTaskSettings settings = new(); diff --git a/premake-manager-cli/src/utils/PremakeSystem.cs b/premake-manager-cli/src/utils/PremakeSystem.cs index 06b446e..9af15f9 100644 --- a/premake-manager-cli/src/utils/PremakeSystem.cs +++ b/premake-manager-cli/src/utils/PremakeSystem.cs @@ -24,6 +24,8 @@ public static void Write(Config config, PremakeLibrary[] libraries, PremakeModul AddPath(config.LibrariesPath,"libraries"); AddLibs(libraries); AddModules(modules); + AddIncludeDirsSetFunction(); + AddIncludeDirs(); File.WriteAllText("premake-system.lua", string.Join("\n", content)); } static void AddDisclaimer() @@ -76,5 +78,22 @@ static void AddModulesEnd() { content.Add($"}}"); } + static void AddIncludeDirsSetFunction() + { + content.Add(@" +---INCLUDE_DIRS--- +local function setincludedirs(name, path) + IncludeDirs = IncludeDirs or {} + local cleanName = string.gsub(name, ""-"", ""_"") + IncludeDirs[cleanName] = _SCRIPT_DIR .. ""/"" .. path +end +"); + + content.Add("_G.setincludedirs = setincludedirs"); + } + static void AddIncludeDirs() + { + content.Add("_G.IncludeDirs = {}"); + } } }