Skip to content

Commit

Permalink
Support to identify different bin with different name..
Browse files Browse the repository at this point in the history
  • Loading branch information
Lynn-Dai committed Jul 31, 2023
1 parent 69f5847 commit 101063e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/main/java/client/IdentifyEntities.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public void acceptAST(String source, CompilationUnit ast) {
for(CompilationUnitPair pair : pairs){

try{
// honor
// honor
if (pair.source.contains("tests/")) continue;
System.out.println(PathUtil.getPathInProject(PathUtil.unifyPath(pair.source),this.project_name));
// System.out.println(PathUtil.unifyPath(pair.source));
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/client/TemplateWork.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,8 @@
import picocli.CommandLine;
import util.Tuple;
import visitor.relationInf.RelationInf;
import formator.Formator;
import formator.fjson.JDepObject;
import formator.fxml.XDepObject;
import formator.spreadsheet.Csvgrapher;
import hianalyzer.HiDepData;
import hianalyzer.HiDeper;

import util.Configure;
import writer.WriterIntf;

import java.util.ArrayList;
import java.util.Map;
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/util/PathUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,17 @@ public static String getLastStrByDot(String str){

/**
* Get the path inside project
* @param fullpath C:/.../project/src/java/pkg/file.java
* @param fullPath C:/.../project/src/java/pkg/file.java
* @param projectName project
* @return pkg/file.java
*/
public static String getPathInProject(String fullpath, String projectName){
public static String getPathInProject(String fullPath, String projectName){
String[] temp;
temp = fullpath.split(projectName,2);
if(fullPath.contains(projectName)){
temp = fullPath.split(projectName,2);
} else {
temp = fullPath.split(getLastStrByPathDelimiter(fullPath), 2);
}
if(temp[1].endsWith(".java") || temp[1].endsWith(".aidl")){
return temp[1].substring(1);
}
Expand Down

0 comments on commit 101063e

Please sign in to comment.