3 Commits 2eca09431f ... 832ff20c6a

Autor SHA1 Nachricht Datum
  Wojciech Karpiel 832ff20c6a v 0.8 snapshot vor 1 Jahr
  Wojciech Karpiel 2af9f6d0ce v 0.7 vor 1 Jahr
  Wojciech Karpiel f17ab018db search limit pub vor 1 Jahr
4 geänderte Dateien mit 103 neuen und 48 gelöschten Zeilen
  1. 4 0
      CHANGELOG.md
  2. 7 18
      README.md
  3. 83 28
      pom.xml
  4. 9 2
      src/main/java/pl/wojciechkarpiel/jhou/unifier/SolutionIterator.java

+ 4 - 0
CHANGELOG.md

@@ -1,5 +1,9 @@
 # Changelog
 
+## 0.7
+
+* Change publishing site to Maven Central
+
 ## 0.6
 
 * Bugfix: Matching procedure provided projections which mismatched the type of the flexible variable

+ 7 - 18
README.md

@@ -11,26 +11,15 @@ The implementation based on
 Add following dependency to your project
 
 ```xml
-<project>
-  <repositories>
-    <repository>
-      <id>jitpack.io</id>
-      <url>https://jitpack.io</url>
-    </repository>
-  </repositories>
-  <dependencies>
-    <dependency>
-      <groupId>com.github.WojciechKarpiel</groupId>
-      <artifactId>jhou</artifactId>
-      <version>v0.6</version>
-    </dependency>
-  </dependencies>
-</project>
+<dependency>
+  <groupId>pl.wojciechkarpiel</groupId>
+  <artifactId>jhou</artifactId>
+  <version>0.7</version>
+</dependency>
 ```
 
-If you're using other build tool (Gradle, SBT, Leiningen),
-[here](https://jitpack.io/#WojciechKarpiel/jhou)
-are the configuration snippets. `v0.6` is the newest release.
+For other build tools (SBT, Gradle, Leiningen) see the configuration snippets
+[here](https://central.sonatype.com/artifact/pl.wojciechkarpiel/jhou)
 
 ## Usage
 

+ 83 - 28
pom.xml

@@ -6,7 +6,7 @@
 
     <groupId>pl.wojciechkarpiel</groupId>
     <artifactId>jhou</artifactId>
-    <version>0.7-SNAPSHOT</version>
+    <version>0.8-SNAPSHOT</version>
     <packaging>jar</packaging>
 
     <name>${project.groupId}:${project.artifactId}</name>
@@ -44,37 +44,92 @@
         <dependency>
             <groupId>org.junit.jupiter</groupId>
             <artifactId>junit-jupiter</artifactId>
-            <version>5.8.1</version>
+            <version>5.9.2</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
 
-    <!--
-      unusable until https://github.com/orgs/community/discussions/26634 is solved
-      Usage:
-      <project>
-        <dependencies>
-          <dependency>
-            <groupId>pl.wojciechkarpiel</groupId>
-            <artifactId>jhou</artifactId>
-            <version>0.3</version>
-          </dependency>
-        </dependencies>
-        <repositories>
-          <repository>
-            <id>github-jhou</id>
-            <name>GitHub WojciechKarpiel Apache Maven Packages</name>
-            <url>https://maven.pkg.github.com/WojciechKarpiel/jhou</url>
-          </repository>
-        </repositories>
-      </project>
-     -->
+    <!-- Stuff below is copypasted from https://central.sonatype.org/publish/publish-maven/ -->
     <distributionManagement>
-        <repository>
-            <id>github-jhou</id>
-            <name>GitHub WojciechKarpiel Apache Maven Packages</name>
-            <url>https://maven.pkg.github.com/WojciechKarpiel/jhou</url>
-        </repository>
+        <snapshotRepository>
+            <id>ossrh</id>
+            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
+        </snapshotRepository>
     </distributionManagement>
-
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.sonatype.central</groupId>
+                <artifactId>central-publishing-maven-plugin</artifactId>
+                <version>0.3.0</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <publishingServerId>central</publishingServerId>
+                    <tokenAuth>true</tokenAuth>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.sonatype.plugins</groupId>
+                <artifactId>nexus-staging-maven-plugin</artifactId>
+                <version>1.6.7</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <serverId>ossrh</serverId>
+                    <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
+                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+                <version>2.2.1</version>
+                <executions>
+                    <execution>
+                        <id>attach-sources</id>
+                        <goals>
+                            <goal>jar-no-fork</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <version>2.9.1</version>
+                <executions>
+                    <execution>
+                        <id>attach-javadocs</id>
+                        <goals>
+                            <goal>jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-gpg-plugin</artifactId>
+                <version>1.5</version>
+                <executions>
+                    <execution>
+                        <id>sign-artifacts</id>
+                        <phase>verify</phase>
+                        <goals>
+                            <goal>sign</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-release-plugin</artifactId>
+                <version>2.5.3</version>
+                <configuration>
+                    <autoVersionSubmodules>true</autoVersionSubmodules>
+                    <useReleaseProfile>false</useReleaseProfile>
+                    <releaseProfiles>release</releaseProfiles>
+                    <goals>deploy</goals>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>

+ 9 - 2
src/main/java/pl/wojciechkarpiel/jhou/unifier/SolutionIterator.java

@@ -50,7 +50,7 @@ public class SolutionIterator implements Iterator<Substitution> {
     }
 
     private boolean couldExpand() {
-        if (expansionsSoFar >= maxSearchDepth) {
+        if (searchLimitReached()) {
             printStream.println("Max search depth reached, aborting");
             return false;
         }
@@ -58,7 +58,7 @@ public class SolutionIterator implements Iterator<Substitution> {
     }
 
     private void doExpand() {
-        if (expansionsSoFar >= maxSearchDepth) {
+        if (searchLimitReached()) {
             throw new MaxSearchDepthExceededException();
         }
         expansionsSoFar++;
@@ -104,4 +104,11 @@ public class SolutionIterator implements Iterator<Substitution> {
             throw new NoSuchElementException();
         }
     }
+
+    /**
+     * @return true if further search is not performed because of reaching the max search depth
+     */
+    public boolean searchLimitReached() {
+        return expansionsSoFar >= maxSearchDepth;
+    }
 }