Skip to content

Commit

Permalink
Tomas 2024 08 (#424)
Browse files Browse the repository at this point in the history
* wip

* update to apax version 3.3.1

* partial builds passed except axotemplatelibrary app

* apx clean moved before install

* removed unneccessary referencies to abstractions

* removed unneccessaary dependecies to core and timers

* removed unnesccesarry dependencies to ax.axopen.hwlibrary and components.abstractions

* removed unneccessary dependencies of the axopen.timers

* driives and robotics dependencies reordering

* dependencies cleanup

* app dependencies

* apax yamls reordered

* cake modified to run apax install --catalog

* catalogs implementation
  • Loading branch information
TomKovac authored Sep 10, 2024
1 parent 47703cc commit b9e7a33
Show file tree
Hide file tree
Showing 64 changed files with 275 additions and 384 deletions.
21 changes: 14 additions & 7 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,50 @@
"version": "0.19.3-alpha.231",
"commands": [
"ixc"
]
],
"rollForward": false
},
"docfx": {
"version": "2.70.4",
"commands": [
"docfx"
]
],
"rollForward": false
},
"AXSharp.ixd": {
"version": "0.19.3-alpha.231",
"commands": [
"ixd"
]
],
"rollForward": false
},
"AXSharp.ixr": {
"version": "0.19.3-alpha.231",
"commands": [
"ixr"
]
],
"rollForward": false
},
"microsoft.visualstudio.slngen.tool": {
"version": "10.3.4",
"commands": [
"slngen"
]
],
"rollForward": false
},
"docfxtocgenerator": {
"version": "1.10.0",
"commands": [
"DocFxTocGenerator"
]
],
"rollForward": false
},
"gitversion.tool": {
"version": "5.12.0",
"commands": [
"dotnet-gitversion"
]
],
"rollForward": false
}
}
}
38 changes: 34 additions & 4 deletions cake/ApaxCmd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public static void ApaxChangeBuildProperties(this BuildContext context, string y
{
quotedTargets.Add(target);
}

targetsNode.Children.Add(new YamlScalarNode(target));
}

Expand All @@ -347,8 +347,8 @@ public static void ApaxChangeBuildProperties(this BuildContext context, string y
{
yamlString = yamlString.Replace($"'{target}'", target);
}



// Save the manually adjusted YAML string to a file
File.WriteAllText(yamlFilePath, yamlString);
Expand All @@ -357,5 +357,35 @@ public static void ApaxChangeBuildProperties(this BuildContext context, string y
Console.WriteLine($"Apax '{yamlFilePath}' was modified for targets '{string.Join(",", targets)}' and files '{string.Join(",", files)}'");
}
}


public static void ApaxCatalogInstall(this BuildContext context, string yamlFilePath)
{
// Load the YAML stream
var yaml = new YamlStream();
using (var reader = new StreamReader(yamlFilePath))
{
yaml.Load(reader);
}

// Assuming there's only one document in the YAML stream
var root = (YamlMappingNode)yaml.Documents[0].RootNode;

if(root.Children.TryGetValue(new YamlScalarNode("type"), out var typeNode) && typeNode is YamlScalarNode scalarNode && (scalarNode.Value == "generic" || scalarNode.Value == "lib"))
{
if (root.Children.TryGetValue(new YamlScalarNode("catalogs"), out var catalogNode))
{
var apaxArguments = "install --catalog";
var folder = Path.GetDirectoryName(yamlFilePath);
context.Log.Information($"apax install --catalog started in '{folder}'");
context.ProcessRunner.Start(Helpers.GetApaxCommand(), new ProcessSettings()
{
Arguments = apaxArguments,
WorkingDirectory = folder,
RedirectStandardOutput = false,
RedirectStandardError = false,
Silent = false
}).WaitForExit();
}
}
}
}
24 changes: 23 additions & 1 deletion cake/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,28 @@ public override void Run(BuildContext context)
}
}

[TaskName("Build")]

[TaskName("CatalogInstall")]
[IsDependentOn(typeof(ApaxUpdateTask))]
public sealed class CatalogInstallTask : FrostingTask<BuildContext>
{
public override void Run(BuildContext context)
{

context.Libraries.ToList().ForEach(lib =>
{
foreach (var apaxfile in context.GetApaxFiles(lib))
{
context.ApaxCatalogInstall(apaxfile);
}
});


}
}

[TaskName("Build")]
[IsDependentOn(typeof(CatalogInstallTask))]
public sealed class BuildTask : FrostingTask<BuildContext>
{
public override void Run(BuildContext context)
Expand Down Expand Up @@ -196,6 +216,7 @@ public override void Run(BuildContext context)
{
context.Libraries.ToList().ForEach(lib =>
{
context.ApaxClean(lib);
context.ApaxInstall(context.GetLibraryAxFolders(lib));
context.ApaxBuild(context.GetLibraryAxFolders(lib));
context.ApaxTestLibrary(lib);
Expand All @@ -212,6 +233,7 @@ public override void Run(BuildContext context)
{
context.Libraries.ToList().ForEach(lib =>
{
context.ApaxClean(lib);
context.ApaxInstall(context.GetLibraryAxFolders(lib));
context.ApaxBuild(context.GetLibraryAxFolders(lib));
context.ApaxTestLibrary(lib);
Expand Down
8 changes: 4 additions & 4 deletions scripts/check_requisites.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ if (Test-Path $vsWhere) {
$isApaxInstalled = $false
try {
$apaxVersion = (apax --version).Trim()
if ($apaxVersion -eq "3.2.1") {
Write-Host "Apax 3.2.1 detected." -ForegroundColor Green
if ($apaxVersion -eq "3.3.1") {
Write-Host "Apax 3.3.1 detected." -ForegroundColor Green
$isApaxInstalled = $true;
} else {
Write-Host "Apax version mismatch. Expected 3.2.1 but found $apaxVersion." -ForegroundColor Red
Write-Host "Apax version mismatch. Expected 3.3.1 but found $apaxVersion." -ForegroundColor Red
Write-Host "Run apax self-update $apaxVersion." -ForegroundColor Red
}
} catch {
Expand Down Expand Up @@ -109,7 +109,7 @@ try {
$command = "axcode --version"

# Define the expected version
$expectedVersion = "1.90.0"
$expectedVersion = "1.91.1"

# Execute the command and capture the output
try {
Expand Down
6 changes: 2 additions & 4 deletions src/abstractions/app/apax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ variables:
devDependencies:
"@ix-ax/ax-sdk": '0.0.0-dev.0'
dependencies:
"@ix-ax/axopen.abstractions": '0.0.0-dev.0'
"@ix-ax/axopen.timers": '0.0.0-dev.0'
"@ix-ax/axopen.core": '0.0.0-dev.0'
installStrategy: strict
apaxVersion: 3.3.1
scripts:
# For proper execution of these scripts, the following variables need to be defined as environment variables or local variables.
# Local variables can override environment variables.
Expand Down Expand Up @@ -89,5 +89,3 @@ scripts:
START=$(date +%s)
..\\..\\scripts\\all.sh $PLC_NAME $AXTARGET $AXTARGETPLATFORMINPUT $AX_USERNAME $MY_VERY_STRONG_PASSWORD
echo $(date +%D)"-"$(date +%H)":"$(date +%M)":"$(date +%S) " - Finished in :" $(expr $(date +%s) - $START) "s"
installStrategy: strict
apaxVersion: 3.1.1
4 changes: 2 additions & 2 deletions src/abstractions/ctrl/apax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ devDependencies:
"@ix-ax/ax-sdk": '0.0.0-dev.0'
dependencies:
"@ix-ax/ax.axopen.min": '0.0.0-dev.0'
installStrategy: strict
apaxVersion: 3.3.1
scripts:
postbuild:
- dotnet ixc
publicKeys:
"@ix-ax": 30c06ef7830b4dfd8f16e003508da1ac2d187714d0e1f38279a9332cbe4e4e17
installStrategy: strict
apaxVersion: 3.1.1
...
3 changes: 1 addition & 2 deletions src/apax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ type: workspace
devDependencies:
"@ix-ax/ax-sdk": '0.0.0-dev.0'
installStrategy: strict
apaxVersion: 3.1.1

apaxVersion: 3.3.1
13 changes: 7 additions & 6 deletions src/ax.axopen.app/ctrl/apax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ files:
- apax.yml
devDependencies:
"@ix-ax/ax-sdk": '0.0.0-dev.0'
catalogs:
"@ax/simatic-ax": ^2405.0.0
dependencies:
"@ix-ax/ax.axopen.min": '0.0.0-dev.0'
"@ax/simatic-1500-clocks": ^7.0.4
"@ax/system-bitaccess": ^7.0.17
"@ax/system-math": ^7.0.17
"@ax/system-serde": ^7.0.17
"@ax/simatic-1500-clocks": 7.0.4
"@ax/system-bitaccess": 7.0.17
"@ax/system-math": 7.0.17
"@ax/system-serde": 7.0.17
installStrategy: strict
apaxVersion: 3.1.1
apaxVersion: 3.3.1
17 changes: 9 additions & 8 deletions src/ax.axopen.hwlibrary/ctrl/apax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ files:
- apax.yml
devDependencies:
"@ix-ax/ax-sdk": '0.0.0-dev.0'
catalogs:
"@ax/simatic-ax": ^2405.0.0
dependencies:
"@ix-ax/ax.axopen.min": '0.0.0-dev.0'
"@ax/simatic-1500-distributedio": ^7.0.1
"@ax/simatic-1500-diagnostics-hardware": ^7.0.1
"@ax/simatic-1500-clocks": ^7.0.4
"@ax/system-timer": ^7.0.17
"@ax/system-serde": ^7.0.17
"@ax/system-bitaccess": ^7.0.17
# "@ax/hwc": ^1.1.154
"@ax/simatic-1500-distributedio": 7.0.1
"@ax/simatic-1500-diagnostics-hardware": 7.0.1
"@ax/simatic-1500-clocks": 7.0.4
"@ax/system-timer": 7.0.17
"@ax/system-serde": 7.0.17
"@ax/system-bitaccess": 7.0.17
installStrategy: strict
apaxVersion: 3.1.1
apaxVersion: 3.3.1
6 changes: 4 additions & 2 deletions src/ax.axopen.min/ctrl/apax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ files:
- apax.yml
devDependencies:
"@ix-ax/ax-sdk": '0.0.0-dev.0'
catalogs:
"@ax/simatic-ax": ^2405.0.0
dependencies:
"@ax/system-strings": ^7.0.17
"@ax/system-strings": 7.0.17
installStrategy: strict
apaxVersion: 3.1.1
apaxVersion: 3.3.1
9 changes: 3 additions & 6 deletions src/components.abb.robotics/app/apax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ variables:
devDependencies:
"@ix-ax/ax-sdk": '0.0.0-dev.0'
dependencies:
"@ix-ax/axopen.core": '0.0.0-dev.0'
"@ix-ax/axopen.timers": '0.0.0-dev.0'
"@ix-ax/axopen.abstractions": '0.0.0-dev.0'
"@ix-ax/axopen.components.abb.robotics": '0.0.0-dev.0'
"@ix-ax/axopen.simatic1500": '0.0.0-dev.0'
"@ix-ax/ax.axopen.app": '0.0.0-dev.0'
"@ix-ax/axopen.simatic1500": '0.0.0-dev.0'
installStrategy: strict
apaxVersion: 3.3.1
scripts:
# For proper execution of these scripts, the following variables need to be defined as environment variables or local variables.
# Local variables can override environment variables.
Expand Down Expand Up @@ -91,5 +90,3 @@ scripts:
START=$(date +%s)
..\\..\\scripts\\all.sh $PLC_NAME $AXTARGET $AXTARGETPLATFORMINPUT $AX_USERNAME $MY_VERY_STRONG_PASSWORD
echo $(date +%D)"-"$(date +%H)":"$(date +%M)":"$(date +%S) " - Finished in :" $(expr $(date +%s) - $START) "s"
installStrategy: strict
apaxVersion: 3.1.1
14 changes: 4 additions & 10 deletions src/components.abb.robotics/ctrl/apax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@ files:
- axsharp.companion.json
devDependencies:
"@ix-ax/ax-sdk": '0.0.0-dev.0'
dependencies:
"@ix-ax/axopen.components.robotics": '0.0.0-dev.0'
installStrategy: strict
apaxVersion: 3.3.1
scripts:
postbuild:
- dotnet ixc
dependencies:
"@ix-ax/axopen.components.abstractions": '0.0.0-dev.0'
"@ix-ax/axopen.core": '0.0.0-dev.0'
"@ix-ax/axopen.timers": '0.0.0-dev.0'
"@ix-ax/axopen.abstractions": '0.0.0-dev.0'
"@ix-ax/axopen.components.robotics": '0.0.0-dev.0'
"@ix-ax/axopen.io": '0.0.0-dev.0'
"@ix-ax/ax.axopen.hwlibrary": '0.0.0-dev.0'
publicKeys:
"@ix-ax": 30c06ef7830b4dfd8f16e003508da1ac2d187714d0e1f38279a9332cbe4e4e17
installStrategy: strict
apaxVersion: 3.1.1
...
11 changes: 3 additions & 8 deletions src/components.abstractions/app/apax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,11 @@ devDependencies:
"@ix-ax/ax-sdk": '0.0.0-dev.0'
dependencies:
"@ix-ax/axopen.components.abstractions": '0.0.0-dev.0'
"@ix-ax/axopen.timers": '0.0.0-dev.0'
"@ix-ax/axopen.abstractions": '0.0.0-dev.0'
"@ix-ax/axopen.core": '0.0.0-dev.0'
installStrategy: strict
apaxVersion: 3.3.1
scripts:
download:
- apax install -L
- apax build
- dotnet ixc
- apax sld -i $AXTARGETPLATFORMINPUT -t $AXTARGET
--accept-security-disclaimer --default-server-interface -r
installStrategy: strict
apaxVersion: 3.1.1

- apax sld -i $AXTARGETPLATFORMINPUT -t $AXTARGET --accept-security-disclaimer --default-server-interface -r
10 changes: 4 additions & 6 deletions src/components.abstractions/ctrl/apax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ files:
- axsharp.companion.json
devDependencies:
"@ix-ax/ax-sdk": '0.0.0-dev.0'
dependencies:
"@ix-ax/axopen.core": '0.0.0-dev.0'
installStrategy: strict
apaxVersion: 3.3.1
scripts:
postbuild:
- dotnet ixc
dependencies:
"@ix-ax/axopen.core": '0.0.0-dev.0'
"@ix-ax/axopen.timers": '0.0.0-dev.0'
"@ix-ax/axopen.abstractions": '0.0.0-dev.0'
publicKeys:
"@ix-ax": 30c06ef7830b4dfd8f16e003508da1ac2d187714d0e1f38279a9332cbe4e4e17
installStrategy: strict
apaxVersion: 3.1.1
...
9 changes: 3 additions & 6 deletions src/components.balluff.identification/app/apax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ variables:
devDependencies:
"@ix-ax/ax-sdk": '0.0.0-dev.0'
dependencies:
"@ix-ax/axopen.core": '0.0.0-dev.0'
"@ix-ax/axopen.timers": '0.0.0-dev.0'
"@ix-ax/axopen.abstractions": '0.0.0-dev.0'
"@ix-ax/axopen.components.balluff.identification": '0.0.0-dev.0'
"@ix-ax/axopen.simatic1500": '0.0.0-dev.0'
"@ix-ax/ax.axopen.app": '0.0.0-dev.0'
"@ix-ax/axopen.simatic1500": '0.0.0-dev.0'
installStrategy: strict
apaxVersion: 3.3.1
scripts:
# For proper execution of these scripts, the following variables need to be defined as environment variables or local variables.
# Local variables can override environment variables.
Expand Down Expand Up @@ -91,5 +90,3 @@ scripts:
START=$(date +%s)
..\\..\\scripts\\all.sh $PLC_NAME $AXTARGET $AXTARGETPLATFORMINPUT $AX_USERNAME $MY_VERY_STRONG_PASSWORD
echo $(date +%D)"-"$(date +%H)":"$(date +%M)":"$(date +%S) " - Finished in :" $(expr $(date +%s) - $START) "s"
installStrategy: strict
apaxVersion: 3.1.1
Loading

0 comments on commit b9e7a33

Please sign in to comment.