Skip to content

Commit

Permalink
getters + versioning (#27)
Browse files Browse the repository at this point in the history
- bugfix for pointSet
- bugfix for ContactElement creation
  • Loading branch information
valentin-gauthier-geosiris authored Sep 25, 2024
1 parent a0002c2 commit 7cd3ff9
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 17 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
packages: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
Expand All @@ -33,14 +33,14 @@ jobs:
name: Install gpg secret key
run: cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import

- name: Change version to tag name
run: mvn versions:set -DnewVersion="${{ github.event.release.tag_name }}"
# - name: Change version to tag name
# run: mvn versions:set -DnewVersion="${{ github.event.release.tag_name }}"

- name: Unit test
run: mvn -B --file pom.xml clean test -P test

- name: Build with Maven
run: mvn -B --file pom.xml clean deploy -P release
run: mvn -B --file pom.xml clean deploy -P release -Dchangelist= -Drevision="${{ github.event.release.tag_name }}"
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/pull-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
packages: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
Expand All @@ -30,8 +30,20 @@ jobs:
name: Install gpg secret key
run: cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import

# - name: Change version to SHA name
# run: mvn versions:set -Dsha1=-"${{ github.sha }}"

- name: Unit test
run: |
PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "jar_version=${PROJECT_VERSION}" >> $GITHUB_OUTPUT
mvn -B --file pom.xml clean test -P test
mvn -B --file pom.xml clean test -P test
- name: Build with Maven
run: mvn -B --file pom.xml clean deploy -P release
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
GITHUB_TOKEN: ${{ github.token }}

50 changes: 43 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.geosiris</groupId>
<artifactId>energyml-utils</artifactId>
<name>${project.groupId}:${project.artifactId}</name>
<version>1.0.12</version>
<version>${revision}${sha1}${changelist}</version>
<organization>
<name>Geosiris</name>
<url>http://www.geosiris.com</url>
Expand Down Expand Up @@ -43,6 +43,10 @@
<test.dir>${project.basedir}/src/test</test.dir>
<sonar.organization>geosiris-technologies</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<revision>1.0.13</revision>
<changelist>-SNAPSHOT</changelist>
<sha1/>
<nameSuffix/>
</properties>
<dependencies>
<dependency>
Expand All @@ -66,6 +70,11 @@
<artifactId>gson</artifactId>
<version>2.10</version>
</dependency>
<dependency>
<groupId>io.jhdf</groupId>
<artifactId>jhdf</artifactId>
<version>0.6.10</version>
</dependency>
<!-- LOGS -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
Expand Down Expand Up @@ -114,12 +123,6 @@
<version>1.0.4</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.jhdf</groupId>
<artifactId>jhdf</artifactId>
<version>0.6.10</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down Expand Up @@ -148,6 +151,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down Expand Up @@ -226,6 +230,38 @@
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.1</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.9.1</version>
</dependency>
<dependency>
<groupId>com.geosiris</groupId>
<artifactId>energyml-resqml22</artifactId>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>com.geosiris</groupId>
<artifactId>energyml-resqml22-dev3</artifactId>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>com.geosiris</groupId>
<artifactId>energyml-resqml201</artifactId>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>com.geosiris</groupId>
<artifactId>energyml-witsml21</artifactId>
<version>1.0.4</version>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
10 changes: 10 additions & 0 deletions src/main/java/com/geosiris/energyml/data/AbstractMesh.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,22 @@ public abstract class AbstractMesh implements MeshExporter{
public abstract Long getNbPoints();
public abstract Long getNbEdge();
public abstract Long getNbFaces();

public List<?> getPointList(){
return pointList;
}

public String getIdentifier() {
return identifier;
}

public abstract List<List<Long>> getEdgeIndices();

public Object getEnergymlObject() {
return energymlObject;
}

public Object getCrsObject() {
return crsObject;
}
}
6 changes: 6 additions & 0 deletions src/main/java/com/geosiris/energyml/data/Mesh.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ public static List<PointSetMesh> readPointRepresentation(Object energymlObject,
try {
crs = getCrsObj(pointsObj, pointsPathInObj, energymlObject, workspace);
} catch (ObjectNotFoundNotError ignore) {}

if(isZReversed(crs)){
points.forEach(l->l.set(2, -l.get(2)));
}

meshes.add(new PointSetMesh(
energymlObject,
crs,
Expand Down Expand Up @@ -140,6 +145,7 @@ public static List<PointSetMesh> readPointRepresentation(Object energymlObject,
try {
crs = getCrsObj(pointsObj, pointsPathInObj, energymlObject, workspace);
} catch (ObjectNotFoundNotError ignore) {}

meshes.add(new PointSetMesh(
energymlObject,
crs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,7 @@ public Object modifyNewInstance(Object instance, Map<String, Object> epcObjects,
logger.error("Modifying instance " + instance);
if (instance != null) {
String objClassNameLower = instance.getClass().getName().toLowerCase();
if (objClassNameLower.endsWith("dataobjectreference")
|| objClassNameLower.endsWith("contactelementreference")) {
if (ObjectController.hasSuperClassSuffix(instance.getClass(), "DataObjectReference")) {
// value must be an uuid
try {
ObjectController.editObjectAttribute(instance, "uuid", value);
Expand Down

0 comments on commit 7cd3ff9

Please sign in to comment.