Skip to content
This repository was archived by the owner on Dec 9, 2022. It is now read-only.

Commit cf7c61a

Browse files
committed
Release the version 1.0 of io.github.dustalov.maxmax
1 parent f3a2cde commit cf7c61a

6 files changed

Lines changed: 46 additions & 30 deletions

File tree

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ sudo: false
22
language: java
33
jdk:
44
- oraclejdk8
5+
- oraclejdk9
56
before_script:
67
- mvn versions:display-dependency-updates versions:display-plugin-updates
78
cache:

pom.xml

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
<groupId>io.github.dustalov</groupId>
2525
<artifactId>maxmax</artifactId>
26-
<version>1.0-SNAPSHOT</version>
26+
<version>1.0</version>
2727
<packaging>jar</packaging>
2828

2929
<inceptionYear>2016</inceptionYear>
@@ -41,10 +41,6 @@
4141
</developer>
4242
</developers>
4343

44-
<prerequisites>
45-
<maven>3.0</maven>
46-
</prerequisites>
47-
4844
<properties>
4945
<java.version>1.8</java.version>
5046
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -63,12 +59,12 @@
6359
<dependency>
6460
<groupId>commons-cli</groupId>
6561
<artifactId>commons-cli</artifactId>
66-
<version>1.3.1</version>
62+
<version>1.4</version>
6763
</dependency>
6864
<dependency>
6965
<groupId>org.jgrapht</groupId>
7066
<artifactId>jgrapht-core</artifactId>
71-
<version>1.0.0</version>
67+
<version>1.1.0</version>
7268
</dependency>
7369
<dependency>
7470
<groupId>junit</groupId>
@@ -84,12 +80,30 @@
8480
<plugin>
8581
<groupId>org.codehaus.mojo</groupId>
8682
<artifactId>versions-maven-plugin</artifactId>
87-
<version>2.3</version>
83+
<version>2.5</version>
84+
</plugin>
85+
<plugin>
86+
<groupId>org.apache.maven.plugins</groupId>
87+
<artifactId>maven-enforcer-plugin</artifactId>
88+
<version>1.4.1</version>
89+
<executions>
90+
<execution>
91+
<id>enforce</id>
92+
<configuration>
93+
<rules>
94+
<DependencyConvergence/>
95+
</rules>
96+
</configuration>
97+
<goals>
98+
<goal>enforce</goal>
99+
</goals>
100+
</execution>
101+
</executions>
88102
</plugin>
89103
<plugin>
90104
<groupId>org.apache.maven.plugins</groupId>
91105
<artifactId>maven-compiler-plugin</artifactId>
92-
<version>3.5.1</version>
106+
<version>3.7.0</version>
93107
<configuration>
94108
<source>${java.version}</source>
95109
<target>${java.version}</target>
@@ -114,7 +128,7 @@
114128
<plugin>
115129
<groupId>org.apache.maven.plugins</groupId>
116130
<artifactId>maven-shade-plugin</artifactId>
117-
<version>2.4.3</version>
131+
<version>3.1.0</version>
118132
<configuration>
119133
<createDependencyReducedPom>true</createDependencyReducedPom>
120134
<filters>
@@ -136,8 +150,10 @@
136150
</goals>
137151
<configuration>
138152
<transformers>
139-
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
140-
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
153+
<transformer
154+
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
155+
<transformer
156+
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
141157
<mainClass>io.github.dustalov.maxmax.Application</mainClass>
142158
</transformer>
143159
</transformers>
@@ -153,7 +169,7 @@
153169
<plugin>
154170
<groupId>org.apache.maven.plugins</groupId>
155171
<artifactId>maven-javadoc-plugin</artifactId>
156-
<version>2.10.4</version>
172+
<version>3.0.0</version>
157173
</plugin>
158174
</plugins>
159175
</reporting>

src/main/java/io/github/dustalov/maxmax/ABCParser.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717

1818
package io.github.dustalov.maxmax;
1919

20-
import org.jgrapht.UndirectedGraph;
20+
import org.jgrapht.Graph;
2121
import org.jgrapht.graph.DefaultWeightedEdge;
2222
import org.jgrapht.graph.SimpleWeightedGraph;
23-
import org.jgrapht.graph.builder.UndirectedWeightedGraphBuilderBase;
23+
import org.jgrapht.graph.builder.GraphBuilder;
2424

2525
import java.util.stream.Stream;
2626

2727
interface ABCParser {
28-
static UndirectedGraph<String, DefaultWeightedEdge> parse(Stream<String> stream) {
29-
final UndirectedWeightedGraphBuilderBase<String, DefaultWeightedEdge, ? extends SimpleWeightedGraph<String, DefaultWeightedEdge>, ?> builder = SimpleWeightedGraph.builder(DefaultWeightedEdge.class);
28+
static Graph<String, DefaultWeightedEdge> parse(Stream<String> stream) {
29+
final GraphBuilder<String, DefaultWeightedEdge, ? extends SimpleWeightedGraph<String, DefaultWeightedEdge>> builder = SimpleWeightedGraph.<String, DefaultWeightedEdge>createBuilder(DefaultWeightedEdge.class);
3030

3131
stream.forEach(line -> {
3232
final String[] split = line.split("\t");
@@ -35,6 +35,6 @@ static UndirectedGraph<String, DefaultWeightedEdge> parse(Stream<String> stream)
3535
builder.addEdge(split[0], split[1], Double.valueOf(split[2]));
3636
});
3737

38-
return builder.buildUnmodifiable();
38+
return builder.build();
3939
}
4040
}

src/main/java/io/github/dustalov/maxmax/Application.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
package io.github.dustalov.maxmax;
1919

2020
import org.apache.commons.cli.*;
21-
import org.jgrapht.UndirectedGraph;
21+
import org.jgrapht.Graph;
2222
import org.jgrapht.graph.DefaultWeightedEdge;
2323

2424
import java.io.BufferedWriter;
@@ -48,7 +48,7 @@ public static void main(String[] args) throws IOException {
4848
System.exit(1);
4949
}
5050

51-
final UndirectedGraph<String, DefaultWeightedEdge> graph = parse(cmd.getOptionValue("in"), ABCParser::parse);
51+
final Graph<String, DefaultWeightedEdge> graph = parse(cmd.getOptionValue("in"), ABCParser::parse);
5252
final MaxMax<String> maxmax = new MaxMax<>(graph);
5353
maxmax.run();
5454
write(cmd.getOptionValue("out"), maxmax);

src/main/java/io/github/dustalov/maxmax/MaxMax.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717

1818
package io.github.dustalov.maxmax;
1919

20-
import org.jgrapht.DirectedGraph;
20+
import org.jgrapht.Graph;
2121
import org.jgrapht.Graphs;
22-
import org.jgrapht.UndirectedGraph;
2322
import org.jgrapht.graph.DefaultDirectedGraph;
2423
import org.jgrapht.graph.DefaultEdge;
2524
import org.jgrapht.graph.DefaultWeightedEdge;
@@ -34,12 +33,12 @@
3433
* @param <V> node class.
3534
*/
3635
public class MaxMax<V> implements Runnable {
37-
private final UndirectedGraph<V, DefaultWeightedEdge> graph;
38-
private final DirectedGraph<V, DefaultEdge> digraph;
36+
private final Graph<V, DefaultWeightedEdge> graph;
37+
private final Graph<V, DefaultEdge> digraph;
3938
private final Map<V, Set<V>> maximals;
4039
private final Map<V, Boolean> roots;
4140

42-
public MaxMax(UndirectedGraph<V, DefaultWeightedEdge> graph) {
41+
public MaxMax(Graph<V, DefaultWeightedEdge> graph) {
4342
this.graph = graph;
4443
this.digraph = new DefaultDirectedGraph<>(DefaultEdge.class);
4544
this.graph.vertexSet().forEach(digraph::addVertex);
@@ -82,11 +81,11 @@ public void run() {
8281
});
8382
}
8483

85-
public UndirectedGraph<V, DefaultWeightedEdge> getGraph() {
84+
public Graph<V, DefaultWeightedEdge> getGraph() {
8685
return graph;
8786
}
8887

89-
public DirectedGraph<V, DefaultEdge> getDigraph() {
88+
public Graph<V, DefaultEdge> getDigraph() {
9089
return digraph;
9190
}
9291

src/test/java/io/github/dustalov/maxmax/MaxMaxTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
package io.github.dustalov.maxmax;
1919

20-
import org.jgrapht.UndirectedGraph;
20+
import org.jgrapht.Graph;
2121
import org.jgrapht.graph.DefaultWeightedEdge;
2222
import org.jgrapht.graph.SimpleWeightedGraph;
2323
import org.junit.Before;
@@ -31,7 +31,7 @@
3131
import static org.junit.Assert.assertEquals;
3232

3333
public class MaxMaxTest {
34-
final static UndirectedGraph<String, DefaultWeightedEdge> GRAPH1 = SimpleWeightedGraph.<String, DefaultWeightedEdge>builder(DefaultWeightedEdge.class).
34+
final static Graph<String, DefaultWeightedEdge> GRAPH1 = SimpleWeightedGraph.<String, DefaultWeightedEdge>createBuilder(DefaultWeightedEdge.class).
3535
addVertices("r", "s", "u", "v", "t", "w", "x").
3636
addEdge("r", "s", 3).
3737
addEdge("r", "v", 1).
@@ -56,7 +56,7 @@ public class MaxMaxTest {
5656
new HashSet<>(Arrays.asList("w", "t", "x"))
5757
)));
5858

59-
final static UndirectedGraph<String, DefaultWeightedEdge> GRAPH2 = SimpleWeightedGraph.<String, DefaultWeightedEdge>builder(DefaultWeightedEdge.class).
59+
final static Graph<String, DefaultWeightedEdge> GRAPH2 = SimpleWeightedGraph.<String, DefaultWeightedEdge>createBuilder(DefaultWeightedEdge.class).
6060
addVertices("a", "b", "c", "d", "e").
6161
addEdge("a", "b", 3).
6262
addEdge("b", "c", 1).

0 commit comments

Comments
 (0)