-
-
Notifications
You must be signed in to change notification settings - Fork 366
Adds Generators solution to build #448
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
Conversation
build.cake
Outdated
.IsDependentOn("CopyGenerators") | ||
.Does(() => { | ||
var generatorsProject = GetFiles(generatorsBuildDir + "/*.csproj"); | ||
Parallel.ForEach(generatorsProject, parallelOptions, (project) => NuGetRestore(project.FullPath)); |
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.
We shouldn't need to call NuGetResore() explicitly since DotNetCoreBuild() will do an implicit restore for us.
build.cake
Outdated
.Does(() => { | ||
var generatorsProject = GetFiles(generatorsBuildDir + "/*.csproj"); | ||
Parallel.ForEach(generatorsProject, parallelOptions, (project) => NuGetRestore(project.FullPath)); | ||
Parallel.ForEach(generatorsProject, parallelOptions, (project) => DotNetBuild(project.FullPath)); |
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.
This should be DotNetCoreBuild as this is a .NET Core 2 project.
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 generators solution contains one project, so we shouldn't need to run this build step in parallel.
build.cake
Outdated
.Does(() => { | ||
CopyDirectory($"{generatorsSourceDir}/", $"{generatorsBuildDir}"); | ||
}); | ||
|
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.
We don't perform any file replacements in the generators project like we do in the exercises (replacing the example with the stub). There shouldn't be any need to copy the generators directory.
build.ps1
Outdated
|
||
(New-Object System.Net.WebClient).DownloadFile($NuGetExeUri, $NuGetExePath); | ||
|
||
########################################################################### |
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.
Travis already has NuGet on the CI server, so we shouldn't need to download it.
build.ps1
Outdated
|
||
(New-Object System.Net.WebClient).DownloadFile($NuGetExeUri, $NuGetExePath); | ||
|
||
########################################################################### |
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.
Travis already has NuGet, so we shouldn't need to install it.
Thanks for working on this, @jakauppila ! I've requested some changes for your PR. If you have any questions, please do not hesitate to ask. |
@jpreese Made the requested changes, Travis is now green! |
Excellent, thanks! |
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.
Great work! I've requested a couple of small changes. Once those are in, this will be ready to merge!
build.cake
Outdated
var exercisesSourceDir = "./exercises"; | ||
var exercisesBuildDir = "./build/exercises"; | ||
|
||
var generatorsSourceDir = "./generators"; |
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.
This variable is only ever used in a single place, so I think it would be better to remove this variable and just use "./generators/Generators.csproj"
in the BuildGeneratorsSolution
step.
build.cake
Outdated
@@ -5,7 +5,11 @@ using System.Threading.Tasks; | |||
var target = Argument("target", "Default"); | |||
var exercise = Argument<string>("exercise", null); | |||
|
|||
var sourceDir = "./exercises"; | |||
var exercisesSourceDir = "./exercises"; |
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 think we need both an exercisesSourceDir
and buildDir
variable, as the only thing that is built there are the exercises. I think we could just revert to the old situation here, where the exercise directory are directly placed and built in the ./build
directory. I do think I like your naming better, so I would like to see something like this:
var exercisesSourceDir = "./exercises";
var exercisesBuildDir = "./build";
And then you could drop the buildDir
parameter and replace it with exercisesBuildDir
wherever it is used.
build.cake
Outdated
Parallel.ForEach(allProjects, parallelOptions, (project) => DotNetCoreTest(project.FullPath)); | ||
}); | ||
|
||
Task("BuildGeneratorsSolution") |
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.
Could you change this to BuildGenerators
? The solution part is just an implementation detail.
@ErikSchierboom Requested changes have been made. |
@jakauppila Looking great! Merged. Thanks a lot. 🎉 |
Added the Generators solution to build.cake. Includes downloading Nuget.exe to build.ps1.
The only thing I'm not sure of at this point is how to to perform the NuGetRestore on Linux for Travis; I assume this will involve utilizing Mono.
Fixes #441