From a03e5df79946c7171f9c286e15b4502a1a239fd8 Mon Sep 17 00:00:00 2001 From: "Rodrigo B. de Oliveira" Date: Mon, 14 May 2018 16:38:10 -0300 Subject: [PATCH] Add script with dependency to `modularity` sample Now that #180 has been implemented. IDE support to come as part of #110. --- .../kotlin/dsl/samples/ModularitySampleTest.kt | 2 +- samples/modularity/build.gradle.kts | 1 + samples/modularity/lorem.gradle.kts | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 samples/modularity/lorem.gradle.kts diff --git a/samples-tests/src/test/kotlin/org/gradle/kotlin/dsl/samples/ModularitySampleTest.kt b/samples-tests/src/test/kotlin/org/gradle/kotlin/dsl/samples/ModularitySampleTest.kt index 2caec73a5..9346a1c69 100644 --- a/samples-tests/src/test/kotlin/org/gradle/kotlin/dsl/samples/ModularitySampleTest.kt +++ b/samples-tests/src/test/kotlin/org/gradle/kotlin/dsl/samples/ModularitySampleTest.kt @@ -11,7 +11,7 @@ class ModularitySampleTest : AbstractSampleTest("modularity") { @Test fun `modularity`() { assertThat( - build("foo", "bar").output, + build("foo", "bar", "lorem").output, allOf( containsString("Foo!"), containsString("Bar!"))) diff --git a/samples/modularity/build.gradle.kts b/samples/modularity/build.gradle.kts index 8aad3ef66..c4b8f7851 100644 --- a/samples/modularity/build.gradle.kts +++ b/samples/modularity/build.gradle.kts @@ -1,2 +1,3 @@ apply(from = "foo.gradle.kts") apply(from = "bar.gradle.kts") +apply(from = "lorem.gradle.kts") diff --git a/samples/modularity/lorem.gradle.kts b/samples/modularity/lorem.gradle.kts new file mode 100644 index 000000000..d6b174382 --- /dev/null +++ b/samples/modularity/lorem.gradle.kts @@ -0,0 +1,18 @@ +import com.thedeanda.lorem.* + +buildscript { + dependencies { + classpath("com.thedeanda:lorem:2.1") + } + + repositories { + jcenter() + } +} + +task("lorem") { + group = "sample" + doLast { + println(LoremIpsum.getInstance().getParagraphs(1, 1)) + } +}