Giter Site home page Giter Site logo

Comments (3)

oionut avatar oionut commented on July 26, 2024 1

This has a wider impact as it is blocking moving the entity classes in a different assembly than the controller one. This means that the library is enforcing having everything in a single project making the life harder in case of a complex operator.

A potential solution would be to skip generating the OperatorBuilderExtensions, FinalizerRegistrations and ControllerRegistrations in case no IEntityController is found in the current assembly

@robertcoltheart in case your problem is only with the Test project(s), one workaround is adding the below code in (each of) your test project:

<Target Name="DisableAnalyzers" BeforeTargets="CoreCompile">
    <ItemGroup>	    
	    <Analyzer Remove="@(Analyzer)" Condition="'%(Filename)' == 'KubeOps.Generator'"/>
    </ItemGroup>
   </Target>

edited: added fix suggestion

from dotnet-operator-sdk.

buehler avatar buehler commented on July 26, 2024

@oionut thanks for the workaround!

Is it not possible to use a library with your entities in one project and attach the generator there?

Maybe an idea would be to have some csproj properties to ignore or disable certain parts of the generator. Do you have any suggestions or best practices regarding source generators? It's the first I ever wrote ;-)

from dotnet-operator-sdk.

oionut avatar oionut commented on July 26, 2024

Hi @buehler. Source generators are new to mee too, unfortunately I cannot suggest a better solution.

from dotnet-operator-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.