Skip to content

Modularization of the project #744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 43 commits into from
Jul 10, 2025
Merged

Conversation

dmitrii-artuhov
Copy link
Collaborator

@dmitrii-artuhov dmitrii-artuhov commented Jul 4, 2025

TODOs:

@dmitrii-artuhov
Copy link
Collaborator Author

dmitrii-artuhov commented Jul 7, 2025

Try using friend-paths/associate-source-sets in order to handle the visibility of the classes inside :common (some, like LogLevel, must be available to users, while others, like isInTraceDebugger flag, should not).
Research that. If it does not work, try searching for :private-common/:public-common separation, if it is a thing in gradle world

@dmitrii-artuhov dmitrii-artuhov force-pushed the separate-subproject-for-trace-agent branch from e215518 to d3e0b1e Compare July 8, 2025 12:34
@dmitrii-artuhov dmitrii-artuhov marked this pull request as ready for review July 8, 2025 13:09
@dmitrii-artuhov dmitrii-artuhov requested a review from eupp July 8, 2025 17:17
build.gradle.kts Outdated
@@ -96,7 +136,9 @@ sourceSets {
val atomicfuVersion: String by project

compileOnly(project(":bootstrap"))
api(project(":trace"))
api(project(":common")) // TODO: contains some classes from public lincheck API, refactor so that it does not expose essentially internal classes
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right now :common subproject has one class that should be available to the users of lincheck, which is enum class LogLevel. However, the rest of the symbols in it, are implementation-only. There are 2 options how to deal with that:

  • [Currently used] make all symbols in :common internal (except for LogLevel) and include in the root project the subproject via api(project(":common")). The problem here is that it is done via friend paths, which lack support in intellij idea, which then marks all usages on internal classes from :common reads and does not provide completion and auto-importing
  • Create separate "common" modules, one called :api, which will contain LogLevel (and probably other classes in the future, the second one :common with all classes marked as public. Now, the root project will include them as follows: api(project(":api")); implementation(":common"), which allows users to access LogLevel enum and disallows all classes from :common. It also supports proper highlighting and auto-imports as regular.

Copy link
Collaborator

Choose a reason for hiding this comment

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

For now, let's just make public everything that need to be public to work properly both in gradle and IDEA.
Please create a YT issue to set-up internal isolation visibility properly. It is not critical right now, but would be good to fix before next Lincheck release.

Copy link
Collaborator

Choose a reason for hiding this comment

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

For now, let's just make public everything that need to be public to work properly both in gradle and IDEA.

Or use any other solution that would make code work (both in gradle and IDEA) right now, without further design/implementation.

@dmitrii-artuhov dmitrii-artuhov force-pushed the separate-subproject-for-trace-agent branch from 377a794 to 057d8bd Compare July 9, 2025 22:46
@eupp eupp merged commit e9552a0 into develop Jul 10, 2025
25 checks passed
@eupp eupp deleted the separate-subproject-for-trace-agent branch July 10, 2025 09:30
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.

2 participants