Skip to content

Commit 560c4e6

Browse files
authored
Merge pull request #8 from itemisCREATE/addin-workflow-action
Workflow action to build AddIn and CLI
2 parents 2ac893f + a9d4bd4 commit 560c4e6

12 files changed

Lines changed: 103 additions & 22 deletions

File tree

.github/workflows/build.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
2+
name: build
3+
run-name: triggered by ${{ github.actor }}
4+
5+
on:
6+
workflow_dispatch:
7+
push:
8+
branches: [main]
9+
10+
jobs:
11+
12+
cli-build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up JDK 21
17+
uses: actions/setup-java@v4
18+
with:
19+
java-version: '21'
20+
distribution: 'temurin'
21+
cache: maven
22+
23+
- name: Build & test with Maven
24+
run: |
25+
cd CLI
26+
mvn -T 2 clean verify -B
27+
28+
- name: Upload build artifacts
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: CLI
32+
compression-level: 0 # artifact is already compressed
33+
retention-days: 2
34+
path: CLI/com.yakindu.bridges.ea.example.cli.product/target/products/*.zip
35+
36+
37+
addin-build:
38+
runs-on: windows-latest
39+
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 0
45+
46+
# Install the .NET Core workload
47+
- name: Install .NET Core
48+
uses: actions/setup-dotnet@v4
49+
with:
50+
dotnet-version: 8.0.x
51+
52+
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
53+
- name: Setup MSBuild.exe
54+
uses: microsoft/setup-msbuild@v2
55+
56+
# Execute all unit tests in the solution
57+
#- name: Execute unit tests
58+
# run: dotnet test
59+
60+
# Restore the application to populate the obj folder with RuntimeIdentifiers
61+
- name: Restore the application
62+
run: |
63+
cd AddIn
64+
msbuild /t:restore .\Itemis_Integrate_EA_Example_AddIn.sln /p:Configuration=Release
65+
66+
# Create the app package by building and packaging the project
67+
- name: Create the app package
68+
run: |
69+
cd AddIn
70+
msbuild Itemis_Integrate_EA_Example_AddIn.sln /p:Configuration=Release /p:Platform="Any CPU" /detailedsummary /v:detailed
71+
72+
# Upload the installer package
73+
- name: Upload build artifacts
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: Installer
77+
path: AddIn/Itemis_Integrate_EA_Example_AddIn_Setup/bin/x86/Release/*.msi

AddIn/Itemis_Integrate_EA_Example_AddIn/Itemis_Integrate_EA_Example_AddIn.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
</PropertyGroup>
4646
<ItemGroup>
4747
<Reference Include="Interop.EA">
48-
<HintPath>..\..\..\..\..\..\Program Files (x86)\Sparx Systems\EA\Interop.EA.dll</HintPath>
49-
<EmbedInteropTypes>True</EmbedInteropTypes>
48+
<HintPath>$(MSBuildThisFileDirectory)..\Lib\Interop.EA.dll</HintPath>
49+
<EmbedInteropTypes>False</EmbedInteropTypes>
5050
</Reference>
5151
<Reference Include="netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" />
5252
<Reference Include="System" />

AddIn/Itemis_Integrate_EA_Example_AddIn/UI/ValidationIssuesControl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public void NavigateToElementInProjectExplorer(ValidationIssue issue)
247247
if (elementDiagrams != null && elementDiagrams.Count >= 1)
248248
{
249249
// we'll navigate to the first diagram for now
250-
diagram = elementDiagrams.GetAt(0);
250+
diagram = (EA.Diagram)elementDiagrams.GetAt(0);
251251
Repository.OpenDiagram(diagram.DiagramID);
252252
Repository.ActivateDiagram(diagram.DiagramID);
253253
}

AddIn/Itemis_Integrate_EA_Example_AddIn_Setup/Dialog.wxi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg" />
3636
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg" />
3737
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg" />
38+
<Publish Dialog="BrowseDlg" Control="OK" Event="EndDialog" Value="Return" />
39+
3840
</UI>
3941

4042
<UIRef Id="WixUI_Common" />

AddIn/Itemis_Integrate_EA_Example_AddIn_Setup/Product.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<!-- Upgrade: Remove previous installer -->
1212
<Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
1313
<Upgrade Id="A3AEAA62-10B3-482A-BB69-BE186C4BAE59">
14-
<UpgradeVersion Minimum="1.0.0.0" Maximum="99.0.0.0" Property="PREVIOUSVERSIONSINSTALLED" IncludeMinimum="yes" IncludeMaximum="no" />
14+
<UpgradeVersion Minimum="0.0.0.0" Maximum="1.0.0.0" Property="PREVIOUSVERSIONSINSTALLED" IncludeMinimum="yes" IncludeMaximum="no" />
1515
</Upgrade>
1616

1717
<!-- Custom actions, see https://www.firegiant.com/wix/tutorial/events-and-actions/at-a-later-stage/) -->

AddIn/Itemis_Integrate_EA_Example_AddIn_Tests/Itemis_Integrate_EA_Example_AddIn_Tests.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@
2626

2727
<ItemGroup>
2828
<Reference Include="Interop.EA">
29-
<HintPath>C:\Program Files (x86)\Sparx Systems\EA\Interop.EA.dll</HintPath>
30-
<EmbedInteropTypes>True</EmbedInteropTypes>
31-
<Private>True</Private>
29+
<HintPath>$(MSBuildThisFileDirectory)..\Lib\Interop.EA.dll</HintPath>
30+
<EmbedInteropTypes>False</EmbedInteropTypes>
3231
</Reference>
3332
</ItemGroup>
3433

AddIn/Lib/Interop.EA.dll

387 KB
Binary file not shown.

CLI/.mvn/extensions.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<extensions>
22
<extension>
3-
<groupId>org.eclipse.tycho.extras</groupId>
4-
<artifactId>tycho-pomless</artifactId>
3+
<groupId>org.eclipse.tycho</groupId>
4+
<artifactId>tycho-build</artifactId>
55
<version>4.0.13</version>
66
</extension>
77
</extensions>

CLI/com.yakindu.bridges.ea.example.cli.test/src/com/yakindu/bridges/ea/example/cli/test/ExampleCLITest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private List<String> assertIssuesInModel(String elementToValidate, String... exp
6464

6565
// then
6666
for (String segment : List.of(">> Loading '", ">> Collecting UML Elements DONE.", ">> Validating DONE.",
67-
"Validation successfully finished.")) {
67+
"CLI successfully finished.")) {
6868
assertTrue("Missing in console output: \"" + segment + "\"\n\n" + output, output.contains(segment));
6969
}
7070

CLI/com.yakindu.bridges.ea.example.cli/src/com/yakindu/bridges/ea/example/cli/AbstractResourceProcessor.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,20 @@ private Resource load(String filePath) throws Exception {
9595
loadOptions.put(EAResource.OPTION_READONLY, true);
9696
loadOptions.put(EAResource.OPTION_REPORT_TO_ERROR_LOG, false);
9797
loadOptions.put(EAResource.OPTION_REPORT_AS_RESOURCE_MARKERS, false);
98+
checkLInfo();
9899
}
99100
final Resource res = set.getResource(uri, true);
100101
UMLModelUtils.adjustTimeEventsInModel(res);
101102
return res;
102103
}
103104

105+
private void checkLInfo() throws Exception {
106+
@SuppressWarnings("restriction")
107+
final String msg = com.yakindu.bridges.ea.core.internal.utils.LInfo.isV();
108+
if (msg != null)
109+
throw new Exception(msg);
110+
}
111+
104112
protected String getNameOrGuidFromArguments(String[] args) {
105113
for (String arg : args) {
106114
if (!ExampleCLI.VERBOSE_OUTPUT.equals(arg)) {

0 commit comments

Comments
 (0)