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 Opt-Out Flag to Disable MSBuild Automation #307

Open
josephdrake-stahls opened this issue Jan 30, 2025 · 0 comments
Open

Add Opt-Out Flag to Disable MSBuild Automation #307

josephdrake-stahls opened this issue Jan 30, 2025 · 0 comments

Comments

@josephdrake-stahls
Copy link

josephdrake-stahls commented Jan 30, 2025

I'm running into issues manually calling SlowCheetah.TransformTask largely in part because there is no way to disable built in targets.

Scenario

For cleaner code repository, we don't commit a App.config or Web.config. Instead we have an App.Template.config that is used for the source file. The way to do this with SlowCheetah is like this (includes Binding Redirect generation):

	<Target Name="_XmlConfigTransform_TransformAppConfig__Before_GetCopyToOutputDirectoryItems" BeforeTargets="GetCopyToOutputDirectoryItems" Condition="Exists('App.Template.config') and Exists('App.$(Configuration).config')">
		<SlowCheetah.TransformTask
			Source="App.Template.config"
			Transform="App.$(Configuration).config"
			Destination="App.config" />
		<GenerateBindingRedirects
			AppConfigFile="App.config"
			OutputAppConfigFile="App.config"
			SuggestedRedirects="@(SuggestedBindingRedirects)" />
	</Target>

Problem

  1. ScCollectAppFiles always run and tries to copy the App.config to the intermediate directory. If the App.config doesn't exists yet, it blows up.

    <Copy SourceFiles="$(AppConfig)" DestinationFiles="$(ScIntermediateAppConfig)"/>

  2. ScTransformAppConfig always runs and regardless of any transformations occurring will replace the AppConfig property with the App.config that was copied to the intermediate directory.

Solution

Add an "opt-out" flag that disables all SlowCheetah automation.

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

No branches or pull requests

1 participant