Skip to content

Commit 5bbeacb

Browse files
cdm integration prep
1 parent d57778f commit 5bbeacb

File tree

4 files changed

+12
-20
lines changed

4 files changed

+12
-20
lines changed

.github/workflows/build-and-tag-release-rosetta-bundle.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: Build and Tag with Rosetta Bundle Version
22

33
on:
44
workflow_dispatch:
5-
# Optionally, you can trigger on push to main or other events
65

76
jobs:
87
build:
@@ -35,24 +34,17 @@ jobs:
3534
run: |
3635
curl -L -o cdm-pom.xml https://raw.githubusercontent.com/finos/common-domain-model/main/pom.xml
3736
38-
- name: Extract rosetta.bundle.version from external POM
37+
- name: Extract rosetta.bundle.version from external POM using Maven
3938
id: extract_version
4039
run: |
41-
# Try to extract from <properties> first, fallback to profile if needed
42-
version=$(xmllint --xpath "string(//properties/rosetta.bundle.version)" cdm-pom.xml)
43-
if [ -z "$version" ]; then
44-
version=$(xmllint --xpath "string(//profile/properties/rosetta.bundle.version)" cdm-pom.xml)
45-
fi
40+
version=$(mvn -f cdm-pom.xml help:evaluate -Dexpression=rosetta.bundle.version -q -DforceStdout)
4641
echo "rosetta.bundle.version=$version"
4742
echo "version=$version" >> $GITHUB_OUTPUT
4843
49-
- name: Override rosetta.bundle.version in local pom.xml
44+
- name: Update all rosetta.bundle.version properties in local pom.xml using Maven
5045
run: |
5146
version="${{ steps.extract_version.outputs.version }}"
52-
# Replace in <properties>
53-
sed -i "s|<rosetta.bundle.version>.*</rosetta.bundle.version>|<rosetta.bundle.version>${version}</rosetta.bundle.version>|" pom.xml
54-
# Replace in <profile> (if present)
55-
sed -i "s|<rosetta.bundle.version>.*</rosetta.bundle.version>|<rosetta.bundle.version>${version}</rosetta.bundle.version>|" pom.xml
47+
mvn versions:set-property -Dproperty=rosetta.bundle.version -DnewVersion=$version -DprocessAllModules=true
5648
5749
- name: Set POM version to rosetta.bundle.version
5850
run: |
@@ -63,8 +55,8 @@ jobs:
6355
- name: Build with Maven
6456
run: mvn -B package
6557

66-
- name: Revert POM changes
67-
run: git checkout -- pom.xml
58+
- name: Revert POM property changes
59+
run: mvn versions:revert
6860

6961
- name: Upload JAR files
7062
uses: actions/upload-artifact@v4

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
191191
<maven-gpg-plugin.version>3.2.4</maven-gpg-plugin.version>
192192
<!-- Used by the Python generator -->
193-
<cdm.rosetta.source.path>/Users/dls/projects/cdm/common-domain-model/trade-header/common-domain-model/rosetta-source/src/main/rosetta</cdm.rosetta.source.path>
193+
<cdm.rosetta.source.path>[path to rosetta files]</cdm.rosetta.source.path>
194194
<cdm.python.output.path>target/python-cdm</cdm.python.output.path>
195195
<unittest.rosetta.source.path>test/python_unit_tests/rosetta</unittest.rosetta.source.path>
196196
<unittest.python.output.path>target/python-tests/unit_tests</unittest.python.output.path>

src/test/java/com/regnosys/rosetta/generator/python/PythonFilesGeneratorTest.xtend

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class PythonFilesGeneratorTest {
3737
/*
3838
* generate CDM from Rosetta files. Should be disabled for releases
3939
*/
40-
// @Disabled
40+
@Disabled
4141
@Test
4242
def void generateCDMPythonFromRosetta() {
4343
try {

test/python_unit_tests/rosetta/BinaryOp.rosetta

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace rosetta_dsl.test.semantic.binary_op : <"generate Python unit tests from Rosetta.">
22

3-
type EqualsTest: <" Test equals operation condition">
3+
type EqualsTest: <"Test equals operation condition">
44
aValue int (1..1)
55
target int (1..1)
66
condition TestCond: <"Test condition">
@@ -9,7 +9,7 @@ type EqualsTest: <" Test equals operation condition">
99
else
1010
False
1111

12-
type NotEqualsTest: <" Test not equals operation condition">
12+
type NotEqualsTest: <"Test not equals operation condition">
1313
aValue int (1..1)
1414
target int (1..1)
1515
condition TestCond: <"Test condition">
@@ -18,7 +18,7 @@ type NotEqualsTest: <" Test not equals operation condition">
1818
else
1919
False
2020

21-
type ContainsTest: <" Test contains operation condition">
21+
type ContainsTest: <"Test contains operation condition">
2222
aValue string (1..*)
2323
target string (1..1)
2424
condition TestCond: <"Test condition">
@@ -27,7 +27,7 @@ type ContainsTest: <" Test contains operation condition">
2727
else
2828
False
2929

30-
type DisjointTest: <" Test disjoint operation condition">
30+
type DisjointTest: <"Test disjoint operation condition">
3131
aValue string (1..*)
3232
target string (1..*)
3333
condition TestCond: <"Test condition">

0 commit comments

Comments
 (0)