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

Update Cake packages to 0.16.0 #11

Merged
merged 1 commit into from
Sep 24, 2016

Conversation

agc93
Copy link
Member

@agc93 agc93 commented Sep 22, 2016

Includes fixes for #1180 API change in module template (cc @patriksvensson )

Includes fixes for #1180 API change in module template
Copy link
Member

@devlead devlead left a comment

Choose a reason for hiding this comment

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

Do we really need packages in the repository?

@agc93
Copy link
Member Author

agc93 commented Sep 22, 2016

@devlead Yes, unfortunately. Even the docs point out that your only options are (since we're bundling multiple templates), packaging in MSI and storing on disk, or storing inside the VSIX. It is really annoying but NuGet support in VS extensibility is very patchy.

I think there will be an alternative in future (should be possible to replace the default NuGet package wizard and bring the VS package manager in by MEF instead), but we decided that was a future avenue for improvement.

That answer your question?

@devlead
Copy link
Member

devlead commented Sep 22, 2016

@agc93 I was thinking about this GIT repo, couldn't we just restore them as part of build process?

@agc93
Copy link
Member Author

agc93 commented Sep 22, 2016

@devlead Ah, I get you now. Could be done, but we lose out of the box Visual Studio build then (since the project will be missing files on first clone), but that's probably not fatal. Obviously we would still need to be running against a specific version, but we do save having the actual nupkg in the repo..

@devlead
Copy link
Member

devlead commented Sep 22, 2016

If you have a project in solution that depends on the nuget and has 1st build priority then Visual Studio should auto restore those packages om first build.

@agc93
Copy link
Member Author

agc93 commented Sep 22, 2016

@devlead But none of the projects actually depend on the Cake packages, they're just included in the main project as content files, so that they're then packaged into the VSIX at a particular path.

@devlead
Copy link
Member

devlead commented Sep 22, 2016

@agc93 Well you can treat them as development dependencies I was able to get it to compile by adding below to src/packages.config

+  <package id="Cake.Core" version="0.15.2" targetFramework="net451" developmentDependency="true" />
+  <package id="Cake.Testing" version="0.15.2" targetFramework="net451" developmentDependency="true" />
+  <package id="xunit" version="2.1.0" targetFramework="net451" developmentDependency="true" />
+  <package id="xunit.abstractions" version="2.0.1" targetFramework="net451" developmentDependency="true" />
+  <package id="xunit.assert" version="2.1.0" targetFramework="net451" developmentDependency="true" />
+  <package id="xunit.core" version="2.1.0" targetFramework="net451" developmentDependency="true" />
+  <package id="xunit.extensibility.core" version="2.1.0" targetFramework="net451" developmentDependency="true" />
+  <package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net451" developmentDependency="true" />
+  <package id="xunit.runner.visualstudio" version="2.1.0" targetFramework="net451" developmentDependency="true" />

and changing src/Cake.VisualStudio.csproj to

-    <Content Include="Packages\cake.core.0.15.2.nupkg">
+    <Content Include="..\packages\Cake.Core.0.15.2\Cake.Core.0.15.2.nupkg">
-    <Content Include="Packages\cake.testing.0.15.2.nupkg">
+    <Content Include="..\packages\Cake.Testing.0.15.2\Cake.Testing.0.15.2.nupkg">
-    <Content Include="Packages\xunit.2.1.0.nupkg">
+    <Content Include="..\Packages\xunit.2.1.0\xunit.2.1.0.nupkg">
-    <Content Include="Packages\xunit.runner.visualstudio.2.1.0.nupkg">
+    <Content Include="..\Packages\xunit.runner.visualstudio.2.1.0\xunit.runner.visualstudio.2.1.0.nupkg">
-    <Content Include="Packages\xunit.abstractions.2.0.1.nupkg">
+    <Content Include="..\Packages\xunit.abstractions.2.0.1\xunit.abstractions.2.0.1.nupkg">
-    <Content Include="Packages\xunit.assert.2.1.0.nupkg">
+    <Content Include="..\Packages\xunit.assert.2.1.0\xunit.assert.2.1.0.nupkg">
-    <Content Include="Packages\xunit.core.2.1.0.nupkg">
+    <Content Include="..\Packages\xunit.core.2.1.0\xunit.core.2.1.0.nupkg">
-    <Content Include="Packages\xunit.extensibility.core.2.1.0.nupkg">
+    <Content Include="..\Packages\xunit.extensibility.core.2.1.0\xunit.extensibility.core.2.1.0.nupkg">
-    <Content Include="Packages\xunit.extensibility.execution.2.1.0.nupkg">
+    <Content Include="..\Packages\xunit.extensibility.execution.2.1.0\xunit.extensibility.execution.2.1.0.nupkg">

Then it just restores the packages on first compile, it's 20MB of binaries and as versions are kept in git repo could grow allot. So if at all possible I think we should investigate if it's possible to avoid unnecessary binaries in the repo.

@agc93
Copy link
Member Author

agc93 commented Sep 22, 2016

Okay I'll try out what you've described there and make sure the VSIX still gets built as expected

@agc93
Copy link
Member Author

agc93 commented Sep 22, 2016

Initial indications aren't looking good as configuring the package as you point out does build the project correctly, but the packages are now in the VSIX at a different relative path and I'm not sure I can control that part fully. I will keep looking into it tomorrow and over the weekend and see if I can come up with some method of achieving what we want.

@gep13
Copy link
Member

gep13 commented Sep 22, 2016

Why would we lose Visual Studio build working? Could we not hook up the task explorer and assign the restore task to the pre-build event? I think someone created an extension for that?

@devlead
Copy link
Member

devlead commented Sep 22, 2016

@gep13 studio restores packages just fine, issue here it's that these packages are content not dependencies. But as restore works with my suggestion, we could potentially keep paths in csproj but have a prebuild action that copies the nupkgs from solution packages to project packages folder. Keeping same paths as when it worked.

@agc93
Copy link
Member Author

agc93 commented Sep 22, 2016

@devlead @gep13 That was what I was going to try next (pre-build xcopy), but it just felt a bit dodgy for some reason. I'm going to see if I can get VS to discover the packages in their new location first, then fall back to that if I can't work it out

@agc93
Copy link
Member Author

agc93 commented Sep 24, 2016

I've created #12 to address getting the packages out of the repo, so we can address that issue independently of getting the 0.16.0 changes put in, as it won't be a quick fix.

@gep13
Copy link
Member

gep13 commented Sep 24, 2016

@agc93 said...
I've created #12 to address getting the packages out of the repo, so we can address that issue independently of getting the 0.16.0 changes put in, as it won't be a quick fix.

this sounds like a good idea to me!

@gep13 gep13 added this to the 0.1.0 milestone Sep 24, 2016
@gep13 gep13 added the Build label Sep 24, 2016
@gep13 gep13 merged commit 467a539 into cake-build:develop Sep 24, 2016
@agc93 agc93 deleted the feature/module-template-fix branch September 25, 2016 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants