title: ÐÐ²ÑÐ¾Ð¼Ð°ÑÐ¸ÑÐµÑÐºÐ¾Ðµ Ð¾Ð¿Ð¸ÑÐ°Ð½Ð¸Ðµ Ð·Ð°Ð²Ð¸ÑÐ¸Ð¼Ð¾ÑÑÐµÐ¹ Ð´Ð»Ñ Bazel BUILD ÑÐ°Ð¸ÌÐ»Ð¾Ð² Ð½Ð° Ð¾ÑÐ½Ð¾Ð²Ðµ Ð¸ÑÑ Ð¾Ð´Ð½ÑÑ ÑÐ°Ð¸ÌÐ»Ð¾Ð² Ð½Ð° ÑÐ·ÑÐºÐµ Ð¿ÑÐ¾Ð³ÑÐ°Ð¼Ð¼Ð¸ÑÐ¾Ð²Ð°Ð½Ð¸Ñ Scala
title: Ð²ÑÐ¿ÑÑÐºÐ½Ð°Ñ ÐºÐ²Ð°Ð»Ð¸ÑÐ¸ÐºÐ°ÑÐ¸Ð¾Ð½Ð½Ð°Ñ ÑÐ°Ð±Ð¾ÑÐ° Ð±Ð°ÐºÐ°Ð»Ð°Ð²ÑÐ°
titleType: Subtitle
title: Automatic description of dependencies for Bazel BUILD files based on source files in the Scala programming language
Creators: name: Ð­Ð·ÐµÑÐ¸Ð½Ñ, ÐÐ°ÑÑÐ°
Publisher: name: Ð¡Ð°Ð½ÐºÑ-ÐÐµÑÐµÑÐ±ÑÑÐ³ÑÐºÐ¸Ð¹ Ð¿Ð¾Ð»Ð¸ÑÐµÑÐ½Ð¸ÑÐµÑÐºÐ¸Ð¹ ÑÐ½Ð¸Ð²ÐµÑÑÐ¸ÑÐµÑ ÐÐµÑÑÐ° ÐÐµÐ»Ð¸ÐºÐ¾Ð³Ð¾
Year: 2024
Subjects: Scala
Bazel
Gazelle
Ð·Ð°Ð²Ð¸ÑÐ¸Ð¼Ð¾ÑÑÐ¸
ÑÐ¸ÑÑÐµÐ¼Ð° ÑÐ±Ð¾ÑÐºÐ¸
build ÑÐ°Ð¹Ð»Ñ
dependencies
build system
build files

description: ÐÑÐ¾ÐµÐºÑ ÑÐ°Ð·ÑÐ°Ð±Ð°ÑÑÐ²Ð°ÐµÑÑÑ Ñ Ð¸ÑÐ¿Ð¾Ð»ÑÐ·Ð¾Ð²Ð°Ð½Ð¸ÐµÐ¼ ÑÐ¸ÑÑÐµÐ¼Ñ ÑÐ±Ð¾ÑÐºÐ¸ Bazel Ð¸ Ð¾ÑÐ½Ð¾Ð²ÑÐ²Ð°ÐµÑÑÑ Ð½Ð° Ð°Ð½Ð°Ð»Ð¸Ð·Ðµ ÑÑÑÑÐºÑÑÑÑ ÐºÐ¾Ð´Ð°, Ð½Ð°Ð¿Ð¸ÑÐ°Ð½Ð½Ð¾Ð³Ð¾ Ð½Ð° ÑÐ·ÑÐºÐµ Scala. Ð ÑÐµÐ½ÑÑÐµ Ð¿Ð¾Ð´ÑÐ¾Ð´Ð° Ð»ÐµÐ¶Ð¸Ñ ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ðµ ÑÐ°ÑÑÐ¸ÑÐµÐ½Ð¸Ñ Ð´Ð»Ñ Ð¸Ð½ÑÑÑÑÐ¼ÐµÐ½ÑÐ° Gazelle. ÐÐ»Ñ ÑÐ¸Ð½ÑÐ°ÐºÑÐ¸ÑÐµÑÐºÐ¾Ð³Ð¾ Ð°Ð½Ð°Ð»Ð¸Ð·Ð° Scala ÐºÐ¾Ð´Ð° Ð¸ÑÐ¿Ð¾Ð»ÑÐ·ÑÐµÑÑÑ Ð±Ð¸Ð±Ð»Ð¸Ð¾ÑÐµÐºÐ° Scalameta, ÐºÐ¾ÑÐ¾ÑÐ°Ñ Ð¸ÑÐ¿Ð¾Ð»ÑÐ·ÑÐµÑ ÐºÐ¾Ð¼Ð±Ð¸Ð½Ð°ÑÐ¸Ñ ÑÐ¸Ð½ÑÐ°ÐºÑÐ¸ÑÐµÑÐºÐ¾Ð³Ð¾ Ð¸ ÑÐµÐ¼Ð°Ð½ÑÐ¸ÑÐµÑÐºÐ¾Ð³Ð¾ Ð°Ð½Ð°Ð»Ð¸Ð·Ð° Ð´Ð»Ñ Ð¿Ð¾ÑÑÑÐ¾ÐµÐ½Ð¸Ñ ÑÐ¸Ð½ÑÐ°ÐºÑÐ¸ÑÐµÑÐºÐ¾Ð³Ð¾ AST Ð´ÐµÑÐµÐ²Ð°. ÐÐ»Ñ Ð¸Ð·Ð²Ð»ÐµÑÐµÐ½Ð¸Ñ Ð²Ð½ÑÑÑÐµÐ½Ð½Ð¸Ñ Ð¸ Ð²Ð½ÐµÑÐ½Ð¸Ñ Ð·Ð°Ð²Ð¸ÑÐ¸Ð¼Ð¾ÑÑÐµÐ¹ Ð±ÑÐ»Ð¸ ÑÐµÐ°Ð»Ð¸Ð·Ð¾Ð²Ð°Ð½Ñ ÑÐµÑÐµÐ½Ð¸Ñ, Ð¸ÑÐ¿Ð¾Ð»ÑÐ·ÑÑÑÐ¸Ðµ Ð¾Ð±ÑÐ¾Ð´ Ð¿Ð¾ AST, Ð·Ð°Ð³ÑÑÐ·ÐºÑ Ð¸ Ð¸Ð½Ð´ÐµÐºÑÐ¸ÑÐ¾Ð²Ð°Ð½Ð¸Ðµ Ð²Ð½ÐµÑÐ½Ð¸Ñ Ð·Ð°Ð²Ð¸ÑÐ¸Ð¼Ð¾ÑÑÐµÐ¹ Ð¸Ð· Ð¿ÑÐ±Ð»Ð¸ÑÐ½ÑÑ ÑÐµÐ¿Ð¾Ð·Ð¸ÑÐ¾ÑÐ¸ÐµÐ². ÐÐ°Ð´Ð°ÑÐ¸, ÐºÐ¾ÑÐ¾ÑÑÐµ ÑÐµÑÐ°Ð»Ð¸ÑÑ Ð² ÑÐ¾Ð´Ðµ ÑÐ°Ð·ÑÐ°Ð±Ð¾ÑÐºÐ¸: 1. ÐÐ·ÑÑÐµÐ½Ð¸Ðµ Ð¿ÑÐ¸Ð½ÑÐ¸Ð¿Ð¾Ð² ÑÐ°Ð±Ð¾ÑÑ Ð¸ Ð¾ÑÐ¾Ð±ÐµÐ½Ð½Ð¾ÑÑÐµÐ¹ ÑÐ¸ÑÑÐµÐ¼Ñ ÑÐ±Ð¾ÑÐºÐ¸ Bazel. 2. ÐÑÑÐ²Ð»ÐµÐ½Ð¸Ðµ Ð¾ÑÐ¾Ð±ÐµÐ½Ð½Ð¾ÑÑÐµÐ¹ ÑÑÑÑÐºÑÑÑÑ BUILD ÑÐ°Ð¹Ð»Ð¾Ð² Ð² Bazel Ð´Ð»Ñ Ð¿ÑÐ¾ÐµÐºÑÐ¾Ð², Ð½Ð°Ð¿Ð¸ÑÐ°Ð½Ð½ÑÑ Ð½Ð° Scala. 3. ÐÐ½Ð°Ð»Ð¸Ð· ÑÑÑÑÐºÑÑÑÑ Ð¸ ÑÐ¿ÐµÑÐ¸ÑÐ¸ÐºÐ¸ ÐºÐ¾Ð´Ð° Ð½Ð° ÑÐ·ÑÐºÐµ Ð¿ÑÐ¾Ð³ÑÐ°Ð¼Ð¼Ð¸ÑÐ¾Ð²Ð°Ð½Ð¸Ñ Scala, ÑÑÐ¾Ð±Ñ Ð¾Ð¿ÑÐµÐ´ÐµÐ»Ð¸ÑÑ Ð¼Ð¾Ð´ÐµÐ»Ñ Ð¸Ð·Ð²Ð»ÐµÑÐµÐ½Ð¸Ñ Ð·Ð°Ð²Ð¸ÑÐ¸Ð¼Ð¾ÑÑÐµÐ¹. 4. Ð Ð°Ð·ÑÐ°Ð±Ð¾ÑÐºÐ° ÑÐ¸ÑÑÐµÐ¼Ñ Ð´Ð»Ñ Ð°Ð²ÑÐ¾Ð¼Ð°ÑÐ¸ÑÐµÑÐºÐ¾Ð³Ð¾ Ð¸Ð·Ð²Ð»ÐµÑÐµÐ½Ð¸Ñ Ð¸Ð½ÑÐ¾ÑÐ¼Ð°ÑÐ¸Ð¸ Ð¾ Ð·Ð°Ð²Ð¸ÑÐ¸Ð¼Ð¾ÑÑÑÑ Ð¸Ð· ÐºÐ¾Ð´Ð° Ð½Ð° Scala. 5. Ð¡Ð¾Ð·Ð´Ð°Ð½Ð¸Ðµ Ð¿ÑÐ¾Ð³ÑÐ°Ð¼Ð¼Ð½Ð¾Ð³Ð¾ Ð¾Ð±ÐµÑÐ¿ÐµÑÐµÐ½Ð¸Ñ, ÑÐµÐ°Ð»Ð¸Ð·ÑÑÑÐµÐ³Ð¾ ÑÐ°Ð·ÑÐ°Ð±Ð¾ÑÐ°Ð½Ð½ÑÐµ Ð°Ð»Ð³Ð¾ÑÐ¸ÑÐ¼Ñ Ð¸ Ð°Ð²ÑÐ¾Ð¼Ð°ÑÐ¸Ð·Ð¸ÑÑÑÑÐµÐ³Ð¾ Ð¿ÑÐ¾ÑÐµÑÑ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ BUILD ÑÐ°Ð¹Ð»Ð¾Ð² Ð´Ð»Ñ Bazel. 6. ÐÑÐ¾Ð²ÐµÐ´ÐµÐ½Ð¸Ðµ ÑÐµÑÑÐ¸ÑÐ¾Ð²Ð°Ð½Ð¸Ñ ÑÐ°Ð·ÑÐ°Ð±Ð¾ÑÐ°Ð½Ð½Ð¾Ð³Ð¾ ÑÐµÑÐµÐ½Ð¸Ñ Ð½Ð° ÑÐµÐ°Ð»ÑÐ½ÑÑ Scala Ð¿ÑÐ¾ÐµÐºÑÐ°Ñ. Ð ÑÐµÐ·ÑÐ»ÑÑÐ°ÑÐµ ÑÐ°Ð±Ð¾ÑÑ Ð±ÑÐ» ÑÐ¾Ð·Ð´Ð°Ð½ Ð¸Ð½ÑÑÑÑÐ¼ÐµÐ½Ñ, Ð¿Ð¾Ð·Ð²Ð¾Ð»ÑÑÑÐ¸Ð¹ Ð°Ð²ÑÐ¾Ð¼Ð°ÑÐ¸Ð·Ð¸ÑÐ¾Ð²Ð°ÑÑ ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ðµ Ð¾Ð¿Ð¸ÑÐ°Ð½Ð¸Ñ Ð·Ð°Ð²Ð¸ÑÐ¸Ð¼Ð¾ÑÑÐµÐ¹ Ð´Ð»Ñ Bazel BUILD ÑÐ°Ð¹Ð»Ð¾Ð² Ð½Ð° Ð¾ÑÐ½Ð¾Ð²Ðµ Ð¸ÑÑÐ¾Ð´Ð½Ð¾Ð³Ð¾ ÐºÐ¾Ð´Ð° Ð½Ð° ÑÐ·ÑÐºÐµ Scala. ÐÑÐ¸ Ð¿Ð¾Ð¼Ð¾ÑÐ¸ Ð´Ð°Ð½Ð½Ð¾Ð³Ð¾ Ð¸Ð½ÑÑÑÑÐ¼ÐµÐ½ÑÐ° Ð±ÑÐ» Ð·Ð½Ð°ÑÐ¸ÑÐµÐ»ÑÐ½Ð¾ ÑÐ¾ÐºÑÐ°ÑÑÐ½ Ð¿ÑÐ¾ÑÐµÑÑ Ð¿Ð¾Ð´Ð³Ð¾ÑÐ¾Ð²ÐºÐ¸ Ð¸ Ð½Ð°ÑÑÑÐ¾Ð¹ÐºÐ¸ ÑÐ°Ð±Ð¾ÑÐµÐ³Ð¾ Ð¾ÐºÑÑÐ¶ÐµÐ½Ð¸Ñ ÑÐ°Ð·ÑÐ°Ð±Ð¾ÑÑÐ¸ÐºÐ¾Ð², Ð° ÑÐ°ÐºÐ¶Ðµ ÑÐ½Ð¸Ð¶ÐµÐ½Ð¾ ÐºÐ¾Ð»Ð¸ÑÐµÑÑÐ²Ð¾ Ð¾ÑÐ¸Ð±Ð¾Ðº Ð¿ÑÐ¸ ÑÐ°Ð±Ð¾ÑÐµ Ñ Ð·Ð°Ð²Ð¸ÑÐ¸Ð¼Ð¾ÑÑÑÐ¼Ð¸.
description: The project is being developed using the Bazel build system and is based on an analysis of the structure of the code written in Scala. At the heart of the approach is the creation of an extension for the Gazelle tool. For the syntactic analysis of Scala code, the Scalameta library is used, which uses a combination of syntactic and semantic analysis to build a syntactic AST tree. Solutions using AST traversal, loading and indexing of external dependencies from public repositories have been implemented to extract internal and external dependencies. Tasks that were solved during the development: 1. Study of the principles of operation and features of the Bazel assembly system. 2. Identification of the structure features of the BUILD files in Bazel for projects written in Scala. 3. Analysis of the structure and specifics of the code in the Scala programming language to determine the dependency extraction model. 4. Development of a system for automatic extraction of dependency information from Scala code. 5. Creation of software that implements the developed algorithms and automates the process of updating BUILD files for Bazel. 6. Testing the developed solution on real Scala projects. As a result of the work, a tool was created that allows you to automate the creation of dependency descriptions for Bazel BUILD files based on the source code in the Scala language. With this tool, the process of preparing and configuring the developers work environment has been significantly reduced, as well as the number of errors when working with dependencies has been reduced.