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

Inline generation #130

Closed
JaggerJo opened this issue Oct 19, 2021 · 2 comments
Closed

Inline generation #130

JaggerJo opened this issue Oct 19, 2021 · 2 comments

Comments

@JaggerJo
Copy link
Contributor

JaggerJo commented Oct 19, 2021

Whats needed in order to enable inline code generation?

With the configuration from below Types.fs gets overwritten.

myriad.toml

[flink-fields]
inlineGeneration = true

project.fsproj

..
    <ItemGroup>
        <Compile Include="Types.fs">
            <MyriadFile>Types.fs</MyriadFile>
        </Compile>
        <Compile Include="Program.fs" />
        <Content Include="myriad.toml" />
    </ItemGroup>
..

Types.fs

(* .. other stuff .. *)

[<Generator.FlinkFields "flink-fields">]
type Employee = {
    Id: Guid
    Name: string
    Department: Department
    Contract: Contract
}

(* bottom of the file - here I want to append the generated code *)
@7sharp9
Copy link
Collaborator

7sharp9 commented Oct 20, 2021

Ok so inlineGeneration = true is not the way, its actually msbuild based at the moment, this is the way currently:

..
    <ItemGroup>
        <Compile Include="Types.fs">
            <MyriadInlineGeneration>true</MyriadInlineGeneration>
        </Compile>
        <Compile Include="Program.fs" />
        <Content Include="myriad.toml" />
    </ItemGroup>
..

@JaggerJo
Copy link
Contributor Author

Thx! Don't know why I assumed this is done in toml.

Added it to the readme #131

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

No branches or pull requests

2 participants