Skip to content

Commit

Permalink
Change DepClean version to SNAPSHOT
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarsotovalero committed Apr 6, 2022
1 parent 1c96de9 commit e1f510d
Show file tree
Hide file tree
Showing 21 changed files with 44 additions and 37 deletions.
4 changes: 2 additions & 2 deletions depclean-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<parent>
<groupId>se.kth.castor</groupId>
<artifactId>depclean-parent-pom</artifactId>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
</parent>

<!-- Coordinates -->
<artifactId>depclean-core</artifactId>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
<packaging>jar</packaging>
<description>Core library of DepClean</description>
<name>depclean-core</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@
import java.nio.file.Paths;
import java.util.jar.JarEntry;
import java.util.jar.JarInputStream;
import lombok.extern.slf4j.Slf4j;
import org.codehaus.plexus.util.DirectoryScanner;

/**
* Utility to visit classes in a library given either as a jar file or an exploded directory.
*/
@Slf4j
public final class ClassFileVisitorUtils {

private static final String[] CLASS_INCLUDES = {"**/*.class"};
Expand Down Expand Up @@ -92,7 +94,7 @@ private static void acceptJar(URL url, ClassFileVisitor visitor) {
}
}
} catch (IOException e) {
e.printStackTrace();
log.error("Error analyzing JAR: " + url);
}
}

Expand All @@ -112,12 +114,11 @@ private static void acceptDirectory(File directory, ClassFileVisitor visitor) {
scanner.scan();
String[] paths = scanner.getIncludedFiles();
for (String path : paths) {
path = path.replace(File.separatorChar, '/');
File file = new File(directory, path);
try (FileInputStream in = new FileInputStream(file)) {
visitClass(path, in, visitor);
} catch (IOException e) {
e.printStackTrace();
log.error("Error analyzing directory: " + directory.getAbsolutePath());
}
}
}
Expand Down Expand Up @@ -151,7 +152,7 @@ private static void visitClass(String path, InputStream in, ClassFileVisitor vis
}
path = getChild(path);
String className = path.substring(0, path.length() - CLASS.length());
className = className.replace('/', '.');
className = className.replace(File.separatorChar, '.');
visitor.visitClass(className, in);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@
import java.io.IOException;
import java.net.URL;
import java.util.Set;
import java.util.zip.ZipException;
import lombok.extern.slf4j.Slf4j;

/**
* The default class analyzer.
*/
@Slf4j
public class DefaultClassAnalyzer implements ClassAnalyzer {

/**
Expand All @@ -42,7 +43,7 @@ public Set<String> analyze(URL url) throws IOException {
try {
ClassFileVisitorUtils.accept(url, visitor);
} catch (Exception e) {
e.printStackTrace();
log.error("Error analyzing class file: " + url);
}
return visitor.getClasses();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -43,4 +44,9 @@ void getUsagesPerClass() {
usagesExpected.put("I", new HashSet<>(Arrays.asList("J")));
Assertions.assertEquals(usagesExpected, usagesPerClass);
}

@AfterEach
void tearDown() {
DefaultCallGraph.clear();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<!-- see https://github.com/castor-software/depclean -->
<groupId>se.kth.castor</groupId>
<artifactId>depclean-maven-plugin</artifactId>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
<executions>
<execution>
<goals>
Expand Down
4 changes: 2 additions & 2 deletions depclean-gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ repositories {
dependencies {
implementation(gradleApi())
implementation(gradleTestKit())
implementation('se.kth.castor:depclean-core:2.0.2')
implementation('se.kth.castor:depclean-maven-plugin:2.0.2')
implementation('se.kth.castor:depclean-core:2.0.3-SNAPSHOT')
implementation('se.kth.castor:depclean-maven-plugin:2.0.3-SNAPSHOT')
implementation('org.slf4j:slf4j-log4j12:1.7.30')
compileOnly('org.projectlombok:lombok:1.18.22')
annotationProcessor 'org.projectlombok:lombok:1.18.22'
Expand Down
6 changes: 3 additions & 3 deletions depclean-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<parent>
<groupId>se.kth.castor</groupId>
<artifactId>depclean-parent-pom</artifactId>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
</parent>

<!-- Coordinates -->
<artifactId>depclean-maven-plugin</artifactId>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>depclean-maven-plugin</name>

Expand All @@ -33,7 +33,7 @@
<dependency>
<groupId>se.kth.castor</groupId>
<artifactId>depclean-core</artifactId>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
</dependency>
<!--Maven tools for plugin construction-->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ public class MavenDependencyGraph implements DependencyGraph {
private final Set<Dependency> directDependencies;
private final Set<Dependency> inheritedDependencies;
private final Set<Dependency> transitiveDependencies;
private final Multimap<Dependency, Dependency> dependenciesPerDependency
= ArrayListMultimap.create();
private final Multimap<Dependency, Dependency> dependenciesPerDependency = ArrayListMultimap.create();

/**
* Create a maven dependency graph.
*
* @param project the maven project
* @param project the maven project
* @param rootNode the graph's root node
*/
public MavenDependencyGraph(MavenProject project, Model model, DependencyNode rootNode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<plugin>
<groupId>se.kth.castor</groupId>
<artifactId>depclean-maven-plugin</artifactId>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<plugin>
<groupId>se.kth.castor</groupId>
<artifactId>depclean-maven-plugin</artifactId>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<plugin>
<groupId>se.kth.castor</groupId>
<artifactId>depclean-maven-plugin</artifactId>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<plugin>
<groupId>se.kth.castor</groupId>
<artifactId>depclean-maven-plugin</artifactId>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<plugin>
<groupId>se.kth.castor</groupId>
<artifactId>depclean-maven-plugin</artifactId>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<plugin>
<groupId>se.kth.castor</groupId>
<artifactId>depclean-maven-plugin</artifactId>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<plugin>
<groupId>se.kth.castor</groupId>
<artifactId>depclean-maven-plugin</artifactId>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<plugin>
<groupId>se.kth.castor</groupId>
<artifactId>depclean-maven-plugin</artifactId>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<plugin>
<groupId>se.kth.castor</groupId>
<artifactId>depclean-maven-plugin</artifactId>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<plugin>
<groupId>se.kth.castor</groupId>
<artifactId>depclean-maven-plugin</artifactId>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<plugin>
<groupId>se.kth.castor</groupId>
<artifactId>depclean-maven-plugin</artifactId>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<plugin>
<groupId>se.kth.castor</groupId>
<artifactId>depclean-maven-plugin</artifactId>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
<executions>
<execution>
<goals>
Expand Down
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!-- Coordinates -->
<groupId>se.kth.castor</groupId>
<artifactId>depclean-parent-pom</artifactId>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -231,16 +231,16 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler.plugin.version}</version>
<version>3.10.1</version>
<configuration>
<release>8</release>
<release>17</release>
</configuration>
</plugin>
<!-- Maven source plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -254,7 +254,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc.plugin.version}</version>
<version>3.3.2</version>
<configuration>
<source>${javadoc.source}</source>
<doclint>none</doclint>
Expand All @@ -272,7 +272,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -287,7 +287,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<version>1.6.9</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand All @@ -300,7 +300,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<version>3.0.0-M5</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<useReleaseProfile>false</useReleaseProfile>
Expand Down

0 comments on commit e1f510d

Please sign in to comment.