Skip to content

Commit 0251a9c

Browse files
author
Dennis Labordus
authored
Merge pull request #84 from com-pas/develop
New release
2 parents c80598e + 8bf67d3 commit 0251a9c

File tree

16 files changed

+102
-112
lines changed

16 files changed

+102
-112
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ updates:
2727
schedule:
2828
interval: "daily"
2929
open-pull-requests-limit: 5
30+
ignore:
31+
# Next dependencies will be ignored, because they should stay in sync with the 'eclipse.aggr' versions.
32+
- dependency-name: org.eclipse.core:org.eclipse.core.resources
33+
- dependency-name: org.eclipse.emf:org.eclipse.emf.ecore
34+
- dependency-name: org.eclipse.emf:org.eclipse.emf.common
35+
- dependency-name: org.eclipse.ocl:org.eclipse.ocl.pivot
36+
- dependency-name: org.eclipse.ocl:org.eclipse.ocl.xtext.completeocl
37+
- dependency-name: org.eclipse.ocl:org.eclipse.ocl.xtext.oclstdlib
38+
- dependency-name: org.antlr.runtime:org.antlr.runtime
39+
- dependency-name: org.apache.log4j:org.apache.log4j
40+
- dependency-name: javax.inject:javax.inject
3041

3142
- package-ecosystem: "docker"
3243
directory: "/app/src/main/docker/"

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,16 @@ Image there is a volume `/data/ocl` which can be used to add these files, see ou
4949
example how to.
5050

5151
In this directory, you can use subdirectories like `SemanticConstraints` as RiseClipse is doing. And there is a special
52-
filter that when you create a directory `FileSpecifics`. In this directory you can create for instance a directory `CID`
53-
to put constraints specific for an SCL File Type. Known types are `SSD`, `IID`, `ICD`, `SCD`, `CID`, `SED`, `ISD`,
54-
`STD`.
52+
directory `FileSpecifics`. In this directory mostly file specific rules are added. There are functions that can be used
53+
in the OCL Rules to determine the type of file, like `isInICDFile()`.
5554

5655
For instance,
5756

5857
```
5958
data
6059
└── ocl
6160
├── FileSpecifics
62-
│ └── CID
63-
│ └── Busbar.ocl
61+
│ └── DOType.ocl
6462
└── SemanticConstraints
6563
└── Busbar.ocl
6664
```

app/src/test/java/org/lfenergy/compas/scl/validator/rest/CompasOclFileCollectorFromJarTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
class CompasOclFileCollectorFromJarTest extends AbstractCompasOclFileCollectorTest {
1515
@Test
1616
void getDefaultOclFiles_WhenCalledWithoutCustomDirectory_ThenListReturned() {
17-
assertValidateOclFileCollector(new CompasOclFileCollector(null), 230);
17+
assertValidateOclFileCollector(new CompasOclFileCollector(null), 212);
1818
}
1919

2020
@Test
2121
void getDefaultOclFiles_WhenCalledWithCustomDirectory_ThenListReturned() {
22-
assertValidateOclFileCollector(new CompasOclFileCollector("./src/test/data/ocl"), 231);
22+
assertValidateOclFileCollector(new CompasOclFileCollector("./src/test/data/ocl"), 213);
2323
}
2424
}

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ SPDX-License-Identifier: Apache-2.0
2121
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
2222

2323
<compiler-plugin.version>3.10.1</compiler-plugin.version>
24-
<surefire-plugin.version>3.0.0-M6</surefire-plugin.version>
24+
<surefire-plugin.version>3.0.0-M7</surefire-plugin.version>
2525
<sonarqube-plugin.version>3.2.0</sonarqube-plugin.version>
2626

2727
<compas.scl.xsd.version>0.0.4</compas.scl.xsd.version>
28-
<compas.core.version>0.9.0</compas.core.version>
28+
<compas.core.version>0.9.1</compas.core.version>
2929

30-
<quarkus.platform.version>2.9.0.Final</quarkus.platform.version>
30+
<quarkus.platform.version>2.10.1.Final</quarkus.platform.version>
3131
<slf4j.version>1.7.36</slf4j.version>
3232
<openpojo.version>0.9.1</openpojo.version>
3333
</properties>
@@ -163,7 +163,7 @@ SPDX-License-Identifier: Apache-2.0
163163
<plugin>
164164
<groupId>org.jboss.jandex</groupId>
165165
<artifactId>jandex-maven-plugin</artifactId>
166-
<version>1.2.2</version>
166+
<version>1.2.3</version>
167167
<executions>
168168
<execution>
169169
<id>make-index</id>

riseclipse/pom.xml

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,21 @@ SPDX-License-Identifier: Apache-2.0
2323
</modules>
2424

2525
<properties>
26-
<eclipse.core.resources.version>3.16.0</eclipse.core.resources.version>
27-
<eclipse.emf.ecore.version>2.26.0</eclipse.emf.ecore.version>
28-
<eclipse.emf.common.version>2.24.0</eclipse.emf.common.version>
26+
<!-- These versions aren't monitored by Dependabot and need to be in sync with the file 'eclipse.aggr'.
27+
When updating the file 'eclipse.aggr' also update these versions. But also check in the directory
28+
'riseclipse/riseclipse-p2-to-m2/target/maven/repository/final', because sometimes the downloaded
29+
version is newer.
30+
-->
31+
<eclipse.core.resources.version>3.17.0</eclipse.core.resources.version>
32+
<eclipse.emf.ecore.version>2.27.0</eclipse.emf.ecore.version>
33+
<eclipse.emf.common.version>2.25.0</eclipse.emf.common.version>
2934
<eclipse.ocl.version>1.17.0</eclipse.ocl.version>
3035
<antlr.runtime.version>3.2.0</antlr.runtime.version>
36+
<log4j.version>1.2.19</log4j.version>
37+
<javax.inject.version>1.0.0</javax.inject.version>
3138

32-
<riseclipse.scl.version>1.2.3</riseclipse.scl.version>
33-
<riseclipse.main.version>1.2.5</riseclipse.main.version>
39+
<riseclipse.main.version>1.2.6</riseclipse.main.version>
40+
<riseclipse.scl.version>1.2.5</riseclipse.scl.version>
3441

3542
<riseclipse.p2.root>${project.basedir}/riseclipse-p2-to-m2</riseclipse.p2.root>
3643
</properties>
@@ -46,13 +53,25 @@ SPDX-License-Identifier: Apache-2.0
4653
<dependencies>
4754
<dependency>
4855
<groupId>io.github.riseclipse</groupId>
49-
<artifactId>fr.centralesupelec.edf.riseclipse.iec61850.scl</artifactId>
50-
<version>${riseclipse.scl.version}</version>
56+
<artifactId>fr.centralesupelec.edf.riseclipse.main</artifactId>
57+
<version>${riseclipse.main.version}</version>
58+
<exclusions>
59+
<exclusion>
60+
<groupId>org.osgi</groupId>
61+
<artifactId>org.osgi.service.prefs</artifactId>
62+
</exclusion>
63+
</exclusions>
5164
</dependency>
5265
<dependency>
5366
<groupId>io.github.riseclipse</groupId>
54-
<artifactId>fr.centralesupelec.edf.riseclipse.main</artifactId>
55-
<version>${riseclipse.main.version}</version>
67+
<artifactId>fr.centralesupelec.edf.riseclipse.iec61850.scl</artifactId>
68+
<version>${riseclipse.scl.version}</version>
69+
<exclusions>
70+
<exclusion>
71+
<groupId>org.osgi</groupId>
72+
<artifactId>org.osgi.service.prefs</artifactId>
73+
</exclusion>
74+
</exclusions>
5675
</dependency>
5776

5877
<dependency>
@@ -114,6 +133,16 @@ SPDX-License-Identifier: Apache-2.0
114133
<artifactId>org.antlr.runtime</artifactId>
115134
<version>${antlr.runtime.version}</version>
116135
</dependency>
136+
<dependency>
137+
<groupId>org.apache.log4j</groupId>
138+
<artifactId>org.apache.log4j</artifactId>
139+
<version>${log4j.version}</version>
140+
</dependency>
141+
<dependency>
142+
<groupId>javax.inject</groupId>
143+
<artifactId>javax.inject</artifactId>
144+
<version>${javax.inject.version}</version>
145+
</dependency>
117146
</dependencies>
118147
</dependencyManagement>
119148
</project>

riseclipse/riseclipse-p2-to-m2/src/main/resources/riseclipse.aggr

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<aggregator:Aggregation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:aggregator="http://www.eclipse.org/cbi/p2repo/2011/aggregator/1.1.0" label="Eclipse Projects for RiseClipse" packedStrategy="UNPACK" mavenResult="true" versionFormat="MavenRelease">
33
<validationSets label="Eclipse needed projects for RiseClipse">
4-
<contributions label="Eclipse Platform 2021-12">
5-
<repositories location="https://download.eclipse.org/releases/2021-12/202112081000/">
4+
<contributions label="Eclipse Platform 2022-06">
5+
<repositories location="https://download.eclipse.org/releases/2022-06/202206151000/">
66
<bundles name="org.eclipse.core.commands" versionRange="3.10.100"/>
77
<bundles name="org.eclipse.core.contenttype" versionRange="3.8.100"/>
88
<bundles name="org.eclipse.core.jobs" versionRange="3.12.0"/>
@@ -13,44 +13,42 @@
1313
<bundles name="org.eclipse.equinox.preferences" versionRange="3.9.100"/>
1414
<bundles name="org.eclipse.equinox.registry" versionRange="3.11.100"/>
1515
<bundles name="org.eclipse.jdt.annotation" versionRange="2.2.600"/>
16-
<bundles name="org.eclipse.osgi.compatibility.state" versionRange="1.2.500"/>
16+
<bundles name="org.eclipse.osgi.compatibility.state" versionRange="1.2.600"/>
1717
<bundles name="org.eclipse.osgi" versionRange="3.17.100"/>
18+
<bundles name="org.apache.log4j" versionRange="1.2.19.v20220208-1728"/>
19+
<bundles name="com.google.guava" versionRange="30.1.0.v20210127-2300"/>
20+
<bundles name="com.google.inject" versionRange="5.0.1.v20210324-2015"/>
21+
<bundles name="javax.inject" versionRange="1.0.0.v20220405-0441"/>
22+
<bundles name="org.antlr.runtime" versionRange="3.2.0.v20220404-1927"/>
23+
<bundles name="org.aopalliance" versionRange="1.0.0.v20220404-1927"/>
1824
</repositories>
1925
</contributions>
20-
<contributions label="EMF 2.28">
21-
<repositories location="https://download.eclipse.org/releases/2021-12/202112081000/">
22-
<bundles name="org.eclipse.emf.common" versionRange="2.23.0"/>
23-
<bundles name="org.eclipse.emf.ecore" versionRange="2.25.0"/>
26+
<contributions label="EMF 2.30">
27+
<repositories location="https://download.eclipse.org/releases/2022-06/202206151000/">
28+
<bundles name="org.eclipse.emf.common" versionRange="2.25.0"/>
29+
<bundles name="org.eclipse.emf.ecore" versionRange="2.27.0"/>
2430
<bundles name="org.eclipse.emf.ecore.change" versionRange="2.14.0"/>
2531
<bundles name="org.eclipse.emf.ecore.xmi" versionRange="2.16.0"/>
26-
<bundles name="org.eclipse.emf.edit" versionRange="2.16.0"/>
32+
<bundles name="org.eclipse.emf.edit" versionRange="2.17.0"/>
2733
</repositories>
2834
</contributions>
29-
<contributions label="OCL 6.17.0">
30-
<repositories location="https://download.eclipse.org/releases/2021-12/202112081000/">
35+
<contributions label="OCL 6.17.1">
36+
<repositories location="https://download.eclipse.org/releases/2022-06/202206151000/">
3137
<bundles name="org.eclipse.ocl.common" versionRange="1.17.0"/>
3238
<bundles name="org.eclipse.ocl.pivot" versionRange="1.17.0"/>
3339
<bundles name="org.eclipse.ocl.xtext.base" versionRange="1.17.0"/>
3440
<bundles name="org.eclipse.ocl.xtext.completeocl" versionRange="1.17.0"/>
3541
<bundles name="org.eclipse.ocl.xtext.essentialocl" versionRange="1.17.0"/>
3642
<bundles name="org.eclipse.ocl.xtext.oclinecore" versionRange="1.17.0"/>
3743
<bundles name="org.eclipse.ocl.xtext.oclstdlib" versionRange="1.17.0"/>
38-
<bundles name="org.eclipse.xtext" versionRange="2.25.0"/>
44+
<bundles name="org.eclipse.xtext" versionRange="2.27.0"/>
3945
</repositories>
4046
</contributions>
4147
<contributions label="From Orbit">
42-
<repositories location="https://download.eclipse.org/tools/orbit/downloads/drops/R20211213173813/repository">
43-
<bundles name="com.google.guava" versionRange="30.1.0"/>
44-
<bundles name="com.google.inject" versionRange="5.0.1"/>
45-
<bundles name="javax.inject" versionRange="1.0.0"/>
46-
<bundles name="org.antlr.runtime" versionRange="[3.2.0,3.3.0)"/>
47-
<bundles name="org.apache.commons.lang3" versionRange="3.1.0"/>
48-
<bundles name="org.apache.log4j" versionRange="1.2.15"/>
48+
<repositories location="https://download.eclipse.org/tools/orbit/downloads/drops/R20220531185310/repository">
4949
<bundles name="org.apache.commons.cli" versionRange="1.4.0"/>
5050
</repositories>
5151
</contributions>
52-
<validationRepositories location="https://download.eclipse.org/releases/2021-12/202112081000/"/>
53-
<validationRepositories location="https://download.eclipse.org/tools/orbit/downloads/drops/R20211213173813/repository"/>
5452
</validationSets>
5553
<configurations architecture="x86_64"/>
5654
<configurations operatingSystem="linux" windowSystem="gtk" architecture="x86_64"/>

riseclipse/validator-riseclipse/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ SPDX-License-Identifier: Apache-2.0
6767
<groupId>org.antlr.runtime</groupId>
6868
<artifactId>org.antlr.runtime</artifactId>
6969
</dependency>
70+
<dependency>
71+
<groupId>org.apache.log4j</groupId>
72+
<artifactId>org.apache.log4j</artifactId>
73+
</dependency>
74+
<dependency>
75+
<groupId>javax.inject</groupId>
76+
<artifactId>javax.inject</artifactId>
77+
</dependency>
7078

7179
<!-- Test Dependencies -->
7280
<dependency>

riseclipse/validator-riseclipse/src/main/java/org/lfenergy/compas/scl/validator/impl/OclFileLoader.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
import org.eclipse.ocl.pivot.utilities.OCL;
1212
import org.eclipse.ocl.pivot.validation.ComposedEValidator;
1313
import org.eclipse.ocl.xtext.completeocl.validation.CompleteOCLEObjectValidator;
14-
import org.lfenergy.compas.scl.extensions.model.SclFileType;
1514
import org.lfenergy.compas.scl.validator.exception.SclValidatorException;
16-
import org.lfenergy.compas.scl.validator.util.OclUtil;
1715
import org.slf4j.Logger;
1816
import org.slf4j.LoggerFactory;
1917

@@ -55,9 +53,8 @@ public OclFileLoader(Path tempDirectoryPath, List<URI> oclFiles) {
5553
}
5654
}
5755

58-
public void loadOCLDocuments(SclFileType type) {
56+
public void loadOCLDocuments() {
5957
oclFiles.stream()
60-
.filter(uri -> OclUtil.includeOnType(uri, type))
6158
.forEach(this::addOCLDocument);
6259
}
6360

riseclipse/validator-riseclipse/src/main/java/org/lfenergy/compas/scl/validator/impl/SclModelLoader.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import org.eclipse.emf.common.util.URI;
99
import org.eclipse.emf.ecore.resource.Resource;
1010
import org.eclipse.emf.ecore.resource.ResourceSet;
11+
import org.lfenergy.compas.scl.extensions.model.SclFileType;
1112
import org.lfenergy.compas.scl.validator.exception.SclValidatorException;
1213
import org.slf4j.Logger;
1314
import org.slf4j.LoggerFactory;
@@ -33,11 +34,12 @@ public SclModelLoader() {
3334
.put(Resource.Factory.Registry.DEFAULT_EXTENSION, new SclResourceFactoryImpl());
3435
}
3536

36-
public Resource load(String sclData) {
37+
public Resource load(String sclData, SclFileType type) {
3738
LOGGER.debug("Loading SCL Data in RiseClipse.");
3839
try {
39-
UUID uuid = UUID.randomUUID();
40-
Resource resource = resourceSet.createResource(URI.createURI(uuid.toString()));
40+
// Make a fake filename, but the extension is used by the OCL Rules to determine the Type of SCL File.
41+
var filename = UUID.randomUUID().toString() + "." + type.name();
42+
var resource = resourceSet.createResource(URI.createURI(filename));
4143
resource.load(new ByteArrayInputStream(sclData.getBytes(StandardCharsets.UTF_8)), new HashMap<>());
4244
return resource;
4345
} catch (Exception exp) {

0 commit comments

Comments
 (0)