-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
120 lines (101 loc) · 4.34 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
plugins {
id 'org.jetbrains.kotlin.multiplatform' version '1.3.61'
id 'maven-publish'
id "com.jfrog.bintray" version "1.8.4"
}
group 'com.batchofcode'
version project.findProperty('buildNum') ?: '0.0.1_SNAPSHOT'
repositories {
mavenCentral()
jcenter()
maven { url "https://kotlin.bintray.com/kotlinx" }
maven { url "https://kotlin.bintray.com/ktor" }
}
kotlin {
macosX64("macos") {
binaries {
executable('main', [DEBUG]) {
// Build a binary on the basis of the test compilation.
compilation = compilations.main
// Base name for the output file.
baseName = 'lambda-runtime'
// Custom entry point function.
entryPoint = 'com.batchofcode.lambdaruntime.main'
// Accessing the output file.
println("Executable path: ${outputFile.absolutePath}")
}
}
}
linuxX64("linux")
}
dependencies {
commonMainImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$kotlinx_coroutines_version"
commonMainImplementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$kotlinx_serialization_version"
commonMainImplementation "io.ktor:ktor-client-core:$ktor_version"
commonTestImplementation "org.jetbrains.kotlin:kotlin-test-common:$kotlin_version"
commonTestImplementation "org.jetbrains.kotlin:kotlin-test-annotations-common:$kotlin_version"
commonTestImplementation "io.ktor:ktor-client-mock:$ktor_version"
commonTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$kotlinx_coroutines_version"
macosMainImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$kotlinx_coroutines_version"
macosMainImplementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$kotlinx_serialization_version"
macosMainImplementation "io.ktor:ktor-client-core-native:$ktor_version"
macosMainImplementation "io.ktor:ktor-client-curl:$ktor_version"
macosTestApi "io.ktor:ktor-client-mock-native:$ktor_version"
macosTestApi "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$kotlinx_coroutines_version"
linuxMainImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$kotlinx_coroutines_version"
linuxMainImplementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$kotlinx_serialization_version"
linuxMainImplementation "io.ktor:ktor-client-core-native:$ktor_version"
linuxMainImplementation "io.ktor:ktor-client-curl:$ktor_version"
linuxTestApi "io.ktor:ktor-client-mock-native:$ktor_version"
linuxTestApi "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$kotlinx_coroutines_version"
}
publishing {
publications {
kotlinMultiplatform {
groupId = 'com.batchofcode'
artifactId = 'lambda-runtime-kotlin-native'
version = project.findProperty('buildNum') ?: '0.0.1_SNAPSHOT'
}
}
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
publish = true
override = true
// publications = ['kotlinMultiplatform']
filesSpec {
from 'build/publications/kotlinMultiplatform/module.json'
into 'com/batchofcode/lambda-runtime-kotlin-native/' + project.version
rename 'module.json', 'lambda-runtime-kotlin-native-' + project.version + '.module'
}
pkg {
repo = 'com.batchofcode'
name = 'lambda-runtime-kotlin-native'
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/c1phr/lambda-runtime-kotlin-native'
version {
name = project.findProperty('buildNum')
}
}
}
// TODO :kludge this is required for K/N publishing
bintrayUpload.dependsOn publishToMavenLocal
// This is for easier debugging of bintray uploading problems
bintrayUpload.doFirst {
publications = project.publishing.publications.findAll { !it.name.contains('-test') }.collect {
println("Uploading artifact '$it.groupId:$it.artifactId:$it.version' from publication '$it.name'")
it.name
}
}
task runProgram {
dependsOn "macosBinaries"
doLast {
def programFile = "build/bin/macos/mainDebugExecutable/lambda-runtime.kexe"
exec {
environment("AWS_LAMBDA_RUNTIME_API", "localhost:9000")
executable programFile
args ''
}
}
}