use of de.dagere.peass.execution.utils.ProjectModules in project peass by DaGeRe.
the class TraceViewGenerator method generateViews.
public boolean generateViews(final ResultsFolders resultsFolders, final TestSet examinedTests) throws IOException, XmlPullParserException, ParseException, ViewNotFoundException, InterruptedException {
LOG.debug("Generating views for {}", version);
boolean allWorked = true;
GitUtils.reset(folders.getProjectFolder());
ProjectModules modules = dependencyManager.getExecutor().getModules();
ExecutionConfig executionConfig = dependencyManager.getTestTransformer().getConfig().getExecutionConfig();
ModuleClassMapping mapping = new ModuleClassMapping(folders.getProjectFolder(), modules, executionConfig);
List<File> classpathFolders = getClasspathFolders(modules);
for (TestCase testcase : examinedTests.getTests()) {
final OneTraceGenerator oneViewGenerator = new OneTraceGenerator(resultsFolders, folders, testcase, traceFileMapping, version, classpathFolders, mapping, kiekerConfig);
final boolean workedLocal = oneViewGenerator.generateTrace(version);
allWorked &= workedLocal;
}
return allWorked;
}
use of de.dagere.peass.execution.utils.ProjectModules in project peass by DaGeRe.
the class GradleTestExecutor method isVersionRunning.
@Override
public boolean isVersionRunning(final String version) {
boolean isRunning = false;
if (doesBuildfileExist()) {
boolean isAndroid = false;
for (final File module : getModules().getModules()) {
final File buildfile = GradleParseHelper.findGradleFile(module);
final FindDependencyVisitor visitor = GradleParseUtil.setAndroidTools(buildfile);
if (visitor.isAndroid()) {
isAndroid = true;
if (!visitor.hasVersion()) {
return false;
}
}
}
this.isAndroid = isAndroid;
ProjectModules modules = getModules();
replaceAllBuildfiles(modules);
final String[] vars = new String[] { env.fetchGradleCall(), "--no-daemon", "assemble" };
ProcessSuccessTester processSuccessTester = new ProcessSuccessTester(folders, testTransformer.getConfig(), env);
isRunning = processSuccessTester.testRunningSuccess(version, vars);
}
return isRunning;
}
use of de.dagere.peass.execution.utils.ProjectModules in project peass by DaGeRe.
the class SettingsFileParser method getModules.
public static ProjectModules getModules(final File projectFolder) {
final File settingsFile = new File(projectFolder, "settings.gradle");
final List<File> modules = new LinkedList<>();
if (settingsFile.exists()) {
SettingsFileParser parser = new SettingsFileParser();
parser.readPrefixAndSuffix(settingsFile);
parser.readModules(projectFolder, settingsFile, modules);
} else {
LOG.debug("settings-file {} not found", settingsFile);
}
modules.add(projectFolder);
return new ProjectModules(modules);
}
use of de.dagere.peass.execution.utils.ProjectModules in project peass by DaGeRe.
the class MavenPomUtil method getModules.
public static ProjectModules getModules(final File pom, final ExecutionConfig config) {
try {
ProjectModules modules = new ModuleReader().readModuleFiles(pom);
if (config.getPl() != null && !"".equals(config.getPl())) {
List<String> includedModuleNames = getIncludedModuleNames(pom, config);
for (Iterator<File> moduleIterator = modules.getModules().iterator(); moduleIterator.hasNext(); ) {
File listFile = moduleIterator.next();
String fileModuleName = listFile.getName();
System.out.println("Name: " + fileModuleName + " " + includedModuleNames);
String fileArtifactId = modules.getArtifactIds().get(listFile);
System.out.println("Artifactid: " + fileArtifactId);
if (!includedModuleNames.contains(fileModuleName) && !includedModuleNames.contains(fileArtifactId)) {
moduleIterator.remove();
}
}
}
return modules;
} catch (IOException | XmlPullParserException e) {
throw new RuntimeException(e);
}
}
use of de.dagere.peass.execution.utils.ProjectModules in project peass by DaGeRe.
the class TestBuildGradle method updateGradleFile.
private String updateGradleFile(final File gradleFile) throws IOException {
final File destFile = copyGradlefile(gradleFile);
GradleBuildfileEditor editor = new GradleBuildfileEditor(mockedTransformer, destFile, new ProjectModules(CURRENT));
editor.addDependencies(new File("xyz"));
final String gradleFileContents = FileUtils.readFileToString(destFile, Charset.defaultCharset());
return gradleFileContents;
}
Aggregations