Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix formalize attributes config name and line-endings issue + setup github workflow #1

Merged
merged 20 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
7ba5ae2
Fixed naming error from formalizeExtendedAtrributes to formalizeExte…
harmen-xb Feb 23, 2024
f70e1f7
Refactored PowerDeComposerTest into PowerDeComposer maven project.
harmen-xb Feb 26, 2024
92d233a
Added github workflows.
harmen-xb Feb 26, 2024
db188a1
Updated pom schemagen settings.
harmen-xb Feb 26, 2024
148f55b
Removed episode file.
harmen-xb Feb 26, 2024
f736538
Updated logging properties so everything is not logged twice.
harmen-xb Feb 26, 2024
74dbcd4
Added unit tests for new line handing in compose phase.
harmen-xb Feb 28, 2024
6d53342
Created gitattributes file for test files (to make sure CR and CRLF a…
harmen-xb Feb 28, 2024
dd17c48
Updated line enddings in Git after gitattributes setting.
harmen-xb Feb 28, 2024
ee26abc
Added matrix in job to run on windows and linux.
harmen-xb Feb 28, 2024
82c4a30
Removed vscode settings.
harmen-xb Feb 28, 2024
8b2fe37
Disabled fail-fast in workflow job.
harmen-xb Feb 28, 2024
7e3276b
Added os and java version to test result name.
harmen-xb Feb 28, 2024
f043129
Refactored logging to use global logger and setup INFO for normal use…
harmen-xb Feb 28, 2024
4c57bc6
Updated spaces/tabs in feature file.
harmen-xb Feb 28, 2024
86c5f61
Changed all feature files from LF to CRLF.
harmen-xb Feb 28, 2024
c134710
Updated Steps to always have CRLF for inline Cucumber content (and no…
harmen-xb Feb 28, 2024
34d3fc2
Added java version to jar artifact.
harmen-xb Feb 28, 2024
4ca167f
Added tests (with steps) to verify new-line handling on Decompose pro…
harmen-xb Feb 28, 2024
f2bc109
Refactored getVTDNav function in XmlUtils to work in byte[] so we can…
harmen-xb Feb 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
on:
workflow_call:

env:
MAVEN_VERSION: 3.8.6

defaults:
run:
shell: bash

jobs:
build-and-test:
strategy:
# Don't fail other run's if one fails. Let them all finish.
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
java: [11, 17]

name: Build and test
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
# Checkout the code
- name: checkout
uses: actions/checkout@v4

# Setup Java
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '${{ matrix.java }}'
distribution: 'temurin'
architecture: x64
cache: 'maven'

# Build with Maven
- name: Build
run: mvn --batch-mode install -DskipTests
working-directory: ./PowerDeComposer

# Test with Maven
- name: Run Unit Tests
run: mvn --batch-mode test -Dtest="RunPDCUnitTest"
working-directory: ./PowerDeComposer

- name: Test Report
uses: phoenix-actions/test-reporting@v12
id: test-report # Set ID reference for step
if: success() || failure() # run this step even if previous step failed
with:
name: test-results-${{ matrix.os }}-java-${{ matrix.java }}
path: PowerDeComposer/target/surefire-reports/TEST-*.xml
reporter: java-junit

# Build single jar
- name: Assemble Jar
if: runner.os == 'Linux'
run: mvn --batch-mode assembly:single -DskipTests
working-directory: ./PowerDeComposer

# Publish jars.
- uses: actions/upload-artifact@v4
if: runner.os == 'Linux'
with:
name: jar-without-dependencies-java-${{ matrix.java }}
path: PowerDeComposer/target/PowerDeComposer-*[0-9].jar
compression-level: 0 # no compression, since jar is already compressed
- uses: actions/upload-artifact@v4
if: runner.os == 'Linux'
with:
name: jar-with-dependencies-java-${{ matrix.java }}
path: PowerDeComposer/target/PowerDeComposer-*[0-9]-jar-with-dependencies.jar
compression-level: 0 # no compression, since jar is already compressed
13 changes: 13 additions & 0 deletions .github/workflows/cicd-feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: cicd-feature

on:
push:
branches:
- feature/*
pull_request:
branches:
- feature/*

jobs:
build-and-test:
uses: ./.github/workflows/build-and-test.yml
10 changes: 10 additions & 0 deletions .github/workflows/cicd-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: cicd-main

on:
push:
branches:
- main

jobs:
build-and-test:
uses: ./.github/workflows/build-and-test.yml
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ target
/bin/
/target/
**/*.xjb
PowerDeComposer/src/main/resources/com/xbreeze/xml/config/schema1.xsd
7 changes: 0 additions & 7 deletions .vscode/settings.json

This file was deleted.

4 changes: 2 additions & 2 deletions Documentation/docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The PowerDeComposer configuration for composing and decomposing model files.
```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PowerDeComposerConfig>
<Decompose fileRemovalStrategy="..." formalizeExtendedAtrributes="...">
<Decompose fileRemovalStrategy="..." formalizeExtendedAttributes="...">

<!-- Specify a XPath to execute on both sides (composed and decomposed) to decide whether the decompose. -->
<!-- The value of the XPath must be found in the root XML document of the decomposed model, so it can be in a decompose part of the model. -->
Expand Down Expand Up @@ -84,7 +84,7 @@ The PowerDeComposer configuration for composing and decomposing model files.
| Config element | Description |
|:--- |:--- |
| fileRemovalStrategy | Specify a file removal strategy that is used to remove previously decomposed files. "includes" will traverse the includes tree of the decomposed files and build the list based on them. This is also the default value that is used if not specified. "files" will traverse the decomposed directory and build the list based on the files that are present. |
| formalizeExtendedAtrributes | Indicate whether extended attributes should be formalized during de-composing of PowerDesigner models. Extended attributes are stored as a piece of text, while formalizing this text is translated into XML elements which can more easily be accessed using XPath (for example when using CrossGenerate). When this attribute is not specified in the config, the value will be "true". Possible values are "true" and "false". |
| formalizeExtendedAttributes | Indicate whether extended attributes should be formalized during de-composing of PowerDesigner models. Extended attributes are stored as a piece of text, while formalizing this text is translated into XML elements which can more easily be accessed using XPath (for example when using CrossGenerate). When this attribute is not specified in the config, the value will be "true". Possible values are "true" and "false". |
| ChangeDetection | Node to evaluate on the composed and decomposed models. Of the value is empty on at least one side or the value differs the decompose is executed. |
| IdentifierReplacement | Instruction to replace identifiers with alternative values. The identifierNodeXPath is the node which contains the identifier in the composed model. The replacementValueXPath must be executed to get the new identifier value. The referencingNodeXPath value is optional, it if specified the value in these nodes will also be replaced using the value of the old identifier and the new identifier. |
| NodeRemoval | Instruction to remove nodes before decomposing. The XPath is evaluated to find the nodes to remove. An example for such an instruction is to remove the modification date on referenced objects. |
Expand Down
16 changes: 6 additions & 10 deletions PowerDeComposer/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,21 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="test" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path=".apt_generated_tests">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".apt_generated">
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
Expand Down
Loading
Loading