Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"AXSharp.ixc": {
"version": "0.14.2-alpha.133",
"version": "0.14.2-alpha.134",
"commands": [
"ixc"
]
Expand All @@ -15,13 +15,13 @@
]
},
"AXSharp.ixd": {
"version": "0.14.2-alpha.133",
"version": "0.14.2-alpha.134",
"commands": [
"ixd"
]
},
"AXSharp.ixr": {
"version": "0.14.2-alpha.133",
"version": "0.14.2-alpha.134",
"commands": [
"ixr"
]
Expand Down
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mode: ContinuousDeployment
next-version: 0.2.0
next-version: 0.2.1
branches:
main:
regex: ^master$|^main$
Expand Down
164 changes: 91 additions & 73 deletions cake/ApaxCmd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,20 @@ public static class ApaxCmd
{
public static void ApaxInstall(this BuildContext context, (string folder, string name) lib)
{
var apaxArguments = context.BuildParameters.DoApaxInstallReDownload ? "install -L -r" : "install -L";

context.Log.Information($"apax install started for '{lib.folder} : {lib.name}'");
context.ProcessRunner.Start(Helpers.GetApaxCommand(), new ProcessSettings()
foreach (var folder in context.GetAxFolders(lib))
{
Arguments = "install -L",
WorkingDirectory = context.GetAxFolder(lib),
RedirectStandardOutput = false,
RedirectStandardError = false,
Silent = false
}).WaitForExit();
var apaxArguments = context.BuildParameters.DoApaxInstallReDownload ? "install -L -r" : "install -L";

context.Log.Information($"apax install started for '{lib.folder} : {lib.name}'");
context.ProcessRunner.Start(Helpers.GetApaxCommand(), new ProcessSettings()
{
Arguments = apaxArguments,
WorkingDirectory = folder,
RedirectStandardOutput = false,
RedirectStandardError = false,
Silent = false
}).WaitForExit();
}
}

public static void ApaxInstall(this BuildContext context, (string folder, string name, string targetIp, string targetPlatform) app)
Expand All @@ -40,15 +43,18 @@ public static void ApaxInstall(this BuildContext context, (string folder, string

public static void ApaxClean(this BuildContext context, (string folder, string name) lib)
{
context.ProcessRunner.Start(Helpers.GetApaxCommand(), new ProcessSettings()
foreach (var folder in context.GetAxFolders(lib))
{
Arguments = "clean",
WorkingDirectory = context.GetAxFolder(lib),
RedirectStandardOutput = false,
RedirectStandardError = false,
Silent = false
}).WaitForExit();
context.Log.Information($"apax clean finished for '{lib.folder} : {lib.name}'");
context.ProcessRunner.Start(Helpers.GetApaxCommand(), new ProcessSettings()
{
Arguments = "clean",
WorkingDirectory = folder,
RedirectStandardOutput = false,
RedirectStandardError = false,
Silent = false
}).WaitForExit();
context.Log.Information($"apax clean finished for '{lib.folder} : {lib.name}'");
}
}

public static void ApaxClean(this BuildContext context, (string folder, string name, string targetIp, string targetPlatform) app)
Expand All @@ -58,23 +64,26 @@ public static void ApaxClean(this BuildContext context, (string folder, string n

public static void ApaxBuild(this BuildContext context, (string folder, string name) lib)
{
context.Log.Information($"apax build started for '{lib.folder} : {lib.name}'");
var process = context.ProcessRunner.Start(Helpers.GetApaxCommand(), new ProcessSettings()
foreach (var folder in context.GetAxFolders(lib))
{
Arguments = "build",
WorkingDirectory = context.GetAxFolder(lib),
RedirectStandardOutput = false,
RedirectStandardError = false,
Silent = false
});
context.Log.Information($"apax build started for '{lib.folder} : {lib.name}'");
var process = context.ProcessRunner.Start(Helpers.GetApaxCommand(), new ProcessSettings()
{
Arguments = "build",
WorkingDirectory = folder,
RedirectStandardOutput = false,
RedirectStandardError = false,
Silent = false
});

process.WaitForExit();
var exitcode = process.GetExitCode();
context.Log.Information($"apax build exited with '{exitcode}'");
process.WaitForExit();
var exitcode = process.GetExitCode();
context.Log.Information($"apax build exited with '{exitcode}'");

if (exitcode != 0)
{
throw new BuildFailedException();
if (exitcode != 0)
{
throw new BuildFailedException();
}
}
}

Expand All @@ -83,25 +92,33 @@ public static void ApaxBuild(this BuildContext context, (string folder, string n
context.ApaxBuild((app.folder, app.name));
}

public static void ApaxIxc(this BuildContext context, (string folder, string name, string targetIp, string targetPlatform) app)
{
context.ApaxIxc((app.folder, app.name));
}

public static void ApaxUpdate(this BuildContext context, (string folder, string name) lib)
{
context.Log.Information($"apax update started for '{lib.folder} : {lib.name}'");
var process = context.ProcessRunner.Start(Helpers.GetApaxCommand(), new ProcessSettings()
foreach (var folder in context.GetAxFolders(lib))
{
Arguments = "update --all",
WorkingDirectory = context.GetAxFolder(lib),
RedirectStandardOutput = false,
RedirectStandardError = false,
Silent = false
});
context.Log.Information($"apax update started for '{lib.folder} : {lib.name}'");
var process = context.ProcessRunner.Start(Helpers.GetApaxCommand(), new ProcessSettings()
{
Arguments = "update --all",
WorkingDirectory = folder,
RedirectStandardOutput = false,
RedirectStandardError = false,
Silent = false
});

process.WaitForExit();
var exitcode = process.GetExitCode();
context.Log.Information($"apax update exited with '{exitcode}'");
process.WaitForExit();
var exitcode = process.GetExitCode();
context.Log.Information($"apax update exited with '{exitcode}'");

if (exitcode != 0)
{
throw new BuildFailedException();
if (exitcode != 0)
{
throw new BuildFailedException();
}
}
}

Expand All @@ -115,7 +132,7 @@ public static void ApaxPack(this BuildContext context, (string folder, string na
context.ProcessRunner.Start(Helpers.GetApaxCommand(), new ProcessSettings()
{
Arguments = "pack",
WorkingDirectory = context.GetAxFolder(lib),
WorkingDirectory = context.GetLibFolder(lib),
RedirectStandardOutput = false,
RedirectStandardError = false,
Silent = false
Expand All @@ -124,28 +141,26 @@ public static void ApaxPack(this BuildContext context, (string folder, string na

public static void ApaxTest(this BuildContext context, (string folder, string name) lib)
{
var process = context.ProcessRunner.Start(Helpers.GetApaxCommand(), new ProcessSettings()
foreach (var folder in context.GetAxFolders(lib))
{
Arguments = "test",
WorkingDirectory = context.GetAxFolder(lib),
RedirectStandardOutput = false,
RedirectStandardError = false,
Silent = false
});

process.WaitForExit();
var process = context.ProcessRunner.Start(Helpers.GetApaxCommand(), new ProcessSettings()
{
Arguments = "test",
WorkingDirectory = folder,
RedirectStandardOutput = false,
RedirectStandardError = false,
Silent = false
});

var exitcode = process.GetExitCode();
context.Log.Information($"apax test exited with '{exitcode}'");
process.WaitForExit();

foreach (var resultFile in Directory.EnumerateFiles(context.GetAxTestResultsFolder(context.GetAxFolder(lib)), "*.xml").Select(p => new FileInfo(p)))
{
File.Copy(resultFile.FullName, Path.Combine(context.TestResultsCtrl, $"controller_{lib.name}_{resultFile.Name}.xml"));
}
var exitcode = process.GetExitCode();
context.Log.Information($"apax test exited with '{exitcode}'");

if (exitcode != 0)
{
throw new TestFailedException();
if (exitcode != 0)
{
throw new TestFailedException();
}
}
}

Expand All @@ -156,14 +171,17 @@ public static void ApaxTest(this BuildContext context, (string folder, string na

public static void ApaxIxc(this BuildContext context, (string folder, string name) lib)
{
context.ProcessRunner.Start(Helpers.GetApaxCommand(), new ProcessSettings()
foreach (var folder in context.GetAxFolders(lib))
{
Arguments = "ixc",
WorkingDirectory = context.GetAxFolder(lib),
RedirectStandardOutput = false,
RedirectStandardError = false,
Silent = false
}).WaitForExit();
context.ProcessRunner.Start(Helpers.GetDotNetCommand(), new ProcessSettings()
{
Arguments = "ixc",
WorkingDirectory = folder,
RedirectStandardOutput = false,
RedirectStandardError = false,
Silent = false
}).WaitForExit();
}
}

public static void ApaxCopyArtifacts(this BuildContext context, (string folder, string name) lib)
Expand Down Expand Up @@ -212,7 +230,7 @@ public static void ApaxDownload(this BuildContext context,
var process = context.ProcessRunner.Start(Helpers.GetApaxCommand(), new ProcessSettings()
{
Arguments = $" sld -t {app.targetIp} -i {app.targetPlatform} --accept-security-disclaimer --default-server-interface -r",
WorkingDirectory = context.GetAxFolder(app),
WorkingDirectory = context.GetAppFolder(app),
RedirectStandardOutput = false,
RedirectStandardError = false,
Silent = false
Expand Down
30 changes: 27 additions & 3 deletions cake/BuildContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,26 +160,50 @@ public BuildContext(ICakeContext context, BuildParameters buildParameters)

public string GitHubToken { get; } = System.Environment.GetEnvironmentVariable("GH_TOKEN");

public string GetAxFolder((string folder, string name) library)
public IEnumerable<string> GetAxFolders((string folder, string name) library)
{
return new string[]
{
Path.Combine(Path.Combine(RootDir, library.folder), "ctrl"),
Path.Combine(Path.Combine(RootDir, library.folder), "app")
};
}

public string GetLibFolder((string folder, string name) library)
{
return Path.Combine(Path.Combine(RootDir, library.folder), "ctrl");
}

public string GetAppFolder((string folder, string name) library)
{
return Path.Combine(Path.Combine(RootDir, library.folder), "app");
}

public string GetAxTestResultsFolder(string axFolder)
{
return Path.Combine(axFolder, "testresult");
}

public string GetAxFolder((string folder, string name, string targetIp, string targetPlatform) app)
public IEnumerable<string> GetAxFolders((string folder, string name, string targetIp, string targetPlatform) app)
{
return GetAxFolders((app.folder, app.name));
}

public string GetAppFolder((string folder, string name, string targetIp, string targetPlatform) app)
{
return GetAxFolder((app.folder, app.name));
return GetAppFolder((app.folder, app.name));
}

public string GetApaxFile((string folder, string name) library)
{
return Path.Combine(Path.Combine(RootDir, library.folder), "ctrl", "apax.yml");
}

public string GetApaxFile(string folder, string sub)
{
return Path.Combine(Path.Combine(RootDir, folder), sub, "apax.yml");
}

public string GetApaxFile((string folder, string name, string targetIp, string targetPlatform) app)
{
return GetApaxFile((app.folder, app.name));
Expand Down
3 changes: 3 additions & 0 deletions cake/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public static string GetStcNameByPlatform()

public static string GetApaxCommand()
=> RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ? "apax" : "apax.cmd";

public static string GetDotNetCommand()
=> RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ? "dotnet" : "dotnet";
public static void CopyApaxPackages(string sourceDir, string destinationDir, string rootDir)
{

Expand Down
2 changes: 2 additions & 0 deletions cake/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public override void Run(BuildContext context)
{
context.UpdateApaxVersion(context.GetApaxFile(lib), GitVersionInformation.SemVer);
context.UpdateApaxDependencies(context.GetApaxFile(lib), context.Libraries.Select(p => context.GetApaxFile(p)), GitVersionInformation.SemVer);
context.UpdateApaxDependencies(context.GetApaxFile(lib.folder, "app"), context.Libraries.Select(p => context.GetApaxFile(p)), GitVersionInformation.SemVer);
});
}

Expand All @@ -146,6 +147,7 @@ public override void Run(BuildContext context)
{
context.UpdateApaxVersion(context.GetApaxFile(lib), GitVersionInformation.SemVer);
context.UpdateApaxDependencies(context.GetApaxFile(lib), context.Libraries.Select(p => context.GetApaxFile(p)), GitVersionInformation.SemVer);
context.UpdateApaxDependencies(context.GetApaxFile(lib.folder, "app"), context.Libraries.Select(p => context.GetApaxFile(p)), GitVersionInformation.SemVer);
});
}

Expand Down
17 changes: 17 additions & 0 deletions src/AXOpen.sln
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{3CE75CCD
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnetlibs_tests", "template.axolibrary\tests\dotnetlibs.Tests\dotnetlibs_tests.csproj", "{ADAF1255-8D10-4C83-B6D2-73347D677D15}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "app", "app", "{257570C0-7053-42FE-AC92-07294185A05C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "axopen_components_cognex_vision_integrations", "components.cognex.vision\app\ix\axopen_components_cognex_vision_integrations.csproj", "{B67B5F3E-4D9C-4C43-9022-D2A8C63CDDA2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "axopen_components_cognex_vision_integrations_blazor", "components.cognex.vision\app\ix-blazor\axopen_components_cognex_vision_integrations_blazor.csproj", "{AEF7D1B6-097D-42C5-A745-412F108F836D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -351,6 +357,14 @@ Global
{ADAF1255-8D10-4C83-B6D2-73347D677D15}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ADAF1255-8D10-4C83-B6D2-73347D677D15}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ADAF1255-8D10-4C83-B6D2-73347D677D15}.Release|Any CPU.Build.0 = Release|Any CPU
{B67B5F3E-4D9C-4C43-9022-D2A8C63CDDA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B67B5F3E-4D9C-4C43-9022-D2A8C63CDDA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B67B5F3E-4D9C-4C43-9022-D2A8C63CDDA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B67B5F3E-4D9C-4C43-9022-D2A8C63CDDA2}.Release|Any CPU.Build.0 = Release|Any CPU
{AEF7D1B6-097D-42C5-A745-412F108F836D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AEF7D1B6-097D-42C5-A745-412F108F836D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AEF7D1B6-097D-42C5-A745-412F108F836D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AEF7D1B6-097D-42C5-A745-412F108F836D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -424,6 +438,9 @@ Global
{F8D7E66F-3F2B-40EC-8CBB-C42B30D3AC9C} = {6CE1BA0C-BB5F-4105-A792-7CE352471827}
{3CE75CCD-E907-49F7-8871-D9AE0E47EB8F} = {6CE1BA0C-BB5F-4105-A792-7CE352471827}
{ADAF1255-8D10-4C83-B6D2-73347D677D15} = {3CE75CCD-E907-49F7-8871-D9AE0E47EB8F}
{257570C0-7053-42FE-AC92-07294185A05C} = {31669443-69E7-4D8F-9800-E71887684792}
{B67B5F3E-4D9C-4C43-9022-D2A8C63CDDA2} = {257570C0-7053-42FE-AC92-07294185A05C}
{AEF7D1B6-097D-42C5-A745-412F108F836D} = {257570C0-7053-42FE-AC92-07294185A05C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {292B45BE-E9CB-443B-979D-C0AFCD8D5675}
Expand Down
6 changes: 6 additions & 0 deletions src/abstractions/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.apax
.env
bin

obj
testresult
1 change: 1 addition & 0 deletions src/abstractions/app/AXSharp.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"OutputProjectFolder":"ix"}
Loading