@@ -15,12 +15,30 @@ repositories {
15
15
}
16
16
17
17
kotlin {
18
- macosX64(" macos" )
18
+ macosX64(" macos" ) {
19
+ binaries {
20
+ executable(' main' , [DEBUG ]) {
21
+ // Build a binary on the basis of the test compilation.
22
+ compilation = compilations. main
23
+
24
+ // Base name for the output file.
25
+ baseName = ' lambda-runtime'
26
+
27
+ // Custom entry point function.
28
+ entryPoint = ' com.batchofcode.lambdaruntime.main'
29
+
30
+ // Accessing the output file.
31
+ println (" Executable path: ${ outputFile.absolutePath} " )
32
+ }
33
+
34
+ }
35
+ }
19
36
linuxX64(" linux" )
20
37
}
21
38
22
39
dependencies {
23
40
commonMainImplementation " org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.2.1"
41
+ commonMainImplementation " org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:0.11.0"
24
42
commonMainImplementation " io.ktor:ktor-client-core:$ktor_version "
25
43
26
44
commonTestImplementation " org.jetbrains.kotlin:kotlin-test-common:$kotlin_version "
@@ -29,13 +47,15 @@ dependencies {
29
47
commonTestImplementation " org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.2.1"
30
48
31
49
macosMainImplementation ' org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.2.1'
50
+ macosMainImplementation " org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:0.11.0"
32
51
macosMainImplementation " io.ktor:ktor-client-core-native:$ktor_version "
33
52
macosMainImplementation " io.ktor:ktor-client-curl:$ktor_version "
34
53
35
54
macosTestApi " io.ktor:ktor-client-mock-native:$ktor_version "
36
55
macosTestApi ' org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.2.1'
37
56
38
57
linuxMainImplementation ' org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.2.1'
58
+ linuxMainImplementation " org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:0.11.0"
39
59
linuxMainImplementation " io.ktor:ktor-client-core-native:$ktor_version "
40
60
linuxMainImplementation " io.ktor:ktor-client-curl:$ktor_version "
41
61
@@ -61,7 +81,7 @@ bintray {
61
81
override = true
62
82
// publications = ['kotlinMultiplatform']
63
83
filesSpec {
64
- from ' build/publications/LambdaRuntime /module.json'
84
+ from ' build/publications/kotlinMultiplatform /module.json'
65
85
into ' com/batchofcode/lambda-runtime-kotlin-native/' + project. version
66
86
rename ' module.json' , ' lambda-runtime-kotlin-native-' + project. version + ' .module'
67
87
}
@@ -88,11 +108,11 @@ bintrayUpload.doFirst {
88
108
}
89
109
90
110
task runProgram {
91
- def buildType = ' debug' // Change to 'debug' to run application with debug symbols.
92
- dependsOn " build"
111
+ dependsOn " macosBinaries"
93
112
doLast {
94
- def programFile = " build/bin/LambdaRuntime/main/ ${ buildType } /executable/ lambda-runtime-kotlin-native .kexe"
113
+ def programFile = " build/bin/macos/mainDebugExecutable/ lambda-runtime.kexe"
95
114
exec {
115
+ environment(" AWS_LAMBDA_RUNTIME_API" , " localhost:9000" )
96
116
executable programFile
97
117
args ' '
98
118
}
0 commit comments