This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task("stuff") { | |
// Do things | |
} | |
task("stuff") { | |
} | |
task("thing", "cheese", "oink", "wibble") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
json { | |
"name" json "fred" | |
"age" json 5 | |
"address" json { | |
"firstLine" json "Buckingham Palace" | |
"town" json "London" | |
} | |
"friends" json array("name", "text", 23, 42) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Demo : Build { | |
val domain = project(dir = "domain") {} | |
val core = project(dir = "core") { | |
dependencies += listOf(Dependencies.kotlin, Dependencies.spek) | |
} | |
override fun root() = project(dir = ".") { | |
aggregates(core, domain) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val userJson = json { | |
obj { | |
"firstName" to u.firstName | |
"lastName" to u.lastName | |
"banthaPoodoo" to ns | |
"age" to u.age | |
"inner" to obj { | |
"x" to 1 | |
} | |
"empty" to obj { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
json { | |
"name" .. "Mr. Jones" | |
"age" .. 5 | |
"address" .. { | |
"number" .. 444 | |
"line one" .. "some place over the rainbow" | |
} | |
"family".array( | |
{ | |
"name" .. "Mrs. Jones" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Routes.get("/customer/10", { | |
val obj = object { | |
val name = "John" | |
} | |
response.send(obj, ContentType.ApplicationJson) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version=\"1.0\" encoding=\"UTF-8\"?><response><statusCode>200</statusCode><statusText>Test Complete</statusText><data><statusCode>200</statusCode><statusText>Test Complete</statusText><testId>130511_3N_P78</testId><runs>1</runs><fvonly>0</fvonly><remote></remote><testsExpected>2</testsExpected><location>Dulles_IE9</location><startTime>05/11/13 18:57:43</startTime><elapsed>178752</elapsed><completeTime>05/11/13 18:57:51</completeTime><testsCompleted>2</testsCompleted></data></response> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val server = AppServer() | |
Routes.get("/good",{ response.send("Well this means that routes now work!")}) | |
Routes.get("/",{ response.send("Hello, how are you")}) | |
"/customer" post { response.send("abc") } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource public fun CustomerResources() { | |
"/customer" get { | |
} | |
"/customer" post { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "/customer" get { response.send("a....") } | |