Skip to content

Commit 1da774c

Browse files
committed
Merge branch '__rultor'
2 parents fd7bb02 + ec4adc2 commit 1da774c

File tree

15 files changed

+243
-60
lines changed

15 files changed

+243
-60
lines changed

.markdownlint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com
2+
# SPDX-License-Identifier: MIT
3+
---
4+
# Default state for all rules
5+
default: true
6+
7+
# Line length : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md013.md
8+
MD013:
9+
line_length: 100
10+
11+
# Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md033.md
12+
MD033:
13+
allowed_elements: [ img ]
14+
15+
# Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md040.md
16+
MD040: false
17+
18+
# First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md041.md
19+
MD041: false

.yamllint.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com
2+
# SPDX-License-Identifier: MIT
3+
---
4+
5+
extends: default
6+
7+
rules:
8+
line-length: disable
9+
brackets:
10+
min-spaces-inside: 1
11+
max-spaces-inside: 2
12+
truthy:
13+
level: warning
14+
allowed-values: [ 'on', 'true', 'false', 'yes', 'no' ]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# sodg-maven-plugin
1+
<img alt="logo" src="https://www.objectionary.com/cactus.svg" height="100px" />
22

33
SODG (Surging Object DiGraph) Maven Plugin is a plugin for Maven that allows to
44
build a graph from an EO program.
@@ -10,4 +10,4 @@ in [this repository](https://github.com/objectionary/sodg).
1010
When the graph is built by the virtual machine, it must be possible to execute
1111
a program using graph traversing algorithm. An example of such an executor
1212
of a graph can be found
13-
in [this repository](https://github.com/objectionary/reo).
13+
in [this repository](https://github.com/objectionary/reo).

pom.xml

Lines changed: 14 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,8 @@
8181
<properties>
8282
<!-- This is required for later correct replacement of argLine -->
8383
<argLine/>
84-
<!-- This is the flag that allows to skip unit tests run by maven-surefire-plugin -->
85-
<skipUTs/>
86-
<!-- This is the flag that allows to skip integration tests run by maven-failsafe-plugin -->
84+
<!-- Skip integration tests -->
8785
<skipITs/>
88-
<!-- This is the flag that allows to skip all tests -->
89-
<skipTests/>
9086
</properties>
9187
<dependencies>
9288
<dependency>
@@ -113,6 +109,12 @@
113109
<version>3.15.1</version>
114110
<scope>provided</scope>
115111
</dependency>
112+
<dependency>
113+
<groupId>com.opencsv</groupId>
114+
<artifactId>opencsv</artifactId>
115+
<version>5.10</version>
116+
<scope>runtime</scope>
117+
</dependency>
116118
<dependency>
117119
<groupId>com.yegor256</groupId>
118120
<artifactId>xsline</artifactId>
@@ -197,48 +199,15 @@
197199
<version>0.6.2</version>
198200
<scope>test</scope>
199201
</dependency>
200-
<dependency>
201-
<groupId>org.apache.maven.plugin-testing</groupId>
202-
<artifactId>maven-plugin-testing-harness</artifactId>
203-
<version>3.3.0</version>
204-
<scope>test</scope>
205-
</dependency>
206202
</dependencies>
203+
<build>
204+
<plugins>
205+
<plugin>
206+
<artifactId>maven-invoker-plugin</artifactId>
207+
</plugin>
208+
</plugins>
209+
</build>
207210
<profiles>
208-
<profile>
209-
<id>skipTests</id>
210-
<activation>
211-
<property>
212-
<name>skipTests</name>
213-
</property>
214-
</activation>
215-
<properties>
216-
<skipITs>true</skipITs>
217-
<skipUTs>true</skipUTs>
218-
</properties>
219-
</profile>
220-
<profile>
221-
<id>skipITs</id>
222-
<activation>
223-
<property>
224-
<name>skipITs</name>
225-
</property>
226-
</activation>
227-
<properties>
228-
<skipITs>true</skipITs>
229-
</properties>
230-
</profile>
231-
<profile>
232-
<id>skipUTs</id>
233-
<activation>
234-
<property>
235-
<name>skipUTs</name>
236-
</property>
237-
</activation>
238-
<properties>
239-
<skipUTs>true</skipUTs>
240-
</properties>
241-
</profile>
242211
<profile>
243212
<id>qulice</id>
244213
<build>

src/it/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<!-- markdownlint-disable-next-line line-length -->
2+
<img alt="logo" src="https://www.yegor256.com/images/books/elegant-objects/cactus.svg" height="100px" />
3+
4+
This directory contains integration tests for `sodg-maven-plugin`.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Generates SODG files
2+
3+
Integration test that
4+
generates [SODG](https://github.com/objectionary/sodg-maven-plugin) files.
5+
6+
If you only need to run this test, use the following command:
7+
8+
```shell
9+
mvn clean integration-test -Dinvoker.test=generates-sodg-files -DskipTests
10+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com
2+
# SPDX-License-Identifier: MIT
3+
invoker.goals=clean process-sources -e
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
* SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com
4+
* SPDX-License-Identifier: MIT
5+
-->
6+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
7+
<modelVersion>4.0.0</modelVersion>
8+
<parent>
9+
<groupId>com.jcabi</groupId>
10+
<artifactId>parent</artifactId>
11+
<version>0.68.0</version>
12+
</parent>
13+
<groupId>org.eolang</groupId>
14+
<artifactId>examples</artifactId>
15+
<version>@project.version@</version>
16+
<packaging>jar</packaging>
17+
<name>Generates SODG Files</name>
18+
<description>This tests compiles EO programs to XMIR and then checks that we can generate SODG files from this XMIR</description>
19+
<properties>
20+
<eo.version>0.55.2</eo.version>
21+
</properties>
22+
<build>
23+
<plugins>
24+
<plugin>
25+
<artifactId>maven-surefire-plugin</artifactId>
26+
<configuration>
27+
<failIfNoTests>false</failIfNoTests>
28+
</configuration>
29+
</plugin>
30+
<plugin>
31+
<groupId>org.eolang</groupId>
32+
<artifactId>eo-maven-plugin</artifactId>
33+
<version>${eo.version}</version>
34+
<executions>
35+
<execution>
36+
<goals>
37+
<goal>register</goal>
38+
<goal>assemble</goal>
39+
<goal>transpile</goal>
40+
</goals>
41+
</execution>
42+
</executions>
43+
<configuration>
44+
<unrollExitError>true</unrollExitError>
45+
<foreign>${project.build.directory}/eo/foreign.csv</foreign>
46+
<foreignFormat>csv</foreignFormat>
47+
<placed>${project.build.directory}/eo/placed.json</placed>
48+
<placedFormat>json</placedFormat>
49+
<trackTransformationSteps>true</trackTransformationSteps>
50+
</configuration>
51+
</plugin>
52+
<plugin>
53+
<groupId>org.eolang</groupId>
54+
<artifactId>sodg-maven-plugin</artifactId>
55+
<version>@project.version@</version>
56+
<executions>
57+
<execution>
58+
<goals>
59+
<goal>sodg</goal>
60+
</goals>
61+
</execution>
62+
</executions>
63+
<configuration>
64+
<foreign>${project.build.directory}/eo/foreign.csv</foreign>
65+
<foreignFormat>csv</foreignFormat>
66+
<generateSodgXmlFiles>true</generateSodgXmlFiles>
67+
<generateXemblyFiles>true</generateXemblyFiles>
68+
<!--
69+
@todo #11:90min Enable 'graph' and 'dot' files generation
70+
In order to generate 'graph' and 'dot' files, we need to enable
71+
'generateGraphFiles' and 'generateDotFiles' options in the
72+
'sodg-maven-plugin' configuration (right below:)
73+
<generateGraphFiles>true</generateGraphFiles>
74+
<generateDotFiles>true</generateDotFiles>
75+
Currently, if we enable them, the plugin fails.
76+
-->
77+
</configuration>
78+
</plugin>
79+
</plugins>
80+
</build>
81+
</project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
+home https://github.com/objectionary/sodg-maven-plugin
3+
+package org.eolang.examples
4+
+version 0.0.0
5+
+spdx SPDX-FileCopyrightText Copyright (c) 2016-2025 Objectionary.com
6+
+spdx SPDX-License-Identifier: MIT
7+
8+
# Fibonacci numbers
9+
[n] > fibonacci
10+
if. > @
11+
lt
12+
n
13+
2
14+
n
15+
plus.
16+
^.fibonacci
17+
n.minus 1
18+
^.fibonacci
19+
n.minus 2
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com
3+
* SPDX-License-Identifier: MIT
4+
*/
5+
String log = new File(basedir, 'build.log').text;
6+
assert log.contains("BUILD SUCCESS"): assertionMessage("Build was not successful")
7+
8+
def generated = new File(basedir, 'target/eo/sodg/org/eolang/examples/')
9+
assert generated.toPath().resolve("fibonacci.sodg").toFile().exists(): assertionMessage("SODG file was not generated")
10+
assert generated.toPath().resolve("fibonacci.sodg.xe").toFile().exists(): assertionMessage("SODG Xembly file was not generated")
11+
assert generated.toPath().resolve("fibonacci.sodg.xml").toFile().exists(): assertionMessage("SODG XMIR file was not generated")
12+
13+
true
14+
15+
private String assertionMessage(String message) {
16+
return String.format(
17+
"'%s', you can find the entire log in the 'file://%s' file",
18+
message,
19+
new File(basedir, 'build.log').absolutePath)
20+
}

0 commit comments

Comments
 (0)