File tree Expand file tree Collapse file tree 5 files changed +27
-20
lines changed
src/main/kotlin/com/compiler/server/compiler/components Expand file tree Collapse file tree 5 files changed +27
-20
lines changed Original file line number Diff line number Diff line change 1
1
FROM amazoncorretto:17
2
2
3
3
ARG BASE_DIR
4
+ ARG KOTLIN_VERSION
5
+
6
+ RUN if [ -z "$KOTLIN_VERSION" ]; then \
7
+ echo "Error: KOTLIN_VERSION argument is not set. Use docker-build-incremental-cache.sh to build the image." >&2; \
8
+ exit 1; \
9
+ fi
10
+
11
+ ENV KOTLIN_LIB=$KOTLIN_VERSION
12
+ ENV KOTLIN_LIB_JS=${KOTLIN_VERSION}-js
13
+ ENV KOTLIN_LIB_WASM=${KOTLIN_VERSION}-wasm
14
+ ENV KOTLIN_LIB_COMPOSE_WASM=${KOTLIN_VERSION}-compose-wasm
15
+ ENV KOTLIN_COMPOSE_WASM_COMPILER_PLUGINS=${KOTLIN_VERSION}-compose-wasm-compiler-plugins
16
+ ENV KOTLIN_CACHES_COMPOSE_WASM=${KOTLIN_VERSION}-caches-compose-wasm
4
17
5
18
RUN mkdir -p $BASE_DIR
6
19
WORKDIR $BASE_DIR
7
20
ADD . $BASE_DIR
8
21
22
+ RUN rm -rf $KOTLIN_LIB
23
+ RUN rm -rf $KOTLIN_LIB_JS
24
+ RUN rm -rf $KOTLIN_LIB_WASM
25
+ RUN rm -rf $KOTLIN_LIB_COMPOSE_WASM
26
+ RUN rm -rf $KOTLIN_COMPOSE_WASM_COMPILER_PLUGINS
27
+ RUN rm -rf KOTLIN_CACHES_COMPOSE_WASM
28
+ RUN ./gradlew clean
29
+
9
30
RUN ./gradlew :cache-maker:run
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ application {
11
11
mainClass.set(" cache.MainKt" )
12
12
}
13
13
14
- tasks.withType <JavaExec > {
14
+ val runTask = tasks.named <JavaExec >( " run " ) {
15
15
dependsOn(" :dependencies:copyDependencies" )
16
16
dependsOn(" :dependencies:copyWasmDependencies" )
17
17
dependsOn(" :dependencies:copyComposeWasmCompilerPlugins" )
@@ -39,15 +39,6 @@ tasks.withType<JavaExec> {
39
39
}
40
40
41
41
val outputLocalCacheDir = rootDir.resolve(cachesComposeWasm)
42
- val buildCacheLocal by tasks.registering(Exec ::class ) {
43
- workingDir = rootDir
44
- executable = " ${project.name} /docker-build-incremental-cache.sh"
45
- outputs.dir(outputLocalCacheDir)
46
- args = listOf (
47
- rootDir.normalize().absolutePath, // baseDir
48
- rootDir.normalize().absolutePath // targetDir
49
- )
50
- }
51
42
52
43
val outputLambdaCacheDir: Provider <Directory > = layout.buildDirectory.dir(" incremental-cache" )
53
44
val buildCacheForLambda by tasks.registering(Exec ::class ) {
@@ -91,7 +82,7 @@ val kotlinComposeWasmIcLambdaCache: Configuration by configurations.creating {
91
82
}
92
83
93
84
artifacts.add(kotlinComposeWasmIcLocalCache.name, outputLocalCacheDir) {
94
- builtBy(buildCacheLocal )
85
+ builtBy(runTask )
95
86
}
96
87
97
88
artifacts.add(kotlinComposeWasmIcLambdaCache.name, outputLambdaCacheDir) {
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ echo "Target directory: $targetDir"
11
11
12
12
image_tag=my-image-name:$( date +%s)
13
13
14
- docker build . --file cache-maker/Dockerfile --tag $image_tag --build-arg BASE_DIR=$baseDir
14
+ docker build . --file cache-maker/Dockerfile --tag $image_tag --build-arg BASE_DIR=$baseDir --build-arg KOTLIN_VERSION= $kotlinVersion
15
15
16
16
container=$( docker create $image_tag )
17
17
Original file line number Diff line number Diff line change 1
1
[versions ]
2
- kotlin = " 2.1.0-Beta2 "
2
+ kotlin = " 2.1.20-dev-3031 "
3
3
kotlinIdeVersion = " 1.9.20-506"
4
4
kotlinIdeVersionWithSuffix = " 231-1.9.20-506-IJ8109.175"
5
5
spring-boot = " 2.7.10"
Original file line number Diff line number Diff line change @@ -203,15 +203,10 @@ class KotlinToJSTranslator(
203
203
a = cacheDir?.let { dir ->
204
204
usingTempDirectory { tmpDir ->
205
205
val cachesDir = tmpDir.resolve(" caches" ).normalize()
206
- val originalCachesDirExists = dir.exists()
207
- if (originalCachesDirExists) {
206
+ if (dir.exists()) {
208
207
dir.copyRecursively(cachesDir.toFile())
209
208
}
210
- val result = compileAction(cachesDir)
211
- if (! originalCachesDirExists) {
212
- cachesDir.toFile().copyRecursively(dir)
213
- }
214
- result
209
+ compileAction(cachesDir)
215
210
}
216
211
} ? : compileAction(null )
217
212
}
You can’t perform that action at this time.
0 commit comments