Search in sources :

Example 1 with GradleBuildfileEditor

use of de.dagere.peass.execution.gradle.GradleBuildfileEditor 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;
}
Also used : ProjectModules(de.dagere.peass.execution.utils.ProjectModules) GradleBuildfileEditor(de.dagere.peass.execution.gradle.GradleBuildfileEditor) File(java.io.File)

Example 2 with GradleBuildfileEditor

use of de.dagere.peass.execution.gradle.GradleBuildfileEditor in project peass by DaGeRe.

the class TestBuildGradle method testNoUpdate.

@Test
public void testNoUpdate() throws IOException {
    final File gradleFile = new File(GRADLE_BUILDFILE_FOLDER, "differentPlugin.gradle");
    final File destFile = copyGradlefile(gradleFile);
    GradleBuildfileEditor editor = new GradleBuildfileEditor(mockedTransformer, destFile, new ProjectModules(CURRENT));
    editor.addDependencies(new File("xyz"));
    Assert.assertTrue(FileUtils.contentEquals(gradleFile, destFile));
}
Also used : ProjectModules(de.dagere.peass.execution.utils.ProjectModules) GradleBuildfileEditor(de.dagere.peass.execution.gradle.GradleBuildfileEditor) File(java.io.File) Test(org.junit.jupiter.api.Test)

Aggregations

GradleBuildfileEditor (de.dagere.peass.execution.gradle.GradleBuildfileEditor)2 ProjectModules (de.dagere.peass.execution.utils.ProjectModules)2 File (java.io.File)2 Test (org.junit.jupiter.api.Test)1