Skip to content

Conversation

@alexander-yevsyukov
Copy link
Contributor

@alexander-yevsyukov alexander-yevsyukov commented Oct 20, 2025

This PR continues unification of the code which customizes GenerateProtoTasks. In this PR we introduce the GeneratedDirectoryContext interface which aims to serve as a context parameter when calculating paths to the generated directory.

Before this PR we've had a hard-coded path in the Project.generatedDir extension value. Now the root directory path comes as a result of the GeneratedDirectoryContext.generatedDir() function.

Also the PR brings the code of configuring source sets previously adopted in the Compiler.

Outdated extension properties and functions were removed.

The code was locally tested for building Base.

language: String
): Path {
val generatedDir = project.projectDir.resolve(DirectoryName.generated).toPath()
return generatedDir.resolve("${sourceSet.name}/$language")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@armiol, as long as the result is Path (not a String), we can have a simplified flow without if branch for an empty language.

@alexander-yevsyukov alexander-yevsyukov merged commit c7ae817 into master Oct 20, 2025
6 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the open-generate-proto-task-extensions branch October 20, 2025 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants