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

Add possibility to generate documentation on source-changes #615

Closed
nils-a opened this issue Aug 6, 2020 · 8 comments · Fixed by #641
Closed

Add possibility to generate documentation on source-changes #615

nils-a opened this issue Aug 6, 2020 · 8 comments · Fixed by #641
Assignees
Labels
Milestone

Comments

@nils-a
Copy link
Contributor

nils-a commented Aug 6, 2020

currently Publish-Documentation checks for changes to documentation files in the current commit:
https://github.com/cake-contrib/Cake.Recipe/blob/1.1.2/Cake.Recipe/Content/wyam.cake#L33-L46

It would be nice to have the ability to check for source-file changes, too. Probably add a new BuildParameter ShouldGenerateDocumentationOnSrcChange ?

One would have to include the sourceDirectoryPath and possibly exclude the testDirectoryPath.

@nils-a
Copy link
Contributor Author

nils-a commented Aug 6, 2020

Never mind. Should be possible, when a042e8a is released

@nils-a nils-a closed this as completed Aug 6, 2020
@gep13
Copy link
Member

gep13 commented Aug 18, 2020

@nils-a I think we should open this again, just to make sure that it works as intended, once things have shipped. That way, it won't drop off the radar.

@gep13 gep13 reopened this Aug 18, 2020
@nils-a
Copy link
Contributor Author

nils-a commented Aug 18, 2020

@gep13 agreed. From looking at the diffs again I'm no longer sure whether the changes do what I suspected them to do at first glance or rather whether they enable/disable generation of source documentation at all.

nils-a added a commit to nils-a/Cake.Recipe that referenced this issue Aug 19, 2020
@nils-a
Copy link
Contributor Author

nils-a commented Aug 19, 2020

I'm guessing something like develop...nils-a:feature/GH-615 is needed.

However, I can not get the current develop-branch of cake.recipe to work (i.e. not even the integration tests) so I'm not sure "what" the code does... (Hence, no PR at the moment...)

@gep13
Copy link
Member

gep13 commented Aug 19, 2020

@nils-a what issues are you seeing? If you can provide some more information we should hopefully be able to help.

@nils-a
Copy link
Contributor Author

nils-a commented Aug 20, 2020

@gep13 on a vanilla clone, running .\build.ps1 ; .\build.ps1 -Script test.cake the error is

========================================
Tests: Cake.Twitter
========================================
Testing c:/CakeRecipeTests/repos/Cake.Twitter/recipe.cake...
Could not load c:\CakeRecipeTests\repos\Cake.Twitter\tools\Addins\Cake.Issues.Reporting.Generic.0.9.0-beta0001\lib\netstandard2.0\Microsoft.CodeAnalysis.Scripting.dll (missing System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
Using Local Build Provider...
Testing to see if valid git repository...
Unable to find git, setting default values for repository properties...
Printing Build Parameters...
IsLocalBuild: True
IsPullRequest: False
IsMainRepository: False
IsPublicRepository: True
IsTagged: False
BranchType: Unknown
TreatWarningsAsErrors: True
ShouldPublishToMyGetWithApiKey: True
ShouldSendEmail: True
ShouldPostToGitter: True
ShouldPostToSlack: True
ShouldPostToTwitter: True
ShouldPostToMicrosoftTeams: False
ShouldDownloadFullReleaseNotes: False
ShouldDownloadMilestoneReleaseNotes: False
ShouldNotifyBetaReleases: False
ShouldDeleteCachedFiles: False
ShouldGenerateDocumentation: False
ShouldDocumentSourceFiles: False
ShouldRunIntegrationTests: False
ShouldCalculateVersion: True
BuildAgentOperatingSystem: Windows
IsRunningOnAppVeyor: False
RepositoryOwner: cake-contrib
RepositoryName: Cake.Twitter
TransifexEnabled: False
CanPullTranslations: False
CanPushTranslations: False
PrepareLocalRelease: False
BuildAgentOperatingSystem: Windows
ForceContinuousIntegration: False
PreferredBuildAgentOperatingSystem: Windows
PreferredBuildProviderType: AppVeyor
WyamRootDirectoryPath: c:/CakeRecipeTests/repos/Cake.Twitter/docs
WyamPublishDirectoryPath: c:/CakeRecipeTests/repos/Cake.Twitter/BuildArtifacts/temp/_PublishedDocumentation
WyamConfigurationFile: c:/CakeRecipeTests/repos/Cake.Twitter/config.wyam
WyamRecipe: Docs
WyamTheme: Samson
WyamSourceFiles: ../../Source/**/{!bin,!obj,!packages,!*.Tests,}/**/*.cs
Wyam Deploy Branch: [NULL]
Wyam Deploy Remote: [NULL]
WebHost: cake-contrib.github.io
WebLinkRoot: Cake.Twitter
WebBaseEditUrl: https://github.com/cake-contrib/Cake.Twitter/tree/develop/docs/input/
NuSpecFilePath: c:/CakeRecipeTests/repos/Cake.Twitter/Cake.Recipe/Cake.Recipe.nuspec
NugetConfig: c:/CakeRecipeTests/repos/Cake.Twitter/NuGet.Config (False)
NuGetSources: https://api.nuget.org/v3/index.json, https://www.myget.org/F/cake-contrib/api/v3/index.json
RestorePackagesDirectory: [NULL]
EmailRecipient: [NULL]
EmailSenderName: [NULL]
EmailSenderAddress: [NULL]
Setting up tools...

----------------------------------------
Setup
----------------------------------------
Initializing Cake.Issues.Recipe (Version 0.4.0-beta0001)...

----------------------------------------
Setup
----------------------------------------
Error: Could not find an installer for the 'dotnet' scheme.

----------------------------------------
Teardown
----------------------------------------
An error occurred in a custom teardown action.
Teardown error: System.InvalidOperationException: The context data has not been setup.
   at Cake.Core.CakeDataService.Get[TData]()
   at Cake.Core.CakeEngineActions.<>c__DisplayClass21_0`1.<RegisterTeardown>b__0(ITeardownContext context)
   at Cake.Core.DefaultExecutionStrategy.PerformTeardown(Action`1 action, ITeardownContext teardownContext)
   at Cake.Core.CakeEngine.PerformTeardown(IExecutionStrategy strategy, ICakeContext context, Stopwatch stopWatch, CakeReport report, Boolean exceptionWasThrown, Exception thrownException)
Error: One or more errors occurred.
        Cake: Process returned an error (exit code 1).
Cake.Twitter: Cake.Core.CakeException: Cake: Process returned an error (exit code 1).
   at Cake.Core.Tooling.Tool`1.ProcessExitCode(Int32 exitCode)
   at Cake.Core.Tooling.Tool`1.Run(TSettings settings, ProcessArgumentBuilder arguments, ProcessSettings processSettings, Action`1 postAction)
   at Cake.Common.Tools.Cake.CakeRunner.ExecuteScript(FilePath scriptPath, CakeSettings settings)
   at Submission#0.<>c__DisplayClass0_1.<<Initialize>>b__8(ICakeContext context) in D:\_dev\Cake.Recipe\test.cake:line 125

========================================
Tests
========================================
An error occurred when executing task 'Tests'.

----------------------------------------
Teardown
----------------------------------------
Error: One or more errors occurred.
        https://github.com/cake-contrib/Cake.Gulp.git
        https://github.com/cake-contrib/Cake.Http.git
        https://github.com/cake-contrib/Cake.Twitter.git

and while I'm guessing the error originates at https://github.com/cake-build/cake/blob/3e8bd7a7589d0e38e819011230aff215f8eef4ce/src/Cake.Core/Scripting/ScriptProcessor.cs#L104 I'm currently somewhat lost in tracking it down.

@gep13
Copy link
Member

gep13 commented Aug 20, 2020

Ah, so the build itself works, but the included integration tests don't. I "think" that actually makes sense. Those projects won't have been updated to include the Cake.Recipe 2.0 related changes, and likely other things, so I don't think that this is a showstopper. @AdmiringWorm has another repository that we have been using for testing out the changes to Cake.Recipe (https://github.com/cake-contrib/Cake.Recipe.Tests). For now, I wouldn't worry about running the local integration tests, but we will need to get these fixed up.

@nils-a
Copy link
Contributor Author

nils-a commented Aug 31, 2020

@gep13 Thanks for the pointer - I wasn't even sure my code worked in the slightest (and it didn't..). So I needed some tests :-)

gep13 pushed a commit to nils-a/Cake.Recipe that referenced this issue Sep 2, 2020
@gep13 gep13 added this to the 2.0.0 milestone Sep 2, 2020
@gep13 gep13 added the Feature label Sep 2, 2020
@gep13 gep13 closed this as completed in #641 Sep 2, 2020
gep13 pushed a commit that referenced this issue Sep 2, 2020
… set

When generating docs, Cake.Recipe should take into consideration whether
or not changes in the project source code should result in updating the docs.
This is especially important when building API documentation using Wyam.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants