samコマンドでKotlin製ローカルlamdaを実行したらNoClassDefFoundErrorが出てしまった件

# 問題点
samコマンドでKotlin成ローカルlamdaを実行したらエラーが出てしまった

# 出たエラー
```
hogehoge-Pro:huga hogehoge$ sam local invoke ApiName -e src/test/json/test.json -t template.yml
A newer version of the AWS SAM CLI is available!
Your version:   0.2.11
Latest version: 0.16.1
See https://github.com/awslabs/aws-sam-local for upgrade instructions

2019/05/28 12:40:29 Successfully parsed template.yml
2019/05/28 12:40:29 Connected to Docker 1.40
2019/05/28 12:40:29 Fetching lambci/lambda:java8 image for java8 runtime...
java8: Pulling from lambci/lambda
Digest: sha256:3509bbffd070ac4dcf79269cc951fbaeec3ce82e06e5804910477425b4ee3872
Status: Image is up to date for lambci/lambda:java8
2019/05/28 12:40:34 Invoking hogehoge (java8)
2019/05/28 12:40:34 Decompressing /Users/hogehoge/hogehoge/hogehoge/build/distributions/hogehoge-1.0.zip
2019/05/28 12:40:40 WARNING: No AWS credentials found. Missing credentials may lead to slow startup times as detailed in https://github.com/awslabs/aws-sam-local/issues/134
2019/05/28 12:40:40 Mounting /private/var/folders/lq/9v3ywbwx2vn8f9hxjpg67vjh0000gn/T/aws-sam-local-1559014834800869000 as /var/task:ro inside runtime container
START RequestId: a4fe17c0-7ea4-407d-915c-4463c6b38715 Version: $LATEST
java.lang.NoClassDefFoundError: kotlin/NoWhenBranchMatchedException
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
Caused by: java.lang.ClassNotFoundException: kotlin.NoWhenBranchMatchedException
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 2 more

END RequestId: a4fe17c0-7ea4-407d-915c-4463c6b38715
REPORT RequestId: a4fe17c0-7ea4-407d-915c-4463c6b38715	Duration: 11.76 ms	Billed Duration: 100 ms	Memory Size: 128 MB	Max Memory Used: 2 MB
```

```
hogehoge-Pro:huga hogehoge$ sam local invoke ApiName -e src/test/json/test.json -t template.yml
A newer version of the AWS SAM CLI is available!
Your version:   0.2.11
Latest version: 0.16.1
See https://github.com/awslabs/aws-sam-local for upgrade instructions

2019/05/28 12:30:26 Successfully parsed template.yml
2019/05/28 12:30:26 Connected to Docker 1.40
2019/05/28 12:30:26 Fetching lambci/lambda:java8 image for java8 runtime...
java8: Pulling from lambci/lambda
Digest: sha256:3509bbffd070ac4dcf79269cc951fbaeec3ce82e06e5804910477425b4ee3872
Status: Image is up to date for lambci/lambda:java8
2019/05/28 12:30:31 Invoking hogehoge (java8)
2019/05/28 12:30:31 Decompressing /Users/hogehoge/hogehoge/hogehoge/build/distributions/hogehoge-1.0.zip
2019/05/28 12:30:37 WARNING: No AWS credentials found. Missing credentials may lead to slow startup times as detailed in https://github.com/awslabs/aws-sam-local/issues/134
2019/05/28 12:30:37 Mounting /private/var/folders/lq/9v3ywbwx2vn8f9hxjpg67vjh0000gn/T/aws-sam-local-1559014231897107000 as /var/task:ro inside runtime container
START RequestId: 516bf907-cd33-47dc-af0f-c86341dab5d9 Version: $LATEST
java.lang.NoClassDefFoundError: com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
	at java.lang.Class.privateGetPublicMethods(Class.java:2902)
	at java.lang.Class.getMethods(Class.java:1615)
Caused by: java.lang.ClassNotFoundException: com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 4 more

END RequestId: 516bf907-cd33-47dc-af0f-c86341dab5d9
REPORT RequestId: 516bf907-cd33-47dc-af0f-c86341dab5d9	Duration: 61.35 ms	Billed Duration: 100 ms	Memory Size: 128 MB	Max Memory Used: 2 MB
```

# 解決策
build.gradleに下記の一行を追加した後、「gradlew clean build」を実行

```
task buildZip(type: Zip) {
    from compileKotlin
    from processResources
    into('lib') {
        from configurations.runtime
        from configurations.compileClasspath   ⇦ここ
    }
}
```

# 所感
lamda実行するときは関連するモジュールも全部まとめてあげなあかん