Skip to content

Commit d95de08

Browse files
author
Rob Tjalma
authored
Merge pull request #63 from com-pas/update-riseclipse
Update RiseClipse to latest version
2 parents 4b8e81b + 6a2b69c commit d95de08

File tree

21 files changed

+283
-72
lines changed

21 files changed

+283
-72
lines changed

.github/workflows/build-project.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,9 @@ jobs:
5050
with:
5151
output_file: custom_maven_settings.xml
5252
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
53-
- name: Build with Maven
53+
- name: Build with Maven (Pull Request)
54+
if: ${{ github.event_name == 'pull_request' }}
55+
run: ./mvnw -s custom_maven_settings.xml -B -Pjvm-image clean verify
56+
- name: Build with Maven (Push)
57+
if: ${{ github.event_name == 'push' }}
5458
run: ./mvnw -s custom_maven_settings.xml -B clean verify

.github/workflows/release-project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ jobs:
6666
./mvnw -B -s custom_maven_settings.xml \
6767
-DaltDeploymentRepository=github-packages-compas::default::https://maven.pkg.github.com/com-pas/compas-scl-validator \
6868
-Dmaven.deploy.skip=snapshots \
69-
-Prelease clean deploy
69+
-Pjvm-image,release clean deploy
7070
env:
7171
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitmodules

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,6 @@
66
# Remark: the option to ignore 'untracked' files is needed, because the submodules don't contain a file '.gitignore'.
77
# This cause the target directories to be untracked.
88
#
9-
[submodule "riseclipse/riseclipse-developer"]
10-
path = riseclipse/riseclipse-developer
11-
url = [email protected]:riseclipse/riseclipse-developer.git
12-
ignore = dirty
13-
[submodule "riseclipse/riseclipse-main"]
14-
path = riseclipse/riseclipse-main
15-
url = [email protected]:riseclipse/riseclipse-main.git
16-
ignore = dirty
17-
[submodule "riseclipse/riseclipse-metamodel-scl2003"]
18-
path = riseclipse/riseclipse-metamodel-scl2003
19-
url = [email protected]:riseclipse/riseclipse-metamodel-scl2003.git
20-
ignore = dirty
219
[submodule "riseclipse/riseclipse-ocl-constraints-scl2003"]
2210
path = riseclipse/riseclipse-ocl-constraints-scl2003
2311
url = [email protected]:riseclipse/riseclipse-ocl-constraints-scl2003.git

DEVELOPMENT.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,51 +8,50 @@ SPDX-License-Identifier: Apache-2.0
88

99
## Git
1010

11-
If the project is already cloned and a submodule is added use the following commands, first `git submodule init` and
12-
next `git submodule update`.
11+
If the project is already cloned and a submodule is added use the following commands to retrieve the files from the
12+
RiseClipse Repository:
13+
14+
- `git submodule init`
15+
- `git submodule update`
1316

1417
More about Git Submodules can be found [here](https://git-scm.com/book/en/v2/Git-Tools-Submodules).
1518

1619
**Remark**: The URLs to the submodules are configured in the file `.gitmodules`, but these are using the SSH URLs. There
1720
is a way described [here](https://git-scm.com/book/en/v2/Git-Tools-Submodules) that the URL can be overwritten locally
18-
with an HTTPS URL of the GIT Repository. Because of the subdirectory where the submodules are in, this doesn't work
19-
exactly that way. Use the following commands to update the URLs locally to HTTPS.
21+
with an HTTPS URL of the GIT Repository.
22+
23+
Because of the subdirectory where the submodules are in, this doesn't work exactly that way. Use the following commands
24+
to update the URLs locally to HTTPS.
2025

2126
```
22-
git config submodule.riseclipse/riseclipse-developer.url https://github.com/riseclipse/riseclipse-developer.git
23-
git config submodule.riseclipse/riseclipse-main.url https://github.com/riseclipse/riseclipse-main.git
24-
git config submodule.riseclipse/riseclipse-metamodel-scl2003.url https://github.com/riseclipse/riseclipse-metamodel-scl2003.git
2527
git config submodule.riseclipse/riseclipse-ocl-constraints-scl2003.url https://github.com/riseclipse/riseclipse-ocl-constraints-scl2003.git
2628
2729
git submodule init
2830
git submodule update
2931
```
3032

31-
## IntelliJ
33+
### Git update Submodules
3234

33-
Importing the project is a bit harder for the SCL Validator then normal. It's caused because of the submodules that are
34-
needed from RiseClipse. These projects are Eclipse projects using Eclipse Tycho to build and Eclipse project structure.
35+
A submodule in Git is fixed to a specific commit of the remote repository. To update the reference to the latest commit
36+
in the remote repository execute the following command from the root directory of the project.
3537

36-
The first step to make it work in IntelliJ is that an Eclipse version needs to be available on your local machine. The
37-
version we know that's working can be found [here](https://www.eclipse.org/downloads/packages/release/2019-06/r)
38-
Download (and install/unzip) Eclipse.
38+
```
39+
git submodule update --remote
40+
```
3941

40-
Next a way to make everything work in IntelliJ is importing the project in the following way.
42+
Next commit and push the changes to the Git Repository of CoMPAS. The build now uses the latest commit of the main
43+
branch.
4144

42-
- First step is to just import everything like it are Maven projects;
43-
- Next we need to add a Global Library in IntelliJ. Open the Module Settings and select "Global Libraries". And a new
44-
libraries and name it "ECLIPSE". Point it to the directory "<ECLIPSE_INSTALL_DIR>/plugins";
45-
- Next step is to re-import the RiseClipse Submodule as Eclipse;
46-
- In IntelliJ select "File" -> "New" -> "Module from Existing Sources...";
47-
- Select one of the RiseClipse Submodules, for instance "riseclipse-metamodel-scl2003";
48-
- Next select "Eclipse" by "Import module from External Model";
49-
- Follow the rest of the wizard, only to remember to select all subprojects that are available in the directory;
45+
## Eclipse
5046

51-
Now the module should be correctly imported in IntelliJ to be used. Check the Module Settings of one of the subprojects
52-
to check if the directory "src" is a Java Source Directory, for instance the module
53-
"riseclipse/riseclipse-metamodel-scl2003/fr.centralesupelec.edf.riseclipse.iec61850.scl.utilities".
47+
### Eclipse Dependencies
5448

55-
## Eclipse
49+
To make everything build and run Eclipse Dependencies are needed, but unlike the RiseClipse Dependencies these can't be
50+
found in the Maven Central Repository, but in an Eclipse P2 Repository. In RiseClipse there is a p2-to-m2 project that
51+
creates a local Maven Repository from the needed dependencies from the Eclipse P2 Repository. A CoMPAS Version of this
52+
maven module is created here, see [README.md](riseclipse/riseclipse-p2-to-m2/README.md) for more info.
53+
54+
### Eclipse OCL
5655

5756
Example about how to use Eclipse OCL was found
5857
[here](https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.ocl.doc%2Fhelp%2FPivotStandalone.html).

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ automatically determine the URL to be used.
2828

2929
## Development
3030

31-
For the RiseClipse implementation of the validator parts of the RiseClipse project are being used. Currently, these
32-
parts aren't distributed to any Maven Repository, so the Git Repositories need to be included. This is done using Git
33-
Submodules.
31+
Since version 1.2.x the JAR Files of RiseClipse are distributed through Maven Central Repository. The JAR Files can be
32+
retrieved from there and don't need to be build locally anymore. Only the OCL Files for the SCL validation still need to
33+
be downloaded from RiseClipse GIT Repository. This is still done using Git Submodules.
3434

3535
To clone the project or update the project this means that the Git commands are sometimes a little different. To clone
3636
the project use the following command `git clone --recurse-submodules [email protected]:com-pas/compas-scl-validator.git`.
3737
This will also clone the submodules.
3838

3939
Tip: The URL to the submodules are configured in the file `.gitmodules`, but these are using the SSH URL. There is a way
40-
described in the URL above that the URL can be overwritten locally with an HTTPS URL of the GIT Repository.
40+
described [here](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to overwrite the URL locally with an HTTPS URL of
41+
the GIT Repository.
4142

42-
Check the [Development](DEVELOPMENT.md) page for more detail information how to work with this repository, because of
43-
the mixture with RiseClipse.
43+
Check the [Development](DEVELOPMENT.md) page for more detail information how to develop in this GIT repository.
4444

4545
## Custom OCL Files
4646

app/pom.xml

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,50 @@ SPDX-License-Identifier: Apache-2.0
170170

171171
<profiles>
172172
<profile>
173-
<id>native</id>
173+
<id>jvm-image</id>
174174

175175
<properties>
176+
<!-- Make a Docker Image, so the integration tests will be executed against the container -->
177+
<quarkus.container-image.build>true</quarkus.container-image.build>
178+
</properties>
179+
180+
<build>
181+
<plugins>
182+
<plugin>
183+
<groupId>org.apache.maven.plugins</groupId>
184+
<artifactId>maven-failsafe-plugin</artifactId>
185+
<version>${surefire-plugin.version}</version>
186+
<executions>
187+
<execution>
188+
<goals>
189+
<goal>integration-test</goal>
190+
<goal>verify</goal>
191+
</goals>
192+
<configuration>
193+
<systemPropertyVariables>
194+
<java.util.logging.manager>
195+
org.jboss.logmanager.LogManager
196+
</java.util.logging.manager>
197+
<maven.home>${maven.home}</maven.home>
198+
</systemPropertyVariables>
199+
</configuration>
200+
</execution>
201+
</executions>
202+
</plugin>
203+
</plugins>
204+
</build>
205+
</profile>
206+
207+
<profile>
208+
<id>native-image</id>
209+
210+
<properties>
211+
<!-- Make a Docker Image, so the integration tests will be executed against the container -->
212+
<quarkus.container-image.build>true</quarkus.container-image.build>
213+
176214
<quarkus.package.type>native</quarkus.package.type>
177215
<!-- Allows for creating a Linux executable without GraalVM being installed -->
178216
<quarkus.native.container-build>true</quarkus.native.container-build>
179-
<!-- Also make a Docker Image, so the native test will be executed against the container -->
180-
<quarkus.container-image.build>true</quarkus.container-image.build>
181217
<quarkus.native.additional-build-args>
182218
--allow-incomplete-classpath
183219
</quarkus.native.additional-build-args>
@@ -228,7 +264,9 @@ SPDX-License-Identifier: Apache-2.0
228264
<id>release</id>
229265

230266
<properties>
267+
<!-- Make a Docker Image from the component -->
231268
<quarkus.container-image.build>true</quarkus.container-image.build>
269+
232270
<!-- Properties only used for publishing a native docker image (default to Docker Hub) -->
233271
<quarkus.container-image.push>true</quarkus.container-image.push>
234272
<quarkus.container-image.additional-tags>latest</quarkus.container-image.additional-tags>

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), 226);
17+
assertValidateOclFileCollector(new CompasOclFileCollector(null), 230);
1818
}
1919

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

app/src/test/java/org/lfenergy/compas/scl/validator/rest/NativeHealthCheckIT.java renamed to app/src/test/java/org/lfenergy/compas/scl/validator/rest/HealthCheckIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
import io.quarkus.test.junit.QuarkusIntegrationTest;
77

88
@QuarkusIntegrationTest
9-
class NativeHealthCheckIT extends HealthCheckTest {
9+
class HealthCheckIT extends HealthCheckTest {
1010
// Execute the same tests but in native mode.
1111
}

riseclipse/pom.xml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ SPDX-License-Identifier: Apache-2.0
1818
<packaging>pom</packaging>
1919

2020
<modules>
21-
<module>riseclipse-developer</module>
22-
<module>riseclipse-main</module>
23-
<module>riseclipse-metamodel-scl2003</module>
21+
<module>riseclipse-p2-to-m2</module>
2422
<module>validator-riseclipse</module>
2523
</modules>
2624

@@ -30,26 +28,31 @@ SPDX-License-Identifier: Apache-2.0
3028
<eclipse.emf.common.version>2.24.0</eclipse.emf.common.version>
3129
<eclipse.ocl.version>1.17.0</eclipse.ocl.version>
3230
<antlr.runtime.version>3.2.0</antlr.runtime.version>
33-
<riseclipse.version>1.1.0-SNAPSHOT</riseclipse.version>
3431

35-
<riseclipse.developer.root>${project.basedir}/riseclipse-developer</riseclipse.developer.root>
32+
<riseclipse.scl.version>1.2.3</riseclipse.scl.version>
33+
<riseclipse.main.version>1.2.5</riseclipse.main.version>
34+
35+
<riseclipse.p2.root>${project.basedir}/riseclipse-p2-to-m2</riseclipse.p2.root>
3636
</properties>
3737

3838
<repositories>
3939
<repository>
4040
<id>local-eclipse-p2-mirror</id>
41-
<url>
42-
file:///${riseclipse.developer.root}/fr.centralesupelec.edf.riseclipse.developer.p2_to_m2/target/maven/repository/final
43-
</url>
41+
<url>file:///${riseclipse.p2.root}/target/maven/repository/final</url>
4442
</repository>
4543
</repositories>
4644

4745
<dependencyManagement>
4846
<dependencies>
4947
<dependency>
50-
<groupId>fr.centralesupelec.edf.riseclipse</groupId>
48+
<groupId>io.github.riseclipse</groupId>
5149
<artifactId>fr.centralesupelec.edf.riseclipse.iec61850.scl</artifactId>
52-
<version>${riseclipse.version}</version>
50+
<version>${riseclipse.scl.version}</version>
51+
</dependency>
52+
<dependency>
53+
<groupId>io.github.riseclipse</groupId>
54+
<artifactId>fr.centralesupelec.edf.riseclipse.main</artifactId>
55+
<version>${riseclipse.main.version}</version>
5356
</dependency>
5457

5558
<dependency>

riseclipse/riseclipse-developer

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)