Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Zip content. #1

Merged
merged 2 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sdk/Sdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<PackageReference Include="Skyline.DataMiner.CICD.Common" Version="1.0.5-alpha" PrivateAssets="all" />
<PackageReference Include="Skyline.DataMiner.CICD.Parsers.Common" Version="1.0.13-foxtrot" PrivateAssets="all" />
<PackageReference Include="Skyline.DataMiner.CICD.Assemblers.Automation" Version="1.0.16-alpha" PrivateAssets="all" />
<PackageReference Include="Skyline.DataMiner.Core.AppPackageCreator" Version="1.0.4" PrivateAssets="all" />
<PackageReference Include="Skyline.DataMiner.Core.AppPackageCreator" Version="2.0.0-alpha2" PrivateAssets="all" />
<PackageReference Include="System.Text.Json" Version="9.0.0" PrivateAssets="all" />
</ItemGroup>

Expand Down
24 changes: 16 additions & 8 deletions Sdk/Tasks/DmappCreation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public override bool Execute()
// Relative path (starting from project directory
baseLocation = FileSystem.Instance.Path.GetFullPath(FileSystem.Instance.Path.Combine(preparedData.Project.ProjectDirectory, BaseOutputPath));
}

string destinationFilePath = FileSystem.Instance.Path.Combine(baseLocation, Configuration, $"{PackageId}.{PackageVersion}.dmapp");

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

// TODO: Handle catalog references

Log.LogWarning($"Not supported yet: {catalogReferencesFile} could not be added to the package.");
}

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

// Include LowCodeApps
string lowCodeAppDirectory =
FileSystem.Instance.Path.Combine(packageContentPath, "LowCodeApps");
foreach (string lcaZip in FileSystem.Instance.Directory.GetFiles(lowCodeAppDirectory, "*.zip"))
IncludeFromPackageContent(appPackageBuilder, packageContentPath, "LowCodeApps", ZipType.LowCodeApp);

// Include Dashboards
IncludeFromPackageContent(appPackageBuilder, packageContentPath, "Dashboards", ZipType.Dashboard);
}

private void IncludeFromPackageContent(AppPackage.AppPackageBuilder appPackageBuilder, string packageContentPath, string contentFolderName, ZipType contentType)
{
string directory =
FileSystem.Instance.Path.Combine(packageContentPath, contentFolderName);

foreach (string zipFile in FileSystem.Instance.Directory.GetFiles(directory, "*.zip"))
{
Log.LogWarning($"Not supported yet: {lcaZip} could not be added to the package.");
// TODO: Handle zip LCA's
//appPackageBuilder.WithLowCodeApp(lcaZip);
appPackageBuilder.WithZip(zipFile, contentType);
Log.LogMessage($"Added {contentType}: {zipFile}");
}
}

Expand Down