Skip to content
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

Generate code in test sources #2

Open
edwardharks opened this issue Feb 20, 2022 · 2 comments
Open

Generate code in test sources #2

edwardharks opened this issue Feb 20, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@edwardharks
Copy link
Owner

At the moment the code is generated in the main directory. It should be generated in the test source directory.

@edwardharks edwardharks added the enhancement New feature or request label Feb 20, 2022
@edwardharks
Copy link
Owner Author

google/ksp#799 (comment)

@edwardharks
Copy link
Owner Author

Potential alternative approach

// class in main sources that we want to generate a fixture for
class User

// object annotated with @Fixture and that class that fixture is for in test sources
@Fixture(User::class)
object UserFixtures

// Generate an extension function for creating the fixture in test sources
fun UserFixtures.user(): User = User()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant