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 11FROM amazoncorretto:17
22
33ARG 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
417
518RUN mkdir -p $BASE_DIR
619WORKDIR $BASE_DIR
720ADD . $BASE_DIR
821
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+
930RUN ./gradlew :cache-maker:run
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ application {
1111 mainClass.set(" cache.MainKt" )
1212}
1313
14- tasks.withType <JavaExec > {
14+ val runTask = tasks.named <JavaExec >( " run " ) {
1515 dependsOn(" :dependencies:copyDependencies" )
1616 dependsOn(" :dependencies:copyWasmDependencies" )
1717 dependsOn(" :dependencies:copyComposeWasmCompilerPlugins" )
@@ -39,15 +39,6 @@ tasks.withType<JavaExec> {
3939}
4040
4141val 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- }
5142
5243val outputLambdaCacheDir: Provider <Directory > = layout.buildDirectory.dir(" incremental-cache" )
5344val buildCacheForLambda by tasks.registering(Exec ::class ) {
@@ -91,7 +82,7 @@ val kotlinComposeWasmIcLambdaCache: Configuration by configurations.creating {
9182}
9283
9384artifacts.add(kotlinComposeWasmIcLocalCache.name, outputLocalCacheDir) {
94- builtBy(buildCacheLocal )
85+ builtBy(runTask )
9586}
9687
9788artifacts.add(kotlinComposeWasmIcLambdaCache.name, outputLambdaCacheDir) {
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ echo "Target directory: $targetDir"
1111
1212image_tag=my-image-name:$( date +%s)
1313
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
1515
1616container=$( docker create $image_tag )
1717
Original file line number Diff line number Diff line change 11[versions ]
2- kotlin = " 2.1.0-Beta2 "
2+ kotlin = " 2.1.20-dev-3031 "
33kotlinIdeVersion = " 1.9.20-506"
44kotlinIdeVersionWithSuffix = " 231-1.9.20-506-IJ8109.175"
55spring-boot = " 2.7.10"
Original file line number Diff line number Diff line change @@ -203,15 +203,10 @@ class KotlinToJSTranslator(
203203 a = cacheDir?.let { dir ->
204204 usingTempDirectory { tmpDir ->
205205 val cachesDir = tmpDir.resolve(" caches" ).normalize()
206- val originalCachesDirExists = dir.exists()
207- if (originalCachesDirExists) {
206+ if (dir.exists()) {
208207 dir.copyRecursively(cachesDir.toFile())
209208 }
210- val result = compileAction(cachesDir)
211- if (! originalCachesDirExists) {
212- cachesDir.toFile().copyRecursively(dir)
213- }
214- result
209+ compileAction(cachesDir)
215210 }
216211 } ? : compileAction(null )
217212 }
You can’t perform that action at this time.
0 commit comments