-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Moved SDK to eavframework repository.
To avoid circel references of external packates Testing if it will package submodule.
- Loading branch information
1 parent
3942c8d
commit 94ffba2
Showing
22 changed files
with
230 additions
and
1,350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "external/EAVFW.Extensions.CommandLine"] | ||
path = external/EAVFW.Extensions.CommandLine | ||
url = https://github.com/EAVFW/EAVFW.Extensions.CommandLine.git | ||
[submodule "external/EAVFramework"] | ||
path = external/EAVFramework | ||
url = https://github.com/EAVFW/EAVFramework.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<LangVersion>9.0</LangVersion> | ||
<EAVFrameworkVersion>4.0.2</EAVFrameworkVersion> | ||
<UseEAVFromNuget>true</UseEAVFromNuget> | ||
<LocalEAVFrameworkPath>$(MSBuildThisFileDirectory)/external/EAVFramework</LocalEAVFrameworkPath> | ||
<LocalExternalpath>$(MSBuildThisFileDirectory)/external</LocalExternalpath> | ||
<ManifestSDKPath>$(MSBuildThisFileDirectory)</ManifestSDKPath> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule EAVFW.Extensions.CommandLine
added at
e4ebad
Submodule EAVFramework
added at
65e40e
143 changes: 143 additions & 0 deletions
143
src/EAVFW.Extensions.Manifest.ManifestEnricherTool/Commands/GPT/GPTCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
using LibGit2Sharp; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using System; | ||
using System.CommandLine; | ||
using System.CommandLine.Parsing; | ||
using System.ComponentModel; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace EAVFW.Extensions.Manifest.ManifestEnricherTool.Commands.GPT | ||
{ | ||
public class GPTReviewPrCommand : Command | ||
{ | ||
|
||
[Alias("--project")] | ||
[Description("The project path to EAV Model Project")] | ||
public string Project { get; set; } | ||
|
||
[Alias("--pr")] | ||
[Description("The project path to EAV Model Project")] | ||
public string PR { get; set; } | ||
|
||
|
||
public GPTReviewPrCommand() : base("pr", "Review a PR with Chat GPT") | ||
{ | ||
Handler = COmmandExtensions.Create(this, new Command[0], Run); | ||
} | ||
private async Task<int> Run(ParseResult parseResult, IConsole console) | ||
{ | ||
var name = Path.GetFileNameWithoutExtension(Project); | ||
var folder = Path.GetTempPath() + name; | ||
console.WriteLine(folder); | ||
if (Directory.Exists(folder)) | ||
{ | ||
setAttributesNormal(new DirectoryInfo(folder)); | ||
Directory.Delete(folder, true); | ||
|
||
|
||
} | ||
Directory.CreateDirectory(folder); | ||
var repoPath = LibGit2Sharp.Repository.Clone(Project, folder, new CloneOptions { Checkout = true, FetchOptions = new FetchOptions { } }); | ||
try | ||
{ | ||
console.WriteLine(repoPath); | ||
console.WriteLine(Project); | ||
|
||
using var repo = new Repository(repoPath); | ||
|
||
console.WriteLine("worktrees:"); | ||
console.WriteLine(string.Join("\n", repo.Worktrees.Select(c => c.Name))); | ||
|
||
console.WriteLine("Refs:"); | ||
console.WriteLine(string.Join("\n", repo.Refs.Select(c => c.CanonicalName))); | ||
console.WriteLine("Branches:"); | ||
console.WriteLine(string.Join("\n", repo.Branches.Select(c => c.CanonicalName))); | ||
|
||
string mergeIntoReleaseBranch = "refs/remotes/origin/master"; | ||
string branchToBeMerged = "refs/remotes/origin/tst/job-status"; | ||
TreeChanges treeChanges = repo.Diff.Compare<TreeChanges>(repo.Branches[mergeIntoReleaseBranch].Tip.Tree, repo.Branches[branchToBeMerged].Tip.Tree); | ||
|
||
console.WriteLine("Changes:"); | ||
|
||
Console.WriteLine(treeChanges.Count<TreeEntryChanges>()); | ||
console.WriteLine(string.Join("\n", treeChanges.Select(c => $"{c.Status.ToString()} {c.Path}\n{c.Mode}\n"))); | ||
} | ||
finally{ | ||
setAttributesNormal(new DirectoryInfo(folder)); | ||
Directory.Delete(folder, true); | ||
} | ||
|
||
|
||
|
||
void setAttributesNormal(DirectoryInfo dir) | ||
{ | ||
foreach (var subDir in dir.GetDirectories()) | ||
setAttributesNormal(subDir); | ||
foreach (var file in dir.GetFiles()) | ||
{ | ||
file.Attributes = FileAttributes.Normal; | ||
} | ||
} | ||
|
||
return 0; | ||
} | ||
} | ||
|
||
public class GPTReviewCommand : Command | ||
{ | ||
public GPTReviewCommand(GPTReviewPrCommand review) : base("review", "Chat GPT EAVFW Reviewer") | ||
{ | ||
Handler = COmmandExtensions.Create(this, new[] | ||
{ | ||
review | ||
}, Run); | ||
|
||
} | ||
private async Task<int> Run(ParseResult parseResult, IConsole console) | ||
{ | ||
return 0; | ||
} | ||
} | ||
public class GPTCommand : Command | ||
{ | ||
public GPTCommand(GPTReviewCommand review) : base("gpt", "ChatGPT EAVFW Developer") | ||
{ | ||
Handler = COmmandExtensions.Create(this, new[] | ||
{ | ||
review | ||
}, Run); | ||
} | ||
private async Task<int> Run(ParseResult parseResult, IConsole console) | ||
{ | ||
return 0; | ||
} | ||
|
||
} | ||
public static class GPTExtensions | ||
{ | ||
public static IServiceCollection AddGPT(this IServiceCollection services) | ||
{ | ||
services.AddSingleton<Command, GPTCommand>(); | ||
|
||
AddCommands(typeof(GPTCommand)); | ||
|
||
void AddCommands(Type type) | ||
{ | ||
foreach (var parameter in type.GetConstructors().First().GetParameters()) | ||
{ | ||
var parameterType = parameter.ParameterType; | ||
if (typeof(Command).IsAssignableFrom(parameterType)) | ||
{ | ||
services.AddSingleton(parameterType); | ||
|
||
AddCommands(parameterType); | ||
} | ||
} | ||
} | ||
|
||
return services; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/EAVFW.Extensions.Manifest.ManifestEnricherTool/Properties/launchSettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"profiles": { | ||
"EAVFW.Extensions.Manifest.ManifestEnricherTool": { | ||
"commandName": "Project", | ||
"workingDirectory": "C:\\dev\\hafnia\\loi", | ||
//"workingDirectory": "C:\\dev\\kfst_vanddata", | ||
//"commandLineArgs": "--path c:\\dev\\kfst_vanddata\\apps\\KFST.Vanddata.ManagementPortal\\manifest.json --customizationprefix kfst", | ||
//"commandLineArgs": "install EAVFW.Extensions.SecurityModel", | ||
//"commandLineArgs": "sql C:/dev/eavfwdemo/src/EAVApp.Models" | ||
|
||
//"commandLineArgs": "sql C:/dev/kfst_vanddata/apps/KFST.Vanddata.ManagementPortal/" | ||
|
||
//"commandLineArgs": "manifest fix-migration --project-path c:\\dev\\kfst_vanddata\\apps\\KFST.Vanddata.ManagementPortal -v 1.0.45 --schema KFST --prefix KFST --database VandData2" | ||
|
||
// "commandLineArgs": "--path C:\\dev\\MedlemsCentralen\\src\\MC.Models\\manifest.json --customizationprefix MC" | ||
|
||
// "commandLineArgs": "sql ./src/Hafnia.Models", | ||
"commandLineArgs": "gpt review pr --project https://github.com/delegateas/WorkflowEngine.git --pr 15" | ||
// "commandLineArgs": "sql ./apps/KFST.Vanddata.ManagementPortal" | ||
//"commandLineArgs": "--path C:\\dev\\hafnia\\loi\\src\\Hafnia.Models\\manifest.json --customizationprefix hafnia" | ||
} | ||
} | ||
} |
34 changes: 0 additions & 34 deletions
34
src/EAVFW.Extensions.Manifest.SDK/DefaultManifestPathExtracter.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.