-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d4dc86
commit f6527f8
Showing
7 changed files
with
7 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ target/ | |
build/ | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
/Resources/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,8 @@ | ||
package se.kth.breaking_changes; | ||
|
||
import se.kth.japianalysis.BreakingChange; | ||
|
||
import java.nio.file.Path; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
public class Main { | ||
|
||
public static void main(String[] args) { | ||
|
||
ApiMetadata apiMetadata = new ApiMetadata(Path.of("/Users/frank/Documents/Work/PHD/Explaining/breaking-good/projects/0abf7148300f40a1da0538ab060552bca4a2f1d8/jasperreports-6.18.1.jar")); | ||
ApiMetadata apiMetadata1 = new ApiMetadata(Path.of("/Users/frank/Documents/Work/PHD/Explaining/breaking-good/projects/0abf7148300f40a1da0538ab060552bca4a2f1d8/jasperreports-6.19.1.jar")); | ||
|
||
|
||
JApiCmpAnalyze jApiCmpAnalyze = new JApiCmpAnalyze( | ||
apiMetadata, | ||
apiMetadata1 | ||
); | ||
|
||
|
||
// Set<ApiChange> apiChanges = jApiCmpAnalyze.useJApiCmp(); | ||
|
||
List<BreakingChange> apiChanges = jApiCmpAnalyze.useJApiCmp_v2(); | ||
|
||
|
||
|
||
System.out.println("Number of changes: " + apiChanges.size()); | ||
|
||
// for (ApiChange apiChange : apiChanges) { | ||
// System.out.println(apiChange); | ||
// } | ||
|
||
|
||
// List<BreakingUpdateMetadata> list = | ||
// getBreakingCommit(Path.of("/Users/frank/Documents/Work/PHD/chains-project/paper/bump/data/benchmark")); | ||
// | ||
// | ||
// for (BreakingUpdateMetadata breakingUpdate : list) { | ||
// boolean result = ApiMetadata.download(breakingUpdate.updatedDependency().dependencyGroupID(), | ||
// breakingUpdate.updatedDependency().dependencyArtifactID(), | ||
// breakingUpdate.updatedDependency().newVersion()); | ||
// | ||
// if (result) { | ||
// System.out.println("Downloaded " + breakingUpdate.updatedDependency().dependencyArtifactID() + "-" + breakingUpdate.updatedDependency().newVersion()); | ||
// } else { | ||
// System.out.println("Failed to download " + breakingUpdate.updatedDependency().dependencyArtifactID() + "-" + breakingUpdate.updatedDependency().newVersion()); | ||
// } | ||
// | ||
// result = ApiMetadata.download(breakingUpdate.updatedDependency().dependencyGroupID(), | ||
// breakingUpdate.updatedDependency().dependencyArtifactID(), | ||
// breakingUpdate.updatedDependency().previousVersion()); | ||
// | ||
// if (result) { | ||
// System.out.println("Downloaded " + breakingUpdate.updatedDependency().dependencyArtifactID() + "-" + breakingUpdate.updatedDependency().newVersion()); | ||
// } else { | ||
// System.out.println("Failed to download " + breakingUpdate.updatedDependency().dependencyArtifactID() + "-" + breakingUpdate.updatedDependency().newVersion()); | ||
// } | ||
|
||
// } | ||
|
||
|
||
System.out.println("Hello World"); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,9 @@ | ||
package se.kth.core; | ||
|
||
import se.kth.breaking_changes.ApiChange; | ||
import se.kth.breaking_changes.ApiMetadata; | ||
import se.kth.breaking_changes.JApiCmpAnalyze; | ||
import se.kth.explaining.CompilationErrorTemplate; | ||
import se.kth.explaining.ExplanationTemplate; | ||
import se.kth.log_Analyzer.MavenErrorLog; | ||
import se.kth.log_Analyzer.MavenLogAnalyzer; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.Path; | ||
import java.util.Set; | ||
|
||
public class Main { | ||
|
||
|
||
public static void main(String[] args) { | ||
|
||
Path oldDependency = Path.of("/Users/frank/Downloads/Test_Failures/log4j-api-2.16.0.jar"); | ||
Path newDependency = Path.of("/Users/frank/Downloads/Test_Failures/log4j-api-2.18.0.jar"); | ||
|
||
ApiMetadata apiMetadata = new ApiMetadata(oldDependency); | ||
ApiMetadata apiMetadata1 = new ApiMetadata(newDependency); | ||
|
||
JApiCmpAnalyze jApiCmpAnalyze = new JApiCmpAnalyze( | ||
apiMetadata, | ||
apiMetadata1 | ||
); | ||
|
||
Set<ApiChange> apiChanges = jApiCmpAnalyze.useJApiCmp(); | ||
try { | ||
MavenErrorLog errorLog = new MavenLogAnalyzer(new File("/Users/frank/Downloads/Test_Failures/webapp/1eb6d9d5b2a07720a0839457cee81e066dd932f2.log")).analyzeCompilationErrors(); | ||
|
||
ApiMetadata newApiVersion = new ApiMetadata(newDependency.toFile().getName(), newDependency); | ||
ApiMetadata oldApiVersion = new ApiMetadata(oldDependency.toFile().getName(), oldDependency); | ||
|
||
CombineResults combineResults = new CombineResults(apiChanges, newApiVersion, oldApiVersion, errorLog,null); | ||
|
||
combineResults.setDependencyGroupID("org.apache.logging.log4j"); | ||
|
||
combineResults.setProject("/Users/frank/Downloads/Test_Failures"); | ||
|
||
Changes changes = combineResults.analyze(); | ||
changes.changes().forEach(change -> { | ||
// ExplanationTemplate explanationTemplate = new CompilationErrorTemplate(changes, "change"); | ||
// explanationTemplate.generateTemplate(); | ||
} | ||
); | ||
|
||
|
||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
|
||
System.out.println("Hello World"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters