-
Notifications
You must be signed in to change notification settings - Fork 245
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
Convert to sdk-style projects #285
Conversation
Not used widely anymore elsewhere, and newest version of nuget refs (esp. StructureMap) is not strong-named anymore
, because the nant task has hardcoded the version for msbuild, and we need newer.
I forgot to mention, I had a problem with strong-naming. The latest versions of Nuget dependencies (i.e. StructureMap) does not come strong named (signed), and will not be releasing any more strong named versions. Strong naming had its place in time, but I don't think it's relevant anymore. Do any of you think it's important to strong-name rh.exe? If we do, there's a nuget package that can be installed in all projects using non-signed nuget packages, which signes them on-the-fly https://github.com/dsplaisted/strongnamer. We can consider using that if you have strong arguments for strong name signing rh.exe. |
@erikbra - Thank you very much for this. As a rule, I would want P/Rs to be smaller, but, as you said, there's no real good way to break this up. I didn't see anything that looked out of place in the changes. I had forgotten that we even did strong naming; I'm fine with losing it. @ferventcoder - I think we need to attach a fair amount of urgency to this P/R. I think the recent burst of activity in RH might motivate others to create P/Rs. Merging P/Rs and this is going to be an epic pain. Assuming that I can't talk you out of cake based builds, I would propose the following:
Sound like a plan? |
Thanks a lot, @BiggerNoise . I do understand the general rule of thumb. But it gets complicated when packages and tools and build systems all depend on each other. I see that I have left out a bit in the powershell based build, I stopped at creating rh.exe. The nugets are never built. But, if you're fine with having powershell based builds for now (an intermediary), I will complete it so that we get an actual deployable out in the other end. What concerns me, is that we have no build server that can build this, it fails on the one we're using at teamcity.org, because of too old nuget version:
Who maintains the build server, @ferventcoder? Is it you? Or is it Jetbrains, in some way? |
I have nothing to do with the Team City's stuff, so it is undoubtedly @ferventcoder. I'd really like to merge this in and update the README to indicate that it is under construction. @ferventcoder - If you want to add me to the Team Cities account, I can try updating things there. Or if you think you'll have the preferred build up and running shortly that would be great also. I just don't want this P/R to linger. I'll plan on merging this tomorrow night unless we can develop an alternative plan. |
I have now fixed the I have chosen a bit different approach to building the nupkg, as msbuild now supports this natively. I added project dependencies to all Then I added the ILMerge task as part of the MSBuild has matured significantly since MS took it in, and I think using the same build script for Visual Studio and cmd line has great advantages. But YMMV. This won't build on the TeamCity build agent we have, as it requires the newest Visual Studio toolchain (Visual Studio 2017 and Nuget 4.3+). |
Thanks again for all your work on this. Mondays are really busy for me, so I'll do some roundhousing tomorrow night. |
Sounds good to me. |
Jetbrains. But it's as simple as updating the nuget in the lib folder to a newer version. |
Run with what you got for now. Cake is probably at least a few weeks out. You are right, the current UC stuff is a pain to work with and it doesn't work with newer infrastructures due to a lack of updated NAnt. And it is unlikely to ever be updated given most folks hate the pain of xml. Don't forget all the things that go into the packaging parts, that's where much important work is done in physically separating build output from what goes in packages. |
nuget/roundhouse/roundhouse.nuspec
Outdated
</metadata> | ||
<files> | ||
<file src="$mergedExe$" target="bin\" /> | ||
<file src="$appConfigFile$" target="bin\" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouch, we need a config file now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not? Looks like there is mostly bollocks in it. It was in rh 0.8.8 (the latest published one). I can leave it out, if we don't want it.
nuget/roundhouse/roundhouse.nuspec
Outdated
<file src="$mergedExe$" target="bin\" /> | ||
<file src="$appConfigFile$" target="bin\" /> | ||
<file src="..\..\nuget\roundhouse\content\ReadMe.RoundhousE.txt" target="content\" /> | ||
<file src="..\..\docs\GettingStarted.docx" target="docs\" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about leaving this one out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By all means. I saw there was an issue that you should have left out some files to be Chocolatey "compatible" anyway. (#274). I'll take out all but the ones mentioned in that one.
nuget/roundhouse/roundhouse.nuspec
Outdated
<file src="$appConfigFile$" target="bin\" /> | ||
<file src="..\..\nuget\roundhouse\content\ReadMe.RoundhousE.txt" target="content\" /> | ||
<file src="..\..\docs\GettingStarted.docx" target="docs\" /> | ||
<file src="..\..\docs\legal\*" target="docs\" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to move this to next to the binaries, and move the binaries from the bin file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which "this one" do you mean? The legal* ones?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meaning instead of the docs folder as the location in the nupkg, the license and notice and other legal ones should be beside the binaries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's an idea, but according to #274, they want the Licence one as LICENCE.txt in the tools folder (together with a VERIFICATION.txt). I see that the NOTICE file is just boiler-plate, so we don't need that, at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LICENSE can be brought in as is. It doesn't actually need the .txt, but it's helpful so that it can be read as text on Chocolatey.org package page under the files section.
nuget/roundhouse/roundhouse.nuspec
Outdated
</metadata> | ||
<files> | ||
<file src="$mergedExe$" target="bin\" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of moving this to the tools directory or a subdirectory of that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what chocolatey expects. The nuget of the exe is basically for Choco, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't matter where it is, but what the consistent approach has been for many packages is a subfolder of tools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the rh.exe
itself should be in a subfolder of tools
? and then it's the job of chocolateyInstall.ps1
to do what it wants with it (copy to Program Files or AppData or whatever)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that chocolateyInstall.ps1 is even necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The install.ps1
needs to go away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With just binaries in the package (no scripts), you can run these commands in succession:
choco install roundhouse
rh
Chocolatey automatically shims executables found in packages and puts them into a folder that is on the PATH ($env:ChocolateyInstall\bin
). The shim runs the original exe, so no dependencies are needed to be brought over.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. I now know more why i love choco ;)
So, skip the chocolateyInstall.ps1. Where do we put rh.exe? Tools? root?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My vote for consistency is the tools folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//[assembly: AssemblyKeyFile("..\\..\\RoundhousE.snk")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signing is less important nowadays to most folks in the community. The question is whether organizations (the quiet unheard group) still feel the same way. I like the concept of that signer you mentioned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can look into it. It basically signes all unsigned dlls in the project. But we'll need to use it in all the projects, then, bercause the DLL changes (it's basically a different one, as the Assembly qualified name changes).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> | ||
|
||
<VersionPrefix>0.8.9</VersionPrefix> | ||
<VersionSuffix>alpha</VersionSuffix> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do these get updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They don't. I override them on command-line with MSBuild properties when packing (in build.ps1). I generate semantic version using GitVersion.exe (probably same logic as in the nant build files) . Maybe just leave them as a "default" or easy-to-understand-that-is-dummy value in the .csproj?
Do you have any thoughts on external dependencies, such as GitVersion.exe? Should we check in the binaries, or should we expect people to use chocolatey to install themselves?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitVersion is awesome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a concept of setup, where all the tools are brought to a repository. That setup should give a developer everything they need to do build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, true. We could make a setup.ps1
which pulls chocolatey from the web, etc, and uses that to install GitVersion. but maybe a bit intrusive. Is it possible to install choco packages without admin? If not, this will definitely not work for build servers, etc. I love having the same script on build servers as local, so that would be nice, to create a setup.ps1, which assures all necessary tools are in place, and then the build.ps1 (or cake, maybe, preferably), could do the build part itself.
nuget it part of the build chain, but the .exe of chocolatey is not in the nuget package (which makes sense).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The good news? Cake does all of this already.
<ILMergeAssemblies Include="$(OutputPath)*.dll" /> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<IgnoreFile>..\..\build.custom\ilmerge.internalize.ignore.txt</IgnoreFile> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider moving this somewhere more appropriate over time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course. We could move all these up to the roundhouse.console project (maybe in a "pack" or "nuget" subfolder).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More of a placeholder comment... just thinking about where they could go, no action to be done now.
</ItemGroup> | ||
<PropertyGroup> | ||
<IgnoreFile>..\..\build.custom\ilmerge.internalize.ignore.txt</IgnoreFile> | ||
<ILMerge>..\..\lib\ILMerge\ILMerge.exe</ILMerge> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this resource come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which resource? ILMerge.exe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<ILMerge>
- typically if you use things from MSBuild that are not included, it can cause failures. It's good to know if this is build into MsBuild or requires a community pack or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, no, is not a task. It is just a property. Maybe I should have called it <ILMergeExe>
or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see it now... property group. My bad...
<Output ItemName="BuiltExeOutputGroupOutput" TaskParameter="Include"/> | ||
</CreateItem> | ||
|
||
<CreateItem Include="$(ExeProjectOutputDir)\**\*.*" Condition="'$(OutDir)' != '$(OutputPath)'"> | ||
<CreateItem Include="$(ExeProjectOutputDir)\**\*" Condition="'$(OutDir)' != '$(OutputPath)'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thanks for fixing these
@ferventcoder - I have created an AppVeyor account and sent you the email that I prefer. @erikbra - I'm having mixed results when I pull this down. The build is fine in visual studio and the command line, but it looks like the console pack and unit test aren't going correctly. This is what I am seeing here:
Unfortunately, I got a late start tonight and my brain is kind of mush. You would expect this to work, right? I installed GitVersion, and added msbuild to my path so I can hit it from powershell; was there something else I was supposed to do? |
I can see the project in AppVeyor, so gtg there. |
@BiggerNoise Probably forgot to create some folders if not already existing, in the msbuild script. I'll do a git clean and try again. |
Try again now, @BiggerNoise . There was some confusion btw Solution configurations (Which are "Build|Any CPU") and project configurations (which are "Release|AnyCPU"). There are no "Build" project configurations. "Build" solution config is set to build the "Release" project configs. In addition, there was the AnyCPU/Any CPU (with blank) confusion, as described here: http://jimmyscorner.com/archives/51/the-differences-between-solution-build-configurations-and-project-build-configurations This made the folders not align up, as I thought the conditionals on Configuration = "Build|AnyCPU" would hit. They didn't. But now it should work from scratch. |
@erikbra I don't think that your commits made it to the P/R |
Blaargh, sorry. I may have forgotten to push. I'll check when I get to that computer in the morning (CET). |
Yepz, n00b mistake. Commit, move on to something else. Forgot to push. Now it should build from scratch, @BiggerNoise . |
I'm still having a couple of issues building from scratch, but don't have time to get into them this morning. I updated the AppVeyor project to run .\build.ps1 (for now). It's reporting success, but it's lying. Let me know if you have trouble seeing the logs. |
Yes, it should fail on error output. I don't know how to configure that in AppVeyor, only TeamCity. Seems like some of the folders still don't exist beforehand. I'll see if I can reproduce if nuking my ~/.nuget folder. Didn't think of that one. And code_drop\log\ is missing (some of it), apparently, too. |
We have too old MSBuild in AppVeyor, @BiggerNoise. We need 15.0. See log from latest build:
That's why we don't have a |
@erikbra have tried defining appveyor.yml with vs2017 image? The preview part shouldn't be necessary anymore though. |
@lahma We will get the appveyor.yml file exported to this source once it is all set up. Currently it is defined as follows: version: 1.0.{build}
image: Visual Studio 2017
build_script:
- ps: .\build.ps1 |
@ferventcoder Now that I actually read the output from appveyor, it seems that MSBuild should be good to go.
However, Does not seem to resolve to correct dir: What about:
The next errors seems to originate from the fact that databases cannot be contacted, have they been enabled in build configuration? Appveyor also does some automatic test detection magic so might conflict with build.ps1... |
if running in AppVeyor, tests will be automatically discovered and run.
I have fixed the Nuget folder problem (look for @ferventcoder: You just need to tell it not to run the integration tests, as we don't have any integration tests environments set up yet. Can be done like this: https://www.appveyor.com/docs/running-tests/#selecting-assemblies-andor-categories-to-test Probably should use |
We have a lot to go on with regards to test setup, artifacts gathering, etc, but at least we're building on AppVeyor now. I would prefer if we could put the AppVeyor config in source. Easier to maintain. But maybe we should make a separate issue for that, @ferventcoder . We also have some cleanup tasks, to assure all the nuget packages created are OK, etc, etc (I think they're not right now). I'm at 00:30 CET now, so I'm retiring for the day. I'll let the rest of the world work :) |
Microsoft introduced a new form of .csproj files related to the introduction of .NET core. These new, simplified files can also be used for "classic" .NET projects. The .csproj format is much simpler, files are globbed by default (no need to name each file of the project in the .csproj), and it has support for having nuget references directly in the .csproj file as
<PackageReference>
elements, instead of using packages.config.This is the csproj file format going forward, and the MS tools will be optimized for this format.
I did have a couple of issues, though. The current build process had a few dependencies to old ways of doing stuff.
msbuild /p:Configuration=Build
and everything works, but the UppercuT things I couldn't get to work, I need some help.build_new.ps1
, which does everything up to and including ILMerge, and I produce a running rh.exe. But I don't expect you to accept the pull request as is, as the standardbuild.bat
doesn't work properly. I would love if @ferventcoder could take a look at what's wrong.I would appreciate some feedback from both @BiggerNoise and @ferventcoder on this PR. Is this an OK size for a PR related to #284, or is it too big? The problem is, Nuget package versions are tightly coupled to Nuget version, which is coupled to MSBuild version, which is coupled to the .csproj file format. So is's difficult to change one of them in isolation.