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

Implemented vanilla pack #6

Merged
merged 63 commits into from
Feb 20, 2024
Merged

Implemented vanilla pack #6

merged 63 commits into from
Feb 20, 2024

Conversation

ahuca
Copy link
Owner

@ahuca ahuca commented Dec 28, 2023

close #5 .

- Added `IPlcProject`, `ITwincatProject`, and `IAutomationInterface`
- Added `README` with a brief description
Refactor code to use the newly added generic deserializing method for less code duplications when deserializing project files.
…oject

Updated all projects to .NET 8 for consistency.
- Including `PlcProjectBelongToSolution()` and `IsTwincatProjectFileExtension()`
- Resolving the appsettings.json absolution path
It used to be under `TwinGet.AutomationInterface.Test` project.
- Fixed namespace for `PackCommandValidatorTests.cs`
- Added docs to `Test.Utils`
Using `Directory.EnumerateFiles()` instead of `Directory.GetFiles()`
DTO classes need not be tested.
Added more logging information during packaging.
When a solution is provided, we validate whether the file exists.
In `PackageService.PackFromProjectFileAsync()`.
- In case for IPackCommand is propagated, we don't really want any side-effects from changing the its members.
- Also added some functions for safe execute in `Thread` to `PackageService.cs`. For instance, `SafeExecute` and `SafeExecuteAsync`.
- By separating some logics to `ProjectFileUtils` folder/namespace
`PackageService` now uses that instead of `Thread`
Added try-catch block for `PackFromProjectFileAsync` when saving PLC project as library so we can return gracefully.
With `LogWith` method for logging a `PackagingException` given an `ILogger`
The use of ThreadLocal with `AutomationInterface` is not good.
`IsManagedLibrary` extracted to a extension method in `PlcProjectMetadataExtensions`
- Renamed methods to match the strategy pattern
- Removed `DoCustomValidation` as the parameters used to initialize a strategy should have been validated
@ahuca ahuca changed the title 5 implement vanilla pack Implemented vanilla pack Jan 7, 2024
common.ps1 Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to add a small comment at the start of file on what the file does? Starting to get crowded with .ps1 files

Copy link
Owner Author

@ahuca ahuca Jan 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For which files do you mean? ps1 files?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn you're right GitHub review is quite confusing. Completely missed the small little common.ps1

image

@Colho
Copy link
Collaborator

Colho commented Feb 18, 2024

There were a couple of Exceptions without the Exception suffix, decided its better to make a one comment about it rather than ping it on each file separately.

{
#pragma warning disable CS8604 // Possible null reference argument.
plcProjects.AddRange(
from ProjectElement project in tcSmProject.Project.Plc.Projects
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel like this could be LINQed somewhere in the future

@ahuca ahuca merged commit 282ba67 into main Feb 20, 2024
2 checks passed
@ahuca ahuca deleted the 5-implement-vanilla-pack branch February 20, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Implement vanilla pack
2 participants