Skip to content

Commit 6eaf028

Browse files
authored
misc: clean up build scripts (#119)
1 parent 147cd68 commit 6eaf028

File tree

15 files changed

+11
-2454
lines changed

15 files changed

+11
-2454
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ build/
1111
*.iml
1212
.idea/
1313
local.properties
14-
*.klib
14+
*.klib
15+
.kotlin/
16+
dockcross-*

README.md

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@ CRT interfaces are subject to change.
3535
OCI_EXE=docker python3 .github/scripts/run-container-test.py --distro al2 --arch x64 --test-bin-dir ./aws-crt-kotlin/build/bin
3636
```
3737

38-
3938
See the usage/help for different distributions provided: `python3 .github/scripts/run-container.py -h`
4039

41-
4240
### OSX
4341

4442
#### Debugging simulator test issues
@@ -66,46 +64,9 @@ List simulator runtimes with:
6664
xcrun simctl list devices available
6765
```
6866

69-
70-
See also:
71-
67+
See also:
7268
* https://developer.apple.com/documentation/xcode/installing-additional-simulator-runtimes
7369
* https://www.iosdev.recipes/simctl/
7470

7571
### Windows
76-
77-
78-
## Elasticurl App
79-
80-
The `elasticurl` project contains an MPP (JVM and Native only) executable that provides a simple testing application for exercising the CRT bindings.
81-
82-
**Native**
83-
84-
```
85-
# replace "PLATFORM" with the target platform you want to run (e.g. macosX64, linuxX64, etc)
86-
87-
./elasticurl/bin/PLATFORM/elasticurlDebugExecutable/elasticurl.kexe [OPTIONS] URL
88-
```
89-
90-
91-
**JVM**
92-
```
93-
java -jar ./elasticurl/libs/elasticurl-jvm.jar [OPTIONS] URL
94-
```
95-
96-
NOTE: You can also use the convenience script `./scripts/elasticurlJvm.sh [OPTIONS] URL`
97-
98-
To enable memory tracing specify the environment variable `CRTDEBUG=trace=N` and provide the CLI option `-v trace`
99-
100-
e.g.
101-
```
102-
CRTDEBUG=trace=2 ./elasticurl/bin/macosX64/elasticurlDebugExecutable/elasticurl.kexe -v trace https://aws.amazon.com
103-
```
104-
105-
106-
**Integration Test**
107-
108-
Run the simple elasticurl integration test script
109-
110-
`./scripts/elasticurl-test.sh`
111-
72+
Not supported yet.

aws-crt-kotlin/api/android/aws-crt-kotlin.api

Lines changed: 0 additions & 1000 deletions
This file was deleted.

aws-crt-kotlin/api/aws-crt-kotlin.api

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,6 @@ public final class aws/sdk/kotlin/crt/http/HttpClientConnectionManagerOptionsBui
507507

508508
public final class aws/sdk/kotlin/crt/http/HttpException : aws/sdk/kotlin/crt/CrtRuntimeException {
509509
public fun <init> (I)V
510-
public fun getErrorCode ()I
511510
}
512511

513512
public final class aws/sdk/kotlin/crt/http/HttpHeader {

aws-crt-kotlin/api/jvm/aws-crt-kotlin.api

Lines changed: 0 additions & 1000 deletions
This file was deleted.

aws-crt-kotlin/build.gradle.kts

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import aws.sdk.kotlin.gradle.crt.cmakeInstallDir
77
import aws.sdk.kotlin.gradle.crt.configureCrtCMakeBuild
88
import aws.sdk.kotlin.gradle.crt.disableCrossCompileTargets
99
import aws.sdk.kotlin.gradle.dsl.configurePublishing
10-
import aws.sdk.kotlin.gradle.kmp.IDEA_ACTIVE
1110
import aws.sdk.kotlin.gradle.kmp.configureKmpTargets
1211
import aws.sdk.kotlin.gradle.util.typedProp
1312
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
@@ -23,7 +22,7 @@ plugins {
2322
val sdkVersion: String by project
2423
group = properties["publishGroupName"] ?: error("missing publishGroupName")
2524
version = sdkVersion
26-
description = "Kotlin Multiplatform bindings for AWS SDK Common Runtime"
25+
description = "Kotlin Multiplatform bindings for AWS Common Runtime"
2726

2827
// See: https://kotlinlang.org/docs/reference/opt-in-requirements.html#opting-in-to-using-api
2928
val optinAnnotations = listOf("kotlin.RequiresOptIn", "kotlinx.cinterop.ExperimentalForeignApi")
@@ -45,42 +44,6 @@ kotlin {
4544
// FIXME - setup docker files and cmake tasks appropriately
4645
// mingwX64()
4746

48-
jvm {
49-
attributes {
50-
attribute<org.gradle.api.attributes.java.TargetJvmEnvironment>(
51-
TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE,
52-
objects.named(TargetJvmEnvironment.STANDARD_JVM),
53-
)
54-
}
55-
}
56-
57-
// KMP doesn't support sharing source sets for multiple JVM targets OR JVM + Android targets.
58-
// We can manually declare a `jvmCommon` target and wire it up. It will compile fine but Intellij does
59-
// not support this and the developer experience is abysmal. Kotlin/Native suffers a similar problem and
60-
// we can use the same solution. Simply, if Intellij is running (i.e. the one invoking this script) then
61-
// assume we are only building for JVM. Otherwise declare the additional JVM target for Android and
62-
// set the sourceSet the same for both but with different runtime dependencies.
63-
// See:
64-
// * https://kotlinlang.org/docs/mpp-share-on-platforms.html#share-code-in-libraries
65-
// * https://kotlinlang.org/docs/mpp-set-up-targets.html#distinguish-several-targets-for-one-platform
66-
if (!IDEA_ACTIVE) {
67-
68-
// NOTE: We don't actually need the Android plugin. All of the Android specifics are handled in aws-crt-java,
69-
// we just need a variant with a different dependency set + some distinguishing attributes.
70-
jvm("android") {
71-
attributes {
72-
attribute(
73-
org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType.Companion.attribute,
74-
org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType.androidJvm,
75-
)
76-
attribute(
77-
TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE,
78-
objects.named(TargetJvmEnvironment.ANDROID),
79-
)
80-
}
81-
}
82-
}
83-
8447
sourceSets {
8548
val commonMain by getting {
8649
dependencies {
@@ -110,30 +73,6 @@ kotlin {
11073
implementation(libs.mockserver.netty)
11174
}
11275
}
113-
114-
if (!IDEA_ACTIVE) {
115-
val androidMain by getting {
116-
// re-use the jvm (desktop) sourceSet. We only really care about declaring a variant with a different set
117-
// of runtime dependencies
118-
kotlin.srcDir("jvm/src")
119-
dependsOn(commonMain)
120-
dependencies {
121-
// we need symbols we can resolve during compilation but at runtime (i.e. on device) we depend on the Android dependency
122-
compileOnly(libs.crt.java)
123-
val crtJavaVersion = libs.versions.crt.java.version.get()
124-
implementation("software.amazon.awssdk.crt:aws-crt-android:$crtJavaVersion@aar")
125-
126-
// FIXME - temporary integration with CompletableFuture while we work out a POC on the jvm target
127-
implementation(libs.kotlinx.coroutines.jdk8)
128-
}
129-
}
130-
131-
// disable compilation of android test source set. It is the same as the jvmTest sourceSet/tests. This
132-
// sourceSet only exists to create a new variant that is the same in every way except the runtime
133-
// dependency on aws-crt-android. To test this we would need to run it on device/emulator.
134-
tasks.getByName("androidTest").enabled = false
135-
tasks.getByName("compileTestKotlinAndroid").enabled = false
136-
}
13776
}
13877

13978
sourceSets.all {

build.gradle.kts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ buildscript {
2121
}
2222

2323
plugins {
24-
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.13.2"
24+
alias(libs.plugins.kotlinx.binary.compatibility.validator)
2525
alias(libs.plugins.kotlin.multiplatform) apply false
2626
alias(libs.plugins.aws.kotlin.repo.tools.kmp)
2727
alias(libs.plugins.aws.kotlin.repo.tools.artifactsizemetrics)
@@ -60,7 +60,7 @@ subprojects {
6060
if (project.typedProp<Boolean>("kotlinWarningsAsErrors") == true) {
6161
allprojects {
6262
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
63-
kotlinOptions.allWarningsAsErrors = true
63+
compilerOptions.allWarningsAsErrors = true
6464
}
6565
}
6666
}
@@ -75,7 +75,3 @@ val lintPaths = listOf(
7575
)
7676

7777
configureLinting(lintPaths)
78-
79-
apiValidation {
80-
ignoredProjects += setOf("elasticurl")
81-
}

elasticurl/build.gradle.kts

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)