{"id":15134906,"url":"https://github.com/jetbrains/kotlin-compiler-server","last_synced_at":"2025-05-16T04:06:15.544Z","repository":{"id":37800882,"uuid":"219478945","full_name":"JetBrains/kotlin-compiler-server","owner":"JetBrains","description":"Server for executing kotlin code","archived":false,"fork":false,"pushed_at":"2025-05-13T10:01:29.000Z","size":2603,"stargazers_count":268,"open_issues_count":29,"forks_count":77,"subscribers_count":45,"default_branch":"master","last_synced_at":"2025-05-16T04:06:03.911Z","etag":null,"topics":["kotlin","kotlin-compiler","kotlin-playground","spring","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JetBrains.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-11-04T10:50:44.000Z","updated_at":"2025-05-14T13:39:25.000Z","dependencies_parsed_at":"2023-09-22T00:46:13.112Z","dependency_job_id":"e0dac254-b5c2-4f04-bdd6-d43b0f4d3162","html_url":"https://github.com/JetBrains/kotlin-compiler-server","commit_stats":{"total_commits":928,"total_committers":35,"mean_commits":"26.514285714285716","dds":0.5991379310344828,"last_synced_commit":"0b0f2fc4a32121c62d47a94b9720afa6f15ee5e7"},"previous_names":["alexanderprendota/kotlin-compiler-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains%2Fkotlin-compiler-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains%2Fkotlin-compiler-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains%2Fkotlin-compiler-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains%2Fkotlin-compiler-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JetBrains","download_url":"https://codeload.github.com/JetBrains/kotlin-compiler-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464895,"owners_count":22075570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kotlin","kotlin-compiler","kotlin-playground","spring","spring-boot"],"created_at":"2024-09-26T05:40:32.619Z","updated_at":"2025-05-16T04:06:10.534Z","avatar_url":"https://github.com/JetBrains.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kotlin compiler server\n\n[![official JetBrains project](https://jb.gg/badges/official-plastic.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)\n![Build status](https://buildserver.labs.intellij.net/app/rest/builds/buildType:id:Kotlin_KotlinSites_Deployments_PlayKotlinlangOrg_Backend_BuildMaster/statusIcon.svg)\n![Java CI](https://github.com/JetBrains/kotlin-compiler-server/workflows/Java%20CI/badge.svg)\n![TC status](https://img.shields.io/teamcity/build/s/Kotlin_KotlinPlayground_KotlinCompilerServer_Build?label=TeamCity%20build)\n[![Kotlin](https://img.shields.io/badge/Kotlin-1.7.20-orange.svg) ](https://kotlinlang.org/)\n[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)\n\nA REST server for compiling and executing Kotlin code.\nThe server provides the API for [Kotlin Playground](https://github.com/JetBrains/kotlin-playground) library.\n\n## How to start :checkered_flag:\n\n### Simple Spring Boot application\n\nDownload Kotlin dependencies and build an executor before starting the server:\n\n```shell script\n$ ./gradlew build -x test \n```\n\nStart the Spring Boot project. The main class: `com.compiler.server.CompilerApplication`\n\n### With Docker\n\nTo build the app inside a Docker container, run the following command from the project directory:\n```shell\n$ ./docker-image-build.sh\n```\n\n### From Amazon lambda\n\nBased on [aws-serverless-container](https://github.com/awslabs/aws-serverless-java-container).\n\n```shell script\n$ ./gradlew buildLambda\n```\n\nGetting `.zip` file from `build/distributions`.\n\nLambda handler: `com.compiler.server.lambdas.StreamLambdaHandler::handleRequest`.\n\nPublish your Lambda function: you can follow the instructions\nin [AWS Lambda's documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-java-how-to-create-deployment-package.html)\non how to package your function for deployment.\n\n### From Kotless\n\nAdd [Kotless](https://github.com/JetBrains/kotless) and\nremove [aws-serverless-container](https://github.com/awslabs/aws-serverless-java-container) =)\n\n## API Documentation :page_with_curl:\n\nSwagger url: http://localhost:8080/swagger-ui/\n\n## How to add your dependencies to kotlin compiler :books:\n\nJust put whatever you need as dependencies\nto [build.gradle.kts](https://github.com/JetBrains/kotlin-compiler-server/blob/master/build.gradle.kts) via a\ntask called `kotlinDependency`:\n\n```\n kotlinDependency \"your dependency\"\n```\n\nNOTE: If the library you're adding uses reflection, accesses the file system, or performs any other type of\nsecurity-sensitive operations, don't forget to\nconfigure\nthe [executor.policy](https://github.com/JetBrains/kotlin-compiler-server/blob/master/executor.policy)\n. [Click here](https://docs.oracle.com/javase/7/docs/technotes/guides/security/PolicyFiles.html) for more information\nabout *Java Security Policy*.\n\n**How to set Java Security Policy in `executors.policy`**\n\nIf you want to configure a custom dependency, use the marker `@LIB_DIR@`:\n\n```\ngrant codeBase \"file:%%LIB_DIR%%/junit-4.12.jar\"{\n  permission java.lang.reflect.ReflectPermission \"suppressAccessChecks\";\n  permission java.lang.RuntimePermission \"setIO\";\n  permission java.io.FilePermission \"\u003c\u003cALL FILES\u003e\u003e\", \"read\";\n  permission java.lang.RuntimePermission \"accessDeclaredMembers\";\n};\n```\n\n## CORS configuration\n\nSet the environment variables\n\n| ENV                               | Default value |\n|-----------------------------------|---------------|\n| ACCESS_CONTROL_ALLOW_ORIGIN_VALUE | *             |\n| ACCESS_CONTROL_ALLOW_HEADER_VALUE | *             |\n\n## Configure logging\n\nWe use `prod` spring active profile to stream logs as JSON format.\nYou can set the spring profile by supplying `-Dspring.profiles.active=prod` or set env variable `SPRING_PROFILES_ACTIVE` to `prod` value.\n\n### Unsuccessful execution logs\n\nIn case of an unsuccessful execution in the standard output will be the event with INFO level:\n\n```json\n{\n  \"date_time\": \"31/Aug/2021:11:49:45 +03:00\",\n  \"@version\": \"1\",\n  \"message\": \"Code execution is complete.\",\n  \"logger_name\": \"com.compiler.server.service.KotlinProjectExecutor\",\n  \"thread_name\": \"http-nio-8080-exec-1\",\n  \"level\": \"INFO\",\n  \"level_value\": 20000,\n  \"hasErrors\": true,\n  \"confType\": \"JAVA\",\n  \"kotlinVersion\": \"$kotlinVersion\"\n}\n```\n\n## Kotlin release guide :rocket:\n\n1) Update the kotlin version\n   in [libs.versions.toml](https://github.com/JetBrains/kotlin-compiler-server/blob/master/gradle/libs.versions.toml)\n2) Make sure everything is going well via the task:\n\n```shell script\n$ ./gradlew build\n```\n\n3) Save branch with the name of the kotlin version. Pattern: `/^[0-9.]+$/`  (optional)\n4) Bump version on GitHub [releases](https://github.com/JetBrains/kotlin-compiler-server/releases) (optional)\n\n### Gradle Build Scans\n\n[Gradle Build Scans](https://scans.gradle.com/) can provide insights into an Kotlin Compiler Server Build.\nJetBrains runs a [Gradle Develocity server](https://ge.jetbrains.com/scans?search.rootProjectNames=kotlinx-atomicfu).\nthat can be used to automatically upload reports.\n\nTo automatically opt in add the following to `$GRADLE_USER_HOME/gradle.properties`.\n\n```properties\norg.jetbrains.kotlin.compiler.server.build.scan.enabled=true\n# optionally provide a username that will be attached to each report\norg.jetbrains..kotlin.compiler.server.build.scan.username=John Wick\n```\n\nAlso you need to create an access key:\n```bash\n./gradlew provisionDevelocityAccessKey\n```\n\nA Build Scan may contain identifiable information. See the Terms of Use https://gradle.com/legal/terms-of-use/.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjetbrains%2Fkotlin-compiler-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjetbrains%2Fkotlin-compiler-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjetbrains%2Fkotlin-compiler-server/lists"}