Skip to content

Commit cb8b7a0

Browse files
committed
#ver 0.3.0
1 parent 999dc53 commit cb8b7a0

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

build.gradle

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ plugins {
77
id 'idea'
88
}
99

10+
configurations.compile {
11+
resolutionStrategy {
12+
cacheChangingModulesFor 0, 'seconds'
13+
cacheDynamicVersionsFor 0, 'seconds'
14+
}
15+
}
16+
1017
repositories {
1118
maven { url "https://jitpack.io" }
1219
mavenCentral()
@@ -23,7 +30,9 @@ dependencies {
2330
def s = '[ \t]*', w = '[^:#@\\s]+?'
2431
(file('mdeps').text =~ /(?m)^$s($w):($w):($w)?(:$w)?(@$w)?$s(?:#$s($w)?$s)?$/).each {
2532
match, group, name, version, classifier, ext, configuration ->
26-
add(configuration ?: 'compile', "$group:$name:${version?:'latest.integration'}${classifier?:''}${ext?:''}")
33+
add(configuration ?: 'compile', "$group:$name:${version?:'latest.integration'}${classifier?:''}${ext?:''}", {
34+
changing = true
35+
})
2736
}
2837

2938
compileOnly 'org.projectlombok:lombok:1.16.18'

src/main/java/org/scm4j/deployer/installers/Copy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ public DeploymentResult deploy() {
2626
try {
2727
for (File file : filesForDeploy) {
2828
if (file.isDirectory())
29-
FileUtils.copyDirectory(file, outputFile);
29+
FileUtils.copyDirectoryToDirectory(file, outputFile);
3030
else
31-
FileUtils.copyFile(file, outputFile);
31+
FileUtils.copyFileToDirectory(file, outputFile);
3232
}
3333
return OK;
3434
} catch (IOException e) {

src/test/java/org/scm4j/deployer/installers/CopyTest.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
public class CopyTest {
1919

2020
private static final File TEST_FOLDER = new File(System.getProperty("java.io.tmpdir"), "test-copy");
21-
private static final File FOLDER_FOR_COPY = new File(TEST_FOLDER, "file");
21+
private static final File FOLDER_FOR_COPY = new File(TEST_FOLDER, "files");
2222
private static final File FILE_FOR_COPY = new File(TEST_FOLDER, "file.txt");
2323
private static final File OUTPUT_FOLDER = new File(TEST_FOLDER, "output");
2424
private DeploymentContext depCtx;
@@ -56,9 +56,16 @@ public void testDeployFolder() throws Exception {
5656
Copy copy = new Copy();
5757
copy.init(depCtx);
5858
copy.deploy();
59-
for (int i = 0; i < 5; i++)
60-
assertTrue(FileUtils.contentEquals(new File(FOLDER_FOR_COPY, String.valueOf(i) + ".txt"),
61-
new File(OUTPUT_FOLDER, String.valueOf(i) + ".txt")));
59+
File newFile;
60+
for (int i = 0; i < 5; i++) {
61+
newFile = new File(OUTPUT_FOLDER, FOLDER_FOR_COPY.getName());
62+
newFile = new File(newFile, String.valueOf(i));
63+
newFile = new File(newFile, String.valueOf(i) + ".txt");
64+
File ethalon = new File(FOLDER_FOR_COPY, String.valueOf(i));
65+
assertTrue(newFile.exists());
66+
assertTrue(FileUtils.contentEquals(new File(ethalon, String.valueOf(i) + ".txt"),
67+
newFile));
68+
}
6269
}
6370

6471
@Test
@@ -81,6 +88,8 @@ public void testFail() throws Exception {
8188
}
8289
DeploymentResult res = copy.deploy();
8390
assertEquals(DeploymentResult.NEED_REBOOT, res);
91+
92+
setUp();
8493
}
8594

8695
@Test

0 commit comments

Comments
 (0)