Repository navigation
Add a build check against JVM and Android imports in commonMain - #3363
Closed
StylianosGakis wants to merge 1 commit into
Closed
StylianosGakis wants to merge 1 commit into
StylianosGakis wants to merge 1 commit into
Conversation
…ommonMain Fails with one <path>:<line>: <import> line per java.*, javax.* or android.* import found under app/ and micro-apps/ src/commonMain, skipping paths listed in config/commonMain-import-allowlist.txt. Runs in the PR ktlint job as its own step.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI description
Adds
./gradlew checkCommonMainImports, which fails when a file under anysrc/commonMainimportsjava.*,javax.*orandroid.*, and runs it in the PR workflow.A module with only JVM and Android targets compiles
commonMainagainst the JDK, so JVM-only code can land there without anyone noticing until the module needs an iOS target. This check is the first step of making the whole app run on a second platform (desktop), where that mistake becomes easy to make.develop has no violations today, so the allow-list in
config/commonMain-import-allowlist.txtstarts empty. The check is its own workflow step because the ktlint step iscontinue-on-errorand could never fail the job.