Skip to content

Ignore *.*projs that do not look like MSBuild projects #70

Closed

Description

@agross

I have inherited a Git repository that contains a zreproj (no idea what it is) that is definitely not MSBuild. Paket fails to modify this file because it does not contain a Project node. Please ignore such files.

Activity

  1. agross commented on Sep 9, 2014

    @agross
    ContributorAuthor

    ProjectFile.fs, line 101

  2. bartelink commented on Sep 9, 2014

    @bartelink
    Member

    Restating #59 - if Packet.references was projectName.projectextension.Paket, you'd have a ready made solution to the problem without having to probe the file itself

    ... And .vbprojs and/or other random other languages that haven't even been invented yet :P

  3. agross commented on Sep 10, 2014

    @agross
    ContributorAuthor

    @bartelink I think you might have a point here. There are some projects out there that might have different reference requirements w.r.t. different target frameworks/platforms/profiles/whatever. A quick GitHub search reveals e.g. this, a project where there's one csproj for pcl, netcore45, sl4 etc.

    My suggestion is to support both styles:

    • Paket uses Foo.csproj.paket for Foo.csproj if there is a .paket file, otherwise
    • Paket processes Paket.references

    This gives you control and DRY at the same time:

    • Use Paket.references if you need to ensure all projs use the same references.
    • Use a project-specific .paket (.paket.references?) file if you need to be more specific for a certain project.
  4. bartelink commented on Sep 10, 2014

    @bartelink
    Member

    @agross Interesting. But implementing, documenting and supporting 2 code paths and the understanding of these is not free.

    YAGNI?

    If you are not sure that a significant number of people will actually use this DRYness capability, then the best first thing for me is clearly to have a suffix of .paket or .paket.references (I slightly prefer the first as the second is

    a) unecessarily long and
    b) constrains the file to only ever dealing with references)

    I also think that in the case of a multi platform build, it may be that sopme platforms have reduced capability, which might trim the reference requirements and/or you might need to be able to specify some at the project level, and others at the dir level. I hope you're thinking "yuck, why do we have to bring all this into scope" now :)

    Then if there's a demonstrated need and Issue logged asking for the DRYness, you respond with the request for a PR.

  5. agross commented on Sep 10, 2014

    @agross
    ContributorAuthor

    Two code paths are fine with me. Most users will use Paket.references anyway.

    When I used ripple I remember I wanted a project-specific dependencies file for one project. So YAGNI is ruled out from my point of view :P

    I don't buy the reduced capability argument. All platforms today that I know of have support for long file names. Foobar.csproj.paket works for me.

  6. forki commented on Sep 10, 2014

    @forki
    Member

    same in NServiceBus. It's both needed

    2014-09-10 13:33 GMT+02:00 Alexander Groß [email protected]:

    Two code paths are fine with me. Most users will use Paket.references
    anyway.

    When I used ripple I remember I wanted a project-specific dependencies
    file for one project. So YAGNI is ruled out from my point of view :P

    I don't buy the reduced capability argument. All platforms today that I
    know of have support for long file names. Foobar.csproj.paket works for
    me.

    —
    Reply to this email directly or view it on GitHub
    #70 (comment).

  7. bartelink commented on Sep 10, 2014

    @bartelink
    Member

    Fair enough then, if it's 100% needed, it's 100% needed :)

    Was not talking about long filenames being a problem from the perspective of the OS (though I could tell you a story or two about the number 260 :P)

    Was saying:

    • abc.csproj.paket.references would be slightly surprising if it referred also to platform specific rules
    • abc.csproj.paket could more reasonably grow to encompass platform specific rules
  8. agross commented on Sep 10, 2014

    @agross
    ContributorAuthor

    On the other hand, abc.csproj.paket.references is easier to transform from Paket.references and vice versa.

  9. bartelink commented on Sep 10, 2014

    @bartelink
    Member

    @agross True dat, had missed that point, pretty neat.

    But you mean abc.csproj.Paket.references surely :P (see it needs to be all lowercase!)

  10. forki commented on Sep 10, 2014

    @forki
    Member

    @bartelink you won. I just converted all files to lowercase.

  11. bartelink commented on Sep 10, 2014

    @bartelink
    Member

    @forki Right, I better accept my masterful victory with dignity then :P

    Will hopefully get to do doc review / consistency check later

  12. bartelink commented on Sep 10, 2014

    @bartelink
    Member

    I also think that in the case of a multi platform build, it may be that sopme platforms have reduced capability, which might trim the reference requirements and/or you might need to be able to specify some at the project level, and others at the dir level. I hope you're thinking "yuck, why do we have to bring all this into scope" now :)

    @agross @forki The impl reflects what I was trying to convey - the set should not be a union if there is a specific one. IOW there's now no way to say: "All will have package A and B, but xyz.csproj will also have C" in a DRY way. You say "they all have A and B" and then for xyz.csproj you say "this one has A and B and C". This means we can also say for xyz.xcsproj.WinPhone we will have "A and C".

    In short, saying its lets one express all cases and that that's important even if it's not completely DRY.

  13. forki commented on Sep 10, 2014

    @forki
    Member

    Ah what?
    On Sep 10, 2014 5:24 PM, "bartelink" [email protected] wrote:

    I also think that in the case of a multi platform build, it may be that
    sopme platforms have reduced capability, which might trim the reference
    requirements and/or you might need to be able to specify some at the
    project level, and others at the dir level. I hope you're thinking "yuck,
    why do we have to bring all this into scope" now :)

    @agross https://github.com/agross @forki https://github.com/forki The
    impl reflects what I was trying to convey - the set should not be a
    union if there is a specific one. IOW there's now no way to say: "All will
    have package A and B, but xyz.csproj will also have C" in a DRY way. You
    say "they all have A and B" and then for xyz.csproj you say "this one has
    A and B and C". This means we can also say for xyz.xcsproj.WinPhone we
    will have "A and C".

    In short, saying its lets one express all cases and that that's important
    even if it's not completely DRY.

    —
    Reply to this email directly or view it on GitHub
    #70 (comment).

  14. 6 remaining items

  15. bartelink commented on Sep 14, 2014

    @bartelink
    Member

    Can you explain what you think should happen? If vbproj csproj and fsproj files are the list of known extensions that the paket.references file triggers then processing of then:

    1. I want to know if there was a problem loud and clear
    2. I can put a xyz.proj.paket.references if for some reason a) it needs References/Content managed b) can't use a normal extension

    Perhaps one could have a special case for proj-specific paket.references files - when empty, don't even parse the file (but I think that'd be a bad idea - making it empty should mean install/update should remove all Paket stuff from the file).

    Or maybe have a .paket.ignore scheme that you can do to convey if a file using the standard extensions is not to be processed at all?

  16. agross commented on Sep 14, 2014

    @agross
    ContributorAuthor

    Currently there is no known extension list. From what I understand (haven't checked the code) Paket will load all *.*proj residing next to paket.references.

    As it happens in my testing repos there are several foo.ilprojs next to my MSBuild csprojs. Those files are binary. I don't even know what they're used for nor what program generated them. Paket's ProjectFile.load fails for them because they're obviously not XML.

    What I would like to see is a warning message: "Could not load foo.ilproj, Paket will not attempt to add references" and be done with it. A similar message could be printed if the proj is XML, but does not contain the MSBuild <Project> element that we try to select.

  17. forki commented on Sep 14, 2014

    @forki
    Member

    Mhm how about restricting the list to csproj, fsproj and vbproj files?
    On Sep 14, 2014 12:36 PM, "Alexander Groß" [email protected] wrote:

    Currently there is no known extension list. From what I understand
    (haven't checked the code) Paket will load all _._proj residing next to
    paket.references.

    As it happens in my testing repos there are several foo.ilprojs next to
    my MSBuild csprojs. Those files are binary. I don't even know what
    they're used for nor what program generated them. Paket's ProjectFile.load
    fails for them because they're obviously not XML.

    What I would like to see is a warning message: "Could not load foo.ilproj,
    Paket will not attempt to add references" and be done with it. A similar
    message could be printed if the proj is XML, but does not contain the
    MSBuild element that we try to select.

    —
    Reply to this email directly or view it on GitHub
    #70 (comment).

  18. agross commented on Sep 14, 2014

    @agross
    ContributorAuthor

    I'd prefer if we try and log when we fail. That's more flexible than whitelisting, IMHO.

  19. ilkerde commented on Sep 14, 2014

    @ilkerde

    @forki +1 for explicit opt-in of supported proj files.

  20. bartelink commented on Sep 14, 2014

    @bartelink
    Member

    @agross If the software is in any doubt, I want it to stop by default. I don't want to discover 20 minutes into diagnosing a broken build that paket install actually failed.

    It doesnt have to stop processing immediately though ; Maybe it is a separate ERRORLEVEL, but I def want to stop builds in all normal circumstances.

    Then you can filter the errors as you see fit ... then you'd need to start putting in googleable 'Error Code PAK001 I know you definitely don't want me to look at %s"

  21. bartelink commented on Sep 14, 2014

    @bartelink
    Member

    Maybe the extensions list should be a defaulting arg for install and update which is set to vb/cs/fs proj (and @agross can put in +_._proj;-*.ilproj`)

  22. ilkerde commented on Sep 14, 2014

    @ilkerde

    @agross Sorry to disagree here, but I think it's a good thing to explicitly opt-in for supported *.proj types.

    I know of interesting project types, such as pyproj, booproj, sqlproj, dbproj, psproj, njsproj and many more (I intentionally left out the large set of C/C++ projects here).

    There are so many project types out there, which might interfere with Paket because someone has different project types / languages in his repo. I know of library devs providing APIs in half-a-dozen langs. I'd still vote for explicitly going for a well-defined set of *.projs.

  23. bartelink commented on Sep 14, 2014

    @bartelink
    Member

    @ilkerde So, can you clarify. You want a hardwired set of e.g. 8 with/without an ability to remove 1 / add items / replace the entire set?

    Or do you want a commandline parameter with a default value like my suggestion which allows you to override it ?

    Or a syntax element in the deps file that specifies a seach pattern?

    Best to give a clear picture of what you consider should happen?

  24. ilkerde commented on Sep 15, 2014

    @ilkerde

    @bartelink I propose a hardwired (yet well documented) set of projs Paket will support. That is, Paket will only touch certain projs "by design". No user interaction or overriding.

    My proposal is that Paket should support only vbproj, csproj and fsproj for the time being.

  25. forki commented on Sep 16, 2014

    @forki
    Member

    we now only support vbproj, csproj and fsproj - is here anything left?

  26. agross commented on Sep 16, 2014

    @agross
    ContributorAuthor

    Let's see how it works out in practice.

  27. szul commented on Nov 2, 2017

    @szul
    Contributor

    @forki Hate to bring up a long dead issue, but I'm working on an IronPython project that uses a *.pyproj project file extension. Has there been any other movement/discussion on alternative project file extensions? I'd like to be able to have paket update this project file, but right now, I have to constantly change the extension back and forth to do so, it seems.

  28. forki commented on Nov 2, 2017

    @forki
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions