Skip to content

Commit

Permalink
Support SnakeYaml versions 1.15 through 2.0; update versions (#34)
Browse files Browse the repository at this point in the history
* Test multiple SnakeYaml versions so that the library can be used
  with any of them. However, 1.33 is officially declared.

Co-authored-by: BlackBaroness <57033600+BlackBaroness@users.noreply.github.com>
  • Loading branch information
A248 and BlackBaroness committed Jul 9, 2023
1 parent 3010352 commit 75389be
Show file tree
Hide file tree
Showing 19 changed files with 599 additions and 79 deletions.
16 changes: 3 additions & 13 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,20 @@ on:

jobs:
build:
# Credits to ViaVersion; this prevents the build from running twice
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Set up JDK 8 for toolchain
id: setup-java8
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: 8
distribution: 'zulu'
- name: Set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu'

cache: 'maven'
- name: Build with Maven
run: export JAVA8_HOME=${{ steps.setup-java8.outputs.path }} && mvn -B verify -Dgpg.skip=true --global-toolchains .github/workflows/toolchains.xml -Pgithub-workflow
29 changes: 2 additions & 27 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,39 +59,14 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>3.2.2</version>
<executions>
<execution>
<id>install-artifacts</id>
<goals>
<goal>install</goal>
</goals>
</execution>
<execution>
<id>test-api-consumers</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify-api-consumers</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<settingsFile>src/it/settings.xml</settingsFile>
<parallelThreads>2</parallelThreads>
<goals>verify</goals>
</configuration>
</plugin>
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.6.7</version>
<version>1.11.1</version>
<executions>
<execution>
<goals>
Expand All @@ -108,7 +83,7 @@
<dependency>
<groupId>org.pitest</groupId>
<artifactId>pitest-junit5-plugin</artifactId>
<version>0.14</version>
<version>1.1.2</version>
</dependency>
</dependencies>
</plugin>
Expand Down
2 changes: 1 addition & 1 deletion gson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
2 changes: 1 addition & 1 deletion hocon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<dependency>
<groupId>com.typesafe</groupId>
<artifactId>config</artifactId>
<version>1.4.1</version>
<version>1.4.2</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
58 changes: 42 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<junit.version>5.7.2</junit.version>
<mockito.version>3.11.0</mockito.version>
<equalsverifier.version>3.6.1</equalsverifier.version>
<junit.version>5.9.2</junit.version>
<mockito.version>5.1.1</mockito.version>
<equalsverifier.version>3.13.2</equalsverifier.version>
</properties>

<scm>
Expand Down Expand Up @@ -65,7 +65,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -78,7 +78,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.5.0</version>
<configuration>
<source>8</source>
<excludePackageNames>space.arim.dazzleconf.internal:space.arim.dazzleconf.internal.*</excludePackageNames>
Expand All @@ -96,7 +96,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version>
<version>3.2.1</version>
<executions>
<execution>
<id>enforce-rules</id>
Expand Down Expand Up @@ -126,7 +126,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -146,7 +146,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M1</version>
<version>3.0.0-M7</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<tagNameFormat>@{project.version}</tagNameFormat>
Expand All @@ -160,10 +160,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.10.1</version>
<configuration>
<!-- Compile module descriptor with Java 11 -->
<release>11</release>
<testRelease>17</testRelease>
</configuration>
<executions>
<!-- Compile everything else with Java 8 compatibility -->
Expand All @@ -179,19 +180,13 @@
</excludes>
</configuration>
</execution>
<execution>
<id>default-testCompile</id>
<configuration>
<release>16</release>
</configuration>
</execution>
</executions>
</plugin>
<!-- Testing -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<version>3.0.0-M9</version>
<configuration>
<trimStackTrace>false</trimStackTrace>
<argLine>-XX:TieredStopAtLevel=1 -XX:-TieredCompilation</argLine>
Expand All @@ -204,6 +199,37 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<id>install-artifacts</id>
<goals>
<goal>install</goal>
</goals>
</execution>
<execution>
<id>test-api-consumers</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify-api-consumers</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<settingsFile>src/it/settings.xml</settingsFile>
<goals>verify</goals>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down
9 changes: 8 additions & 1 deletion snakeyaml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
<parallelThreads>3</parallelThreads>
</configuration>
</plugin>
</plugins>
</build>

Expand All @@ -35,7 +42,7 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.28</version>
<version>1.33</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
35 changes: 35 additions & 0 deletions snakeyaml/src/it/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0"?>
<settings>
<profiles>
<profile>
<id>it-repo</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>local.central</id>
<url>@localRepositoryUrl@</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>local.central</id>
<url>@localRepositoryUrl@</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
65 changes: 65 additions & 0 deletions snakeyaml/src/it/snakeyaml-1.15/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<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">
<modelVersion>4.0.0</modelVersion>

<groupId>space.arim.dazzleconf</groupId>
<artifactId>dazzleconf-ext-snakeyaml-it-snakeyaml-1.15</artifactId>
<version>0.1.0-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<trimStackTrace>false</trimStackTrace>
</configuration>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>@junit.version@</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>space.arim.dazzleconf</groupId>
<artifactId>dazzleconf-core</artifactId>
<version>@project.version@</version>
</dependency>
<dependency>
<groupId>space.arim.dazzleconf</groupId>
<artifactId>dazzleconf-ext-snakeyaml</artifactId>
<version>@project.version@</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.15</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>@junit.version@</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* DazzleConf
* Copyright © 2023 Anand Beh
*
* DazzleConf is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DazzleConf is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with DazzleConf. If not, see <https://www.gnu.org/licenses/>
* and navigate to version 3 of the GNU Lesser General Public License.
*/

package space.arim.dazzleconf.ext.snakeyaml.it.snakeyaml_1_15;

import org.junit.jupiter.api.Test;
import space.arim.dazzleconf.ext.snakeyaml.SnakeYamlOptions;

import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;

public class SnakeYamlOptionsTest {

@Test
public void defaultOptions() {
assertDoesNotThrow(new SnakeYamlOptions.Builder().build().yamlSupplier()::get);
}

}
Loading

0 comments on commit 75389be

Please sign in to comment.