Skip to content

Commit 5b90eb2

Browse files
Added support for Zip content.
1 parent 7c69e88 commit 5b90eb2

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

Sdk/Sdk.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<PackageReference Include="Skyline.DataMiner.CICD.Common" Version="1.0.5-alpha" PrivateAssets="all" />
4141
<PackageReference Include="Skyline.DataMiner.CICD.Parsers.Common" Version="1.0.13-foxtrot" PrivateAssets="all" />
4242
<PackageReference Include="Skyline.DataMiner.CICD.Assemblers.Automation" Version="1.0.16-alpha" PrivateAssets="all" />
43-
<PackageReference Include="Skyline.DataMiner.Core.AppPackageCreator" Version="1.0.4" PrivateAssets="all" />
43+
<PackageReference Include="Skyline.DataMiner.Core.AppPackageCreator" Version="2.0.0-alpha1" PrivateAssets="all" />
4444
<PackageReference Include="System.Text.Json" Version="9.0.0" PrivateAssets="all" />
4545
</ItemGroup>
4646

Sdk/Tasks/DmappCreation.cs

+16-8
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public override bool Execute()
105105
// Relative path (starting from project directory
106106
baseLocation = FileSystem.Instance.Path.GetFullPath(FileSystem.Instance.Path.Combine(preparedData.Project.ProjectDirectory, BaseOutputPath));
107107
}
108-
108+
109109
string destinationFilePath = FileSystem.Instance.Path.Combine(baseLocation, Configuration, $"{PackageId}.{PackageVersion}.dmapp");
110110

111111
// Create directories in case they don't exist yet
@@ -212,7 +212,7 @@ private void PackageCatalogReferences(PackageCreationData preparedData, AppPacka
212212
}
213213

214214
// TODO: Handle catalog references
215-
215+
216216
Log.LogWarning($"Not supported yet: {catalogReferencesFile} could not be added to the package.");
217217
}
218218

@@ -230,13 +230,21 @@ private void PackageBasicFiles(PackageCreationData preparedData, AppPackage.AppP
230230
appPackageBuilder.WithCompanionFiles(companionFilesDirectory);
231231

232232
// Include LowCodeApps
233-
string lowCodeAppDirectory =
234-
FileSystem.Instance.Path.Combine(packageContentPath, "LowCodeApps");
235-
foreach (string lcaZip in FileSystem.Instance.Directory.GetFiles(lowCodeAppDirectory, "*.zip"))
233+
IncludeFromPackageContent(appPackageBuilder, packageContentPath, "LowCodeApps", ZipType.LowCodeApp);
234+
235+
// Include Dashboards
236+
IncludeFromPackageContent(appPackageBuilder, packageContentPath, "Dashboards", ZipType.Dashboard);
237+
}
238+
239+
private void IncludeFromPackageContent(AppPackage.AppPackageBuilder appPackageBuilder, string packageContentPath, string contentFolderName, ZipType contentType)
240+
{
241+
string directory =
242+
FileSystem.Instance.Path.Combine(packageContentPath, contentFolderName);
243+
244+
foreach (string zipFile in FileSystem.Instance.Directory.GetFiles(directory, "*.zip"))
236245
{
237-
Log.LogWarning($"Not supported yet: {lcaZip} could not be added to the package.");
238-
// TODO: Handle zip LCA's
239-
//appPackageBuilder.WithLowCodeApp(lcaZip);
246+
appPackageBuilder.WithZip(zipFile, contentType);
247+
Log.LogWarning($"Added {contentType}: {zipFile}");
240248
}
241249
}
242250

0 commit comments

Comments
 (0)