Skip to content

Commit

Permalink
Fix FileGlob recursive dir bloating
Browse files Browse the repository at this point in the history
  • Loading branch information
nirbar committed Dec 4, 2024
1 parent f1e60f0 commit 43f8f64
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/github-actions-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
psw_wix_version:
description: 'PanelSwWix4 version'
required: true
default: 5.0.0-psw-wix.0324-60
default: 5.0.0-psw-wix.0346-64
type: string

jobs:
Expand All @@ -37,7 +37,7 @@ jobs:
Add-Content -Path ${{ github.env }} -Value "PSW_WIX_VERSION=${{ env.DEFAULT_PSW_WIX_VERSION }}"
}
env:
DEFAULT_PSW_WIX_VERSION: '5.0.0-psw-wix.0324-60'
DEFAULT_PSW_WIX_VERSION: '5.0.0-psw-wix.0346-64'

- name: Prepare for build
run: |
Expand Down
4 changes: 2 additions & 2 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<Wix4Version Condition=" '$(Wix4Version)' == '' ">4.0.5</Wix4Version>
<PanelSwWix4Version Condition=" '$(PanelSwWix4Version)' == '' ">5.0.0-psw-wix.0324-60</PanelSwWix4Version>
<Wix4Version Condition=" '$(Wix4Version)' == '' ">4.0.6</Wix4Version>
<PanelSwWix4Version Condition=" '$(PanelSwWix4Version)' == '' ">5.0.0-psw-wix.0346-64</PanelSwWix4Version>
<SevenZapVersion Condition=" '$(SevenZapVersion)' == '' ">24.8.41</SevenZapVersion>
</PropertyGroup>
<ItemGroup>
Expand Down
9 changes: 5 additions & 4 deletions src/PanelSwWixExtension/PanelSwWixCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,7 @@ private void ExecuteFileGlob(IntermediateSection section, SourceLineNumber sourc
{
string fullPath = Path.Combine(baseDir, filePattern.Path);
fullPath = Path.GetFullPath(fullPath);
string subdirId = directoryId;

string recursiveDir = Path.GetDirectoryName(filePattern.Path);

Expand All @@ -1253,14 +1254,14 @@ private void ExecuteFileGlob(IntermediateSection section, SourceLineNumber sourc
{
if (!string.IsNullOrEmpty(recursiveDir))
{
directoryId = ParseHelper.CreateDirectoryReferenceFromInlineSyntax(section, sourceLineNumbers, null, directoryId, recursiveDir, sectionCachedInlinedDirectoryIds);
subdirId = ParseHelper.CreateDirectoryReferenceFromInlineSyntax(section, sourceLineNumbers, null, directoryId, recursiveDir, sectionCachedInlinedDirectoryIds);
}
Identifier id = ParseHelper.CreateIdentifier("glb", directoryId, Path.GetFileName(fullPath));
Identifier id = ParseHelper.CreateIdentifier("glb", subdirId, Path.GetFileName(fullPath));

section.AddSymbol(new ComponentSymbol(sourceLineNumbers, id)
{
ComponentId = "*",
DirectoryRef = directoryId,
DirectoryRef = subdirId,
KeyPath = id.Id,
KeyPathType = ComponentKeyPathType.File,
Location = ComponentLocation.LocalOnly,
Expand All @@ -1272,7 +1273,7 @@ private void ExecuteFileGlob(IntermediateSection section, SourceLineNumber sourc
Source = new IntermediateFieldPathValue() { Path = fullPath },
Name = Path.GetFileName(fullPath),
ComponentRef = id.Id,
DirectoryRef = directoryId,
DirectoryRef = subdirId,
Attributes = FileSymbolAttributes.None | FileSymbolAttributes.Vital,
});
if (!string.IsNullOrEmpty(componentGroup_))
Expand Down
2 changes: 1 addition & 1 deletion src/TidyBuild.custom.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)TidyBuild.user.props" Condition="Exists('$(MSBuildThisFileDirectory)TidyBuild.user.props')"/>
<PropertyGroup>
<FullVersion>3.22.2</FullVersion>
<FullVersion>3.22.3</FullVersion>
<FullVersion Condition=" '$(GITHUB_RUN_NUMBER)'!='' ">$(FullVersion).$(GITHUB_RUN_NUMBER)</FullVersion>
<ProductName>PanelSwWixExtension</ProductName>
<Manufacturer>Panel::Software</Manufacturer>
Expand Down
4 changes: 2 additions & 2 deletions src/global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"msbuild-sdks": {
"WixToolset.Sdk": "4.0.5",
"PanelSwWix4.Sdk": "5.0.0-psw-wix.0324-60",
"WixToolset.Sdk": "4.0.6",
"PanelSwWix4.Sdk": "5.0.0-psw-wix.0346-64",
"Microsoft.Build.Traversal": "4.0.0"
}
}

0 comments on commit 43f8f64

Please sign in to comment.