changes for jar
This commit is contained in:
@@ -1,135 +0,0 @@
|
||||
package edu.lu.uni.serval.fixminer;
|
||||
|
||||
|
||||
import edu.lu.uni.serval.fixminer.jobs.CompareTrees;
|
||||
import edu.lu.uni.serval.fixminer.jobs.EnhancedASTDiff;
|
||||
import edu.lu.uni.serval.utils.ClusterToPattern;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* Created by anilkoyuncu on 14/04/2018.
|
||||
*/
|
||||
public class Launcher {
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(Launcher.class);
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
|
||||
|
||||
Properties appProps = new Properties();
|
||||
|
||||
// String hostname = "Unknown";
|
||||
// try
|
||||
// {
|
||||
// InetAddress addr;
|
||||
// addr = InetAddress.getLocalHost();
|
||||
// hostname = addr.getHostName();
|
||||
// }
|
||||
// catch (UnknownHostException ex)
|
||||
// {
|
||||
// System.out.println("Hostname can not be resolved");
|
||||
// }
|
||||
// String appConfigPath;
|
||||
// if (hostname.equals("Unknown")){
|
||||
// appConfigPath = "src/main/resource/app.properties";
|
||||
// }
|
||||
// else{
|
||||
// appConfigPath = "src/main/resource/"+hostname.split("\\.")[0]+".app.properties";
|
||||
// }
|
||||
String appConfigPath = args[0];
|
||||
appProps.load(new FileInputStream(appConfigPath));
|
||||
|
||||
String numOfWorkers = appProps.getProperty("numOfWorkers", "10");
|
||||
String portDumps = appProps.getProperty("portDumps","6399");
|
||||
String projectType = appProps.getProperty("projectType","java");
|
||||
|
||||
String hunkLimit = appProps.getProperty("hunkLimit","10");
|
||||
String patchSize = appProps.getProperty("patchSize","50");
|
||||
String projectL = appProps.getProperty("projectList","");
|
||||
String[] projectList = projectL.split(",");
|
||||
String input = appProps.getProperty("inputPath","FORKJOIN");
|
||||
String redisPath = appProps.getProperty("redisPath","FORKJOIN");
|
||||
String srcMLPath = appProps.getProperty("srcMLPath","FORKJOIN");
|
||||
|
||||
// String parameter = args[2];
|
||||
String parameter = "L1";
|
||||
// String jobType = args[1];
|
||||
// String jobType = "RICHEDITSCRIPT";
|
||||
String jobType = "COMPARE";
|
||||
|
||||
|
||||
mainLaunch( numOfWorkers, jobType, portDumps,projectType,input,redisPath,parameter, srcMLPath,hunkLimit,projectList,patchSize);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void mainLaunch(String numOfWorkers, String jobType, String portDumps, String projectType, String input, String redisPath,String parameter,String srcMLPath,String hunkLimit,String[] projectList,String patchSize){
|
||||
|
||||
|
||||
String dbDir;
|
||||
String dumpsName;
|
||||
String gumInput;
|
||||
|
||||
dumpsName = "dumps-"+projectType+".rdb";
|
||||
|
||||
gumInput = input;
|
||||
dbDir = redisPath;
|
||||
|
||||
|
||||
try {
|
||||
switch (jobType) {
|
||||
case "RICHEDITSCRIPT":
|
||||
EnhancedASTDiff.main(gumInput, portDumps, dbDir, dumpsName, srcMLPath,parameter,hunkLimit,projectList,patchSize,projectType);
|
||||
break;
|
||||
|
||||
case "COMPARE":
|
||||
String job;
|
||||
String compareDBName;
|
||||
switch (parameter){
|
||||
case "L1":
|
||||
// job = "shape";
|
||||
job = "single";
|
||||
compareDBName = "clusterl0-gumInputALL.rdb";
|
||||
break;
|
||||
case "L2":
|
||||
job = "action";
|
||||
compareDBName = "clusterl1-gumInputALL.rdb";
|
||||
break;
|
||||
case "L3":
|
||||
job = "token";
|
||||
compareDBName = "clusterl2-gumInputALL.rdb";
|
||||
break;
|
||||
default:
|
||||
throw new Error("unknown level please specify L1,L2,L3");
|
||||
}
|
||||
|
||||
|
||||
CompareTrees.main(redisPath, portDumps,dumpsName, job,numOfWorkers);
|
||||
break;
|
||||
case "PATTERN":
|
||||
ClusterToPattern.main(portDumps,redisPath, dumpsName, parameter);
|
||||
break;
|
||||
default:
|
||||
throw new Error("unknown Job");
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ projectList =
|
||||
#projectList = libtiff,php-src,cpython,wireshark,gzip,gmp,lighttpd1.4,lighttpd2
|
||||
|
||||
#inputPath = /Users/anilkoyuncu/projects/gumInputLinux
|
||||
#inputPath = /Users/anil.koyuncu/projects/fixminer/fixminer-data/gumInputLinux
|
||||
#inputPath = /Users/anil.koyuncu/projects/richedit/richedit-data/gumInputLinux
|
||||
inputPath = /Users/anil.koyuncu/projects/test/fixminer-data/patches
|
||||
#redisPath = /Users/anil.koyuncu/projects/fixminer/fixminer-core/python/data/redis
|
||||
#redisPath = /Users/anil.koyuncu/projects/fixminer/fixminer-core/python/data/redis
|
||||
#redisPath = /Users/anil.koyuncu/projects/richedit/richedit-core/python/data/redis
|
||||
#redisPath = /Users/anil.koyuncu/projects/richedit/richedit-core/python/data/redis
|
||||
redisPath = /Users/anil.koyuncu/projects/test/fixminer-core/python/data/redis
|
||||
#srcMLPath= /Users/anil.koyuncu/Downloads/srcML.0.9.5/bin/srcml
|
||||
srcMLPath= /Users/anil.koyuncu/projects/test/srcML/bin/srcml
|
||||
|
||||
@@ -9,10 +9,10 @@ patchSize = 50
|
||||
projectList = libtiff,php-src,cpython,wireshark,gzip,gmp,lighttpd1.4,lighttpd2
|
||||
|
||||
#inputPath = /Users/anilkoyuncu/projects/gumInputLinux
|
||||
#inputPath = /Users/anil.koyuncu/projects/fixminer/fixminer-data/gumInputLinux
|
||||
#inputPath = /Users/anil.koyuncu/projects/richedit/richedit-data/gumInputLinux
|
||||
inputPath = /Users/anil.koyuncu/projects/test/fixminer-data/patches
|
||||
#redisPath = /Users/anil.koyuncu/projects/fixminer/fixminer-core/python/data/redis
|
||||
#redisPath = /Users/anil.koyuncu/projects/fixminer/fixminer-core/python/data/redis
|
||||
#redisPath = /Users/anil.koyuncu/projects/richedit/richedit-core/python/data/redis
|
||||
#redisPath = /Users/anil.koyuncu/projects/richedit/richedit-core/python/data/redis
|
||||
redisPath = /Users/anil.koyuncu/projects/test/fixminer-core/python/data/redis
|
||||
#srcMLPath= /Users/anil.koyuncu/Downloads/srcML.0.9.5/bin/srcml
|
||||
srcMLPath= /usr/local/bin/srcml
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
java:
|
||||
8home: /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home
|
||||
spinfer:
|
||||
home: /Users/anilkoyuncu/projects/fixminer/spinfer/spinfer.native
|
||||
coccinelle:
|
||||
home: /Users/anilkoyuncu/projects/fixminer/spinfer/statics
|
||||
|
||||
dataset:
|
||||
# home: /Users/anilkoyuncu/projects/fixminer/fixminer-core/python/data/gumInputLinux
|
||||
inputPath : /Users/anilkoyuncu/projects/test/fixminer-data/patches
|
||||
repo: /Users/anilkoyuncu/projects/test/fixminer-data/datasets
|
||||
|
||||
fixminer:
|
||||
projectType : c
|
||||
datapath: /Users/anilkoyuncu/projects/test/fixminer-data/
|
||||
|
||||
|
||||
pjName : patches
|
||||
portDumps : 6399
|
||||
numOfWorkers : 14
|
||||
hostname : localhost
|
||||
hunkLimit : 10
|
||||
patchSize : 50
|
||||
|
||||
projectList : libtiff,gzip,gmp,lighttpd1.4,lighttpd2
|
||||
inputPath : /Users/anilkoyuncu/projects/test/fixminer-data/patches
|
||||
redisPath : /Users/anilkoyuncu/projects/test/fixminer-core/python/data/redis
|
||||
srcMLPath : /usr/local/bin/srcml
|
||||
@@ -9,7 +9,7 @@ patchSize = 50
|
||||
projectList = codeflaws
|
||||
#inputPath = /Users/anilkoyuncu/projects/gumInputLinux
|
||||
inputPath = /Users/anilkoyuncu/projects/fixminer/fixminer-core/python/data/gumInputLinux
|
||||
#redisPath = /Users/anil.koyuncu/projects/fixminer/fixminer-core/python/data/redis
|
||||
#redisPath = /Users/anil.koyuncu/projects/richedit/richedit-core/python/data/redis
|
||||
redisPath = /Users/anilkoyuncu/projects/fixminer/fixminer-core/python/data/redis
|
||||
#srcMLPath= /Users/anil.koyuncu/Downloads/srcML/src2srcml
|
||||
srcMLPath= /usr/local/bin/srcml
|
||||
|
||||
Reference in New Issue
Block a user