Giter VIP home page Giter VIP logo

Comments (10)

nhirschey avatar nhirschey commented on July 4, 2024 3

How would one achieve this easily?

I think we just delete lines 426-433. projectFiles is used to generate projectInfos, and projectInfos is already filtering out test files using this property

printfn " skipping project '%s' because it has <IsTestProject> true" shortName

We'd need to test but scanning the code, just delete 426-433.

from fsharp.formatting.

nojaf avatar nojaf commented on July 4, 2024

Hi there, thanks for bringing this up.
What would you suggest here? Something more along the lines of EndsWith?

from fsharp.formatting.

nhirschey avatar nhirschey commented on July 4, 2024

Another option is don't filter out test projects if they're specified by the --projects option. That would allow fsdocs build --projects "fsdocstester/src/Project1.fsproj"

I believe we'd get that functionality if we moved the "test" project filtering so that it only applies inside match case on line 392.

from fsharp.formatting.

nojaf avatar nojaf commented on July 4, 2024

Good suggestion!

from fsharp.formatting.

TheAngryByrd avatar TheAngryByrd commented on July 4, 2024

Hi there, thanks for bringing this up. What would you suggest here? Something more along the lines of EndsWith?

I'm guessing this code is trying to avoid cracking as we could look post crack at either IsTestProject or if Microsoft.NET.Test.Sdk is referenced.

from fsharp.formatting.

baronfel avatar baronfel commented on July 4, 2024

Honestly, just lean into cracking :) If you use something like buildalyzer to 'drive' the build out of proc it should be relatively stable across MSBuild versions, and this property only relies on evaluation not execution so changes in target ordering across SDK versions shouldn't impact you.

From a performance perspective, you can toggle MSBuild Server on (or wait for it to be toggled on by default) and a lot of the process-spawning overhead should just disappear.

from fsharp.formatting.

nojaf avatar nojaf commented on July 4, 2024

This code might actually pre-date Microsoft.NET.Test.Sdk 😅.
So if there is a better way to detect this I'm all ears.

from fsharp.formatting.

baronfel avatar baronfel commented on July 4, 2024

<IsTestProject>true</IsTestProject> is the canonical way to detect this. IMO we should use it. The Microsoft.NET.Test.Sdk contributes setting this property by default, but it's also possible for projects to add it manually.

from fsharp.formatting.

nojaf avatar nojaf commented on July 4, 2024

That sounds good to me. How would one achieve this easily? Loading the fsproj file, running some target and reading the property? Something along those lines?

from fsharp.formatting.

baronfel avatar baronfel commented on July 4, 2024

You shouldn't need to run any targets - the act of loading the project file is evaluation, and after evaluation you have access to all properties that are statically-known (including those delivered by SDKs). Evaluation is generally quite fast, it's running design-time-builds (like editors need to to get compiler options) that takes some time.

from fsharp.formatting.

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.