question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sourceSet other than `main` won't output

See original GitHub issue

When I run gradle, it generates output files for the proto-files. These are put into $projectDir/src/$sourceSet/java/my/org/models/a.kt (or a.java). This works for the sourceSet main, but not for other sourceSets like commonMain, although I defined the task for all sourceSets. The protofiles and directories are identical between sourceSet main and commonMain (I created main just for testing).

Partial gradle build file here (https://gist.github.com/RdeWilde/ec3a5c9432004579643a47ed5fee3397)

Directory structure is:

src
+ commonMain
|    |
|    + java     // no output  :-(
|    + proto
|         |
|         + protofile1.proto
|         + protofile2.proto
|
+ main
     |
     + java    // does have output  :-)
     + proto
          |
          + protofile1.proto
          + protofile2.proto

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
marcoferrercommented, Dec 3, 2019

I took some time to track down the issue I filed related to this. Linking it here for visibility KT-29156

I dont see this getting resolved anytime soon but its worth centralizing the history here at the very least.

0reactions
marcoferrercommented, Aug 23, 2019

Sorry that was a typo. I meant to say that the protobuf plugin would have to be made aware of the kotlin multiplatform plugin. I dont think the source set would need to explicitly implement ExtensionAware. Once its created by the object factory, the proxy that wraps the class will implicitly add it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gradle builds successfully without SourceSet, but fails with ...
By default Gradle will use src/main/java as base directory for main sourceSet, without needing it to be explicitly declared.
Read more >
SourceSetOutput - Gradle DSL Version 7.6
Provides output information of the source set. Allows configuring the default output dirs and specify additional output dirs.
Read more >
Gradle Source Sets - Baeldung
The test source set contains the outputs of main in its compile classpath and also includes its dependencies.
Read more >
Inter sourcesets dependencies not recognized by Idea when ...
3. create separate module for different sourcesets is checked. ... of main depends on util, and the output of util is also included...
Read more >
Configure build variants | Android Developers
For example, you can define basic functionality in the main/ source set and use product flavor source sets to change the branding of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found