6: Enable analysing in EsaMain
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.bartek.esa;
|
||||
|
||||
import com.bartek.esa.analyser.apk.ApkAnalyser;
|
||||
import com.bartek.esa.analyser.source.SourceAnalyser;
|
||||
import com.bartek.esa.cli.model.CliArgsOptions;
|
||||
import com.bartek.esa.cli.parser.CliArgsParser;
|
||||
import com.bartek.esa.core.model.object.Issue;
|
||||
@@ -13,17 +15,21 @@ import java.util.List;
|
||||
public class EsaMain {
|
||||
private final CliArgsParser cliArgsParser;
|
||||
private final MethodDispatcher methodDispatcher;
|
||||
private final SourceAnalyser sourceAnalyser;
|
||||
private final ApkAnalyser apkAnalyser;
|
||||
|
||||
@Inject
|
||||
EsaMain(CliArgsParser cliArgsParser, MethodDispatcher methodDispatcher) {
|
||||
EsaMain(CliArgsParser cliArgsParser, MethodDispatcher methodDispatcher, SourceAnalyser sourceAnalyser, ApkAnalyser apkAnalyser) {
|
||||
this.cliArgsParser = cliArgsParser;
|
||||
this.methodDispatcher = methodDispatcher;
|
||||
this.sourceAnalyser = sourceAnalyser;
|
||||
this.apkAnalyser = apkAnalyser;
|
||||
}
|
||||
|
||||
private void run(String[] args) {
|
||||
DispatcherActions dispatcherActions = DispatcherActions.builder()
|
||||
.sourceAnalysis((source, plugins, excludes) -> null)
|
||||
.apkAudit((source, plugins, excludes) -> null)
|
||||
.sourceAnalysis(sourceAnalyser::analyse)
|
||||
.apkAudit(apkAnalyser::analyse)
|
||||
.build();
|
||||
|
||||
CliArgsOptions options = cliArgsParser.parse(args);
|
||||
|
||||
@@ -25,7 +25,8 @@ public class MethodDispatcher {
|
||||
}
|
||||
|
||||
if(options.isApkAudit()) {
|
||||
return actions.getApkAudit().perform(options.getApkAuditFile(),
|
||||
return actions.getApkAudit().perform(
|
||||
options.getApkAuditFile(),
|
||||
options.getPlugins(),
|
||||
options.getExcludes()
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user