Skip to content

Commit

Permalink
Merge pull request #131 from ix-ax/dev
Browse files Browse the repository at this point in the history
preview v 0.13.4
  • Loading branch information
PTKu authored Mar 21, 2023
2 parents 6b9157a + 6ab3beb commit 20f7120
Show file tree
Hide file tree
Showing 2,469 changed files with 194,134 additions and 35,360 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
]
},
"docfx": {
"version": "2.60.0",
"version": "2.63.0",
"commands": [
"docfx"
]
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["dev"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: './docs/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ FodyWeavers.xsd
.idea/

ix/.g/**
.g/

.apax/
/src/apax/stc-generic-x64
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.13.3
next-version: 0.13.4
branches:
main:
regex: ^master$|^main$
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Entry.Plc.weather.GeoLocation.Write();

## Getting started

To get started, visit the documentation [here](docs/README.md#getting-started).
To get started, visit the documentation [here](docfx/index.md#getting-started).


## Examples
Expand Down
1 change: 1 addition & 0 deletions cake/Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Cake.DocFx" Version="1.0.0" />
<PackageReference Include="CliWrap" Version="3.5.0" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Octokit" Version="4.0.1" />
Expand Down
4 changes: 3 additions & 1 deletion cake/BuildContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ public class BuildContext : FrostingContext

public string WorkDirName => Environment.WorkingDirectory.GetDirectoryName();

public string ApiDocumentationDir => Path.GetFullPath(Path.Combine(Environment.WorkingDirectory.FullPath, "..//docs//api//"));
public string DocumentationOutputDir => Path.GetFullPath(Path.Combine(Environment.WorkingDirectory.FullPath, "..//docs//"));

public string DocumentationSource => Path.GetFullPath(Path.Combine(Environment.WorkingDirectory.FullPath, "..//docfx//"));

public string RootDir => Path.GetFullPath(Path.Combine(Environment.WorkingDirectory.FullPath, "..//src//"));

Expand Down
73 changes: 45 additions & 28 deletions cake/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

// Build
// Copyright (c) 2023 Peter Kurhajec (PTKu), MTS, and Contributors. All Rights Reserved.
// Contributors: https://github.com/ix-ax/ix/graphs/contributors
Expand All @@ -24,6 +25,8 @@
using Cake.Core.Diagnostics;
using Cake.Core.IO;
using Cake.Core.Tooling;
using Cake.DocFx;
using Cake.DocFx.Build;
using Cake.Frosting;
using Cake.Powershell;
using CliWrap;
Expand Down Expand Up @@ -111,15 +114,21 @@ public override void Run(BuildContext context)
{
context.DotNetBuild(Path.Combine(context.RootDir, "ix.compiler\\src\\ixc\\Ix.ixc.csproj"), context.DotNetBuildSettings);

context.DotNetRunSettings.WorkingDirectory = Path.Combine(context.RootDir, "ix.blazor\\tests\\sandbox\\ax-blazor-example\\");

context.DotNetRun(Path.Combine(context.RootDir, "ix.compiler\\src\\ixc\\Ix.ixc.csproj"), context.DotNetRunSettings);
var axprojects = new List<string>()
{
Path.Combine(context.RootDir, "ix.blazor\\tests\\sandbox\\ax-blazor-example\\"),
Path.Combine(context.RootDir, "sanbox\\integration\\ix-integration-plc\\"),
Path.Combine(context.RootDir, "ix.examples\\hello.world.console\\hello.world.console.plc"),
Path.Combine(context.RootDir, "ix.connectors\\tests\\ax-test-project\\"),
Path.Combine(context.RootDir, "tests.integrations\\integrated\\src\\ax\\")
};

context.DotNetRunSettings.WorkingDirectory = Path.Combine(context.RootDir, "sanbox\\integration\\ix-integration-plc\\");
context.DotNetRun(Path.Combine(context.RootDir, "ix.compiler\\src\\ixc\\Ix.ixc.csproj"), context.DotNetRunSettings);

context.DotNetRunSettings.WorkingDirectory = Path.Combine(context.RootDir, "ix.examples\\hello.world.console\\hello.world.console.plc");
context.DotNetRun(Path.Combine(context.RootDir, "ix.compiler\\src\\ixc\\Ix.ixc.csproj"), context.DotNetRunSettings);
foreach (var axproject in axprojects)
{
context.DotNetRunSettings.WorkingDirectory = Path.Combine(context.RootDir, axproject);
context.DotNetRun(Path.Combine(context.RootDir, "ix.compiler\\src\\ixc\\Ix.ixc.csproj"), context.DotNetRunSettings);
}

context.DotNetBuild(Path.Combine(context.RootDir, "ix.sln"), context.DotNetBuildSettings);

Expand Down Expand Up @@ -155,13 +164,15 @@ public override void Run(BuildContext context)
}
else
{
var workingDirectory = Path.GetFullPath(Path.Combine(context.WorkDirName,
"..//..//src//ix.connectors//tests//ax-test-project//"));

var targetIp = Environment.GetEnvironmentVariable("AXTARGET");
var targetPlatform = Environment.GetEnvironmentVariable("AXTARGETPLATFORMINPUT");
UploadTestPlc(context,
Path.GetFullPath(Path.Combine(context.WorkDirName, "..//..//src//ix.connectors//tests//ax-test-project//")),
Environment.GetEnvironmentVariable("AX_WEBAPI_TARGET"),
Environment.GetEnvironmentVariable("AXTARGETPLATFORMINPUT"));

UploadTestPlc(context, workingDirectory, targetIp, targetPlatform);
UploadTestPlc(context,
Path.GetFullPath(Path.Combine(context.WorkDirName, "..//..//src//tests.integrations//integrated//src//ax")),
Environment.GetEnvironmentVariable("AXTARGET"),
Environment.GetEnvironmentVariable("AXTARGETPLATFORMINPUT"));

RunTestsFromFilteredSolution(context, Path.Combine(context.RootDir, "ix-L3-tests.slnf"));
}
Expand Down Expand Up @@ -315,27 +326,33 @@ public override void Run(BuildContext context)
return;
}

if (Helpers.CanReleaseInternal())
GenerateApiDocumentation(context, @$"ix.connectors\src\Ix.Connector\bin\{context.DotNetBuildSettings.Configuration}\net6.0\Ix.Connector.dll", @"Ix.Connector");
GenerateApiDocumentation(context, @$"ix.connectors\src\Ix.Connector.S71500.WebAPI\bin\{context.DotNetBuildSettings.Configuration}\net6.0\Ix.Connector.S71500.WebAPI.dll", @"Ix.Connector.S71500.WebAPI");
context.ProcessRunner.Start(@"dotnet", new Cake.Core.IO.ProcessSettings()
{
WorkingDirectory = context.DocumentationSource,
Arguments = $"docfx build"
}).WaitForExit();

//GenerateApiDocumentation(context, @$"ix.connectors\src\Ix.Connector\bin\{context.DotNetBuildSettings.Configuration}\net6.0\Ix.Connector.dll", @"Ix.Connector");
//GenerateApiDocumentation(context, @$"ix.connectors\src\Ix.Connector.S71500.WebAPI\bin\{context.DotNetBuildSettings.Configuration}\net6.0\Ix.Connector.S71500.WebAPI.dll", @"Ix.Connector.S71500.WebAPI");

GenerateApiDocumentation(context, @$"ix.compiler\src\IX.Compiler\bin\{context.DotNetBuildSettings.Configuration}\net6.0\IX.Compiler.dll", @"IX.Compiler");
GenerateApiDocumentation(context, @$"ix.compiler\src\IX.Cs.Compiler\bin\{context.DotNetBuildSettings.Configuration}\net6.0\IX.Compiler.Cs.dll", @"IX.Compiler.Cs");
//GenerateApiDocumentation(context, @$"ix.compiler\src\IX.Compiler\bin\{context.DotNetBuildSettings.Configuration}\net6.0\IX.Compiler.dll", @"IX.Compiler");
//GenerateApiDocumentation(context, @$"ix.compiler\src\IX.Cs.Compiler\bin\{context.DotNetBuildSettings.Configuration}\net6.0\IX.Compiler.Cs.dll", @"IX.Compiler.Cs");

GenerateApiDocumentation(context, @$"ix.abstractions\src\Ix.Abstractions\bin\{context.DotNetBuildSettings.Configuration}\net6.0\Ix.Abstractions.dll", @"Ix.Abstractions");
GenerateApiDocumentation(context, @$"ix.blazor\src\Ix.Presentation.Blazor\bin\{context.DotNetBuildSettings.Configuration}\net6.0\Ix.Presentation.Blazor.dll", @"Ix.Presentation.Blazor");
GenerateApiDocumentation(context, @$"ix.blazor\src\Ix.Presentation.Blazor.Controls\bin\{context.DotNetBuildSettings.Configuration}\net6.0\Ix.Presentation.Blazor.Controls.dll", @"Ix.Presentation.Blazor.Controls");
//GenerateApiDocumentation(context, @$"ix.abstractions\src\Ix.Abstractions\bin\{context.DotNetBuildSettings.Configuration}\net6.0\Ix.Abstractions.dll", @"Ix.Abstractions");
//GenerateApiDocumentation(context, @$"ix.blazor\src\Ix.Presentation.Blazor\bin\{context.DotNetBuildSettings.Configuration}\net6.0\Ix.Presentation.Blazor.dll", @"Ix.Presentation.Blazor");
//GenerateApiDocumentation(context, @$"ix.blazor\src\Ix.Presentation.Blazor.Controls\bin\{context.DotNetBuildSettings.Configuration}\net6.0\Ix.Presentation.Blazor.Controls.dll", @"Ix.Presentation.Blazor.Controls");
}

[Obsolete("Using docfx now...", true)]
private static void GenerateApiDocumentation(BuildContext context, string assemblyFile, string outputDocDirectory)
{
context.Log.Information($"Generating documentation for {assemblyFile}");
var docXmlFile = Path.Combine(context.RootDir, assemblyFile);
var docDirectory = Path.Combine(context.ApiDocumentationDir, outputDocDirectory);
context.ProcessRunner.Start(@"dotnet", new Cake.Core.IO.ProcessSettings()
{
Arguments = $"xmldocmd {docXmlFile} {docDirectory}"
}).WaitForExit();
//context.Log.Information($"Generating documentation for {assemblyFile}");
//var docXmlFile = Path.Combine(context.RootDir, assemblyFile);
//var docDirectory = Path.Combine(context.ApiDocumentationDir, outputDocDirectory);
//context.ProcessRunner.Start(@"dotnet", new Cake.Core.IO.ProcessSettings()
//{
// Arguments = $"xmldocmd {docXmlFile} {docDirectory}"
//}).WaitForExit();
}
}

Expand Down
9 changes: 9 additions & 0 deletions docfx/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
###############
# folder #
###############
/**/DROP/
/**/TEMP/
/**/packages/
/**/bin/
/**/obj/
_site
5 changes: 5 additions & 0 deletions docfx/api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
###############
# temp file #
###############
*.yml
.manifest
3 changes: 3 additions & 0 deletions docfx/api/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# IX API Documentation

![](~/images/banner.png)
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ END_CLASS

Renderer will create following UI:

![alt text](assets/uniform.png "RenderIgnore and custom labels")
![alt text](~/images/blazor/uniform.png)

---
## Wrap
Wrap layout creates a wrapper around the elements. Elements are placed in a row. Width of all elements isn't the same and when window is resized, elements will be placed below each other. So wrap layout is responsive layout.

This is the example behavior of wrap panel:

![alt text](assets/wrap-panel.gif "Wrap panel behavior")
![alt text](~/images/blazor/wrap-panel.gif "Wrap panel behavior")

---
## Tabs
Expand All @@ -82,7 +82,7 @@ CLASS fbWorldWeatherWatch
END_CLASS
```
![alt text](assets/tabs.gif "Tabs layout")
![alt text](~/images/blazor/tabs.gif "Tabs layout")

---
## Group layout Border
Expand All @@ -106,7 +106,7 @@ CLASS border
END_CLASS
```

![alt text](assets/border.png "Border layout")
![alt text](~/images/blazor/border.png "Border layout")

---
## Group layout GroupBox
Expand All @@ -129,7 +129,7 @@ CLASS border
END_CLASS
```

![alt text](assets/groupbox.png "GroupBox layout")
![alt text](~/images/blazor/groupbox.png "GroupBox layout")

---
## Nested and multiple layouts
Expand Down Expand Up @@ -165,6 +165,6 @@ END_CLASS
```
Renderer will generate following UI:

![alt text](assets/multiple_layouts.gif "Mulitple layouts")
![alt text](~/images/blazor/multiple_layouts.gif "Mulitple layouts")

---
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Create Razor class library in your solution.

Dependency graph should look like this:

![alt text](assets/dependency-graph.png "Dependency graph")
![alt text](~/images/blazor/dependency-graph.png "Dependency graph")


### 3. Add namespace
Expand Down Expand Up @@ -109,7 +109,7 @@ If you plc variable is declared in your own namespace, make sure **namespace of

At the end, structure of external library should look like this:

![alt text](assets/project-structure.png "Structure")
![alt text](~/images/blazor/project-structure.png "Structure")

### Render custom component in your application

Expand All @@ -119,7 +119,7 @@ At the end, structure of external library should look like this:

If everything was done correctly, custom view defined in external library should be rendered.

![alt text](assets/rendered-ui.png "Rendered UI")
![alt text](~/images/blazor/rendered-ui.png "Rendered UI")

---

Expand Down Expand Up @@ -187,5 +187,5 @@ Note: viewmodel properties and variables can be accessed with inherited `ViewMod
Context="@Entry.Plc.test_example.ixcomponent_instance" />
```

![alt text](assets/viewmodel-service.png "UI with viewmodel")
![alt text](~/images/blazor/viewmodel-service.png "UI with viewmodel")

Loading

0 comments on commit 20f7120

Please sign in to comment.