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

feat: selectively attach a type or method and all its dependencies #220

Open
roy-t opened this issue Jun 22, 2022 · 0 comments
Open

feat: selectively attach a type or method and all its dependencies #220

roy-t opened this issue Jun 22, 2022 · 0 comments

Comments

@roy-t
Copy link

roy-t commented Jun 22, 2022

Let's take the following pseudo header file as an example

struct WHEEL { 
    float rimSize; 
} Wheel;

enum DriveType { Front, Rear, All };

struct CAR { 
    Wheel wheels[4]; 
    DriveType driveType;
    float weight;
} Car;

void ReverseCar(Car car);

// a lot of other stuff we're not interested in

Right now you would have to write the following mappings.xml file to make use of the ReverseCar method.

<?xml version="1.0" encoding="utf-8"?>
<config id="id" xmlns="urn:SharpGen.Config">
  <namespace>Foo</namespace>
  <include file="vehicles.h" namespace="Foo.Cars">
    <attach>Wheel</attach>
    <attach>DriveType</attach>
    <attach>Car</attach>
    <attach>ReverseCar</attach>
  </include>

I would like to be able to simplify this to:

<?xml version="1.0" encoding="utf-8"?>
<config id="id" xmlns="urn:SharpGen.Config">
  <namespace>Foo</namespace>
  <include file="cars.h" namespace="Foo.Cars">
    <attach>ReverseCar</attach>
  </include>

Which should automatically attach all the types, enums, etc... needed to make the ReverseCar method work. I would hope this would work directly. But otherwise we could add an attribute to the attach tag like AutoAttachDependencies=true or something like that.

It would be nice if this would work anything that you can attach, not just functions.

Disclaimer: I'm super new to SharpGen so I have no clue about the technical complexity to make this work, or if there are already other ways to accomplish this.

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

1 participant