Skip to content

[WIP] Move the dependencies over to props during VS Background build - #3273

Merged
forki merged 24 commits into
masterfrom
designtime
Jul 6, 2018
Merged

forki merged 24 commits into
masterfrom
designtime

Conversation

@forki

@forki forki commented Jun 29, 2018 •

Copy link
Copy Markdown
Member

references #3270

We already create a *.csproj.paket.props file in /obj in order to put CliReferences there. Here we dump the PackageReferences there as well (only when we are in background build). VS is watching the file and triggers restore/resolution.

Condition="$(DesignTimeBuild) != true 

For rider and ionide we would need such properties as well.

@forki

forki commented Jun 29, 2018

Copy link
Copy Markdown
Member Author

@matthid there is one known issue. for the very first build after paket updated itself we have a caching problem. the heuristic will think everything is up-to-date and won't call paket and therefor the props file won't change. but it will also no longer add the deps in memory. any ideas how to invalidate the restore cache?

let newContent = old.Replace("<!-- <RestoreSuccess>False</RestoreSuccess> -->","<RestoreSuccess>False</RestoreSuccess>")
File.WriteAllText(paketPropsFile.FullName, newContent)
let assetsFile = ProjectFile.getAssetsFileInfo projectFileInfo
if assetsFile.Exists then

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Krzysztof-Cieslak @enricosada I'm not sure if this will break the ionide integration. FSAuto was watching the assets file, right? does it watch the props files?

@forki forki changed the title Move the dependencies over to props during VS Background build [WIP] Move the dependencies over to props during VS Background build Jun 29, 2018
@matthid

matthid commented Jun 29, 2018

Copy link
Copy Markdown
Member

for the very first build after paket updated itself we have a caching problem.

paket updated itself? what? You mean after paket update?

the heuristic will think everything is up-to-date

It should be up-to-date after paket update?

@forki

forki commented Jun 29, 2018

Copy link
Copy Markdown
Member Author

no I mean after magic mode updates paket.exe and the targets file

@matthid

matthid commented Jun 29, 2018

Copy link
Copy Markdown
Member

updates paket.exe and the targets file

And why does that matter for the cache? Are we dynamically rewriting the targets file?

@forki

forki commented Jun 29, 2018 via email

Copy link
Copy Markdown
Member Author

@matthid

matthid commented Jun 29, 2018

Copy link
Copy Markdown
Member

Ok then maybe we should stop doing that ;)

@forki forki closed this Jun 29, 2018
@forki forki reopened this Jun 29, 2018
[yield sprintf " <ItemGroup Condition=\"($(DesignTimeBuild) == true)%s\">" condition
yield! packageReferences
yield " </ItemGroup>"])
|> fun xs -> String.Join(Environment.NewLine,xs)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know that there is a String.concat library routine?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but what would that improve?

@teo-tsirpanis teo-tsirpanis Jun 30, 2018 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, nothing actually. 😁 Just to avoid the lambda. I used to not know about the curried version in the past.

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

Successfully merging this pull request may close these issues.

4 participants