Procházet zdrojové kódy

Revert "build: Extract common config to top-level build.gradle"

This reverts commit 3fdc2d1b9c8749bee26140c359d93fc3a2681889.

Individual exercises must include a stand-alone build.grade, today.
John S. Ryan před 10 roky
rodič
revize
f5bc0da655

+ 11
- 0
_template/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 11
- 0
accumulate/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 11
- 0
allergies/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 11
- 0
anagram/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 15
- 14
anagram/src/test/java/AnagramTest.java Zobrazit soubor

@@ -1,76 +1,77 @@
1
-import static org.assertj.core.api.Assertions.assertThat;
1
+import static org.hamcrest.CoreMatchers.*;
2
+import static org.junit.matchers.JUnitMatchers.*;
3
+import static org.junit.Assert.*;
2 4
 
3
-import java.util.Arrays;
4
-import java.util.List;
5
-import org.junit.Test;
5
+import java.util.*;
6
+import org.junit.*;
6 7
 
7 8
 public class AnagramTest {
8 9
 
9 10
     @Test
10 11
     public void testNoMatches() {
11 12
         Anagram detector = new Anagram("diaper");
12
-        assertThat(detector.match(Arrays.asList("hello", "world", "zombies", "pants"))).isEmpty();
13
+        assertTrue(detector.match(Arrays.asList("hello", "world", "zombies", "pants")).isEmpty());
13 14
     }
14 15
 
15 16
     @Test
16 17
     public void testSimpleAnagram() {
17 18
         Anagram detector = new Anagram("ant");
18 19
         List<String> anagram = detector.match(Arrays.asList("tan", "stand", "at"));
19
-        assertThat(anagram).containsExactly("tan");
20
+        assertThat(anagram, hasItems("tan"));
20 21
     }
21 22
 
22 23
     @Test
23 24
     public void testDetectMultipleAnagrams() {
24 25
         Anagram detector = new Anagram("master");
25 26
         List<String> anagrams = detector.match(Arrays.asList("stream", "pigeon", "maters"));
26
-        assertThat(anagrams).contains("maters", "stream");
27
+        assertThat(anagrams, hasItems("maters", "stream"));
27 28
     }
28 29
 
29 30
     @Test
30 31
     public void testDoesNotConfuseDifferentDuplicates() {
31 32
         Anagram detector = new Anagram("galea");
32 33
         List<String> anagrams = detector.match(Arrays.asList("eagle"));
33
-        assertThat(anagrams).isEmpty();
34
+        assertTrue(anagrams.isEmpty());
34 35
     }
35 36
 
36 37
     @Test
37 38
     public void testIdenticalWordIsNotAnagram() {
38 39
         Anagram detector = new Anagram("corn");
39 40
         List<String> anagrams = detector.match(Arrays.asList("corn", "dark", "Corn", "rank", "CORN", "cron", "park"));
40
-        assertThat(anagrams).containsExactly("cron");
41
+        assertEquals(anagrams, Arrays.asList("cron"));
41 42
     }
42 43
 
43 44
     @Test
44 45
     public void testEliminateAnagramsWithSameChecksum() {
45 46
         Anagram detector = new Anagram("mass");
46
-        assertThat(detector.match(Arrays.asList("last")).isEmpty());
47
+        assertTrue(detector.match(Arrays.asList("last")).isEmpty());
47 48
     }
48 49
 
49 50
     @Test
50 51
     public void testEliminateAnagramSubsets() {
51 52
         Anagram detector = new Anagram("good");
52
-        assertThat(detector.match(Arrays.asList("dog", "goody"))).isEmpty();
53
+        assertTrue(detector.match(Arrays.asList("dog", "goody")).isEmpty());
53 54
     }
54 55
 
55 56
     @Test
56 57
     public void testDetectAnagrams() {
57 58
         Anagram detector = new Anagram("listen");
58 59
         List<String> anagrams = detector.match(Arrays.asList("enlists", "google", "inlets", "banana"));
59
-        assertThat(anagrams).contains("inlets");
60
+        assertThat(anagrams, hasItems("inlets"));
60 61
     }
61 62
 
62 63
     @Test
63 64
     public void testMultipleAnagrams() {
64 65
         Anagram detector = new Anagram("allergy");
65 66
         List<String> anagrams = detector.match(Arrays.asList("gallery", "ballerina", "regally", "clergy", "largely", "leading"));
66
-        assertThat(anagrams).contains("gallery", "largely", "regally");
67
+        assertThat(anagrams, hasItems("gallery", "largely", "regally"));
67 68
     }
68 69
 
69 70
     @Test
70 71
     public void testAnagramsAreCaseInsensitive() {
71 72
         Anagram detector = new Anagram("Orchestra");
72 73
         List<String> anagrams = detector.match(Arrays.asList("cashregister", "Carthorse", "radishes"));
73
-        assertThat(anagrams).contains("Carthorse");
74
+        assertThat(anagrams, hasItems("Carthorse"));
74 75
     }
75 76
 
76 77
 }

+ 11
- 0
atbash-cipher/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 11
- 0
binary/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 11
- 0
bob/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 0
- 11
build.gradle Zobrazit soubor

@@ -1,16 +1,5 @@
1 1
 subprojects { project ->
2 2
   apply plugin: "java"
3
-  apply plugin: "eclipse"
4
-  apply plugin: "idea"
5
-
6
-  repositories {
7
-    mavenCentral()
8
-  }
9
-
10
-  dependencies {
11
-    testCompile "junit:junit:4.12"
12
-    testCompile 'org.assertj:assertj-core:2.2.0'
13
-  }
14 3
 
15 4
   sourceSets {
16 5
     // Verify that the tests are working by running them against the example code.

+ 11
- 0
crypto-square/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 10
- 0
etl/build.gradle Zobrazit soubor

@@ -1,3 +1,13 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
1 9
 dependencies {
10
+  testCompile "junit:junit:4.10"
11
+  testCompile "org.easytesting:fest-assert-core:2.0M10"
2 12
   testCompile "com.google.guava:guava:16+"
3 13
 }

+ 11
- 0
gigasecond/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 13
- 0
grade-school/build.gradle Zobrazit soubor

@@ -0,0 +1,13 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+  testCompile "org.easytesting:fest-assert-core:2.0M10"
12
+}
13
+

+ 11
- 0
hamming/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 12
- 0
hello-world/build.gradle Zobrazit soubor

@@ -0,0 +1,12 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}
12
+

+ 11
- 0
luhn/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 10
- 0
meetup/build.gradle Zobrazit soubor

@@ -1,3 +1,13 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
1 9
 dependencies {
2 10
   compile "joda-time:joda-time:2.3+"
11
+  testCompile "junit:junit:4.10"
12
+  testCompile "org.easytesting:fest-assert-core:2.0M10"
3 13
 }

+ 13
- 0
nucleotide-count/build.gradle Zobrazit soubor

@@ -0,0 +1,13 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+  testCompile "org.easytesting:fest-assert-core:2.0M10"
12
+}
13
+

+ 11
- 0
octal/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 11
- 0
pangram/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 11
- 0
pascals-triangle/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 11
- 0
phone-number/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 11
- 0
pig-latin/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 12
- 0
prime-factors/build.gradle Zobrazit soubor

@@ -0,0 +1,12 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.12"
11
+}
12
+

+ 11
- 0
raindrops/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 11
- 0
rna-transcription/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 12
- 0
robot-name/build.gradle Zobrazit soubor

@@ -0,0 +1,12 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}
12
+

+ 11
- 0
roman-numerals/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 11
- 0
scrabble-score/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 11
- 0
sieve/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 11
- 0
simple-cipher/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 11
- 0
space-age/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 11
- 0
strain/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 11
- 0
triangle/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 11
- 0
trinary/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}

+ 11
- 0
word-count/build.gradle Zobrazit soubor

@@ -0,0 +1,11 @@
1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
9
+dependencies {
10
+  testCompile "junit:junit:4.10"
11
+}