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

In App without Evolve.json configuration file #14

Closed
N41m0r opened this issue Sep 14, 2017 · 1 comment
Closed

In App without Evolve.json configuration file #14

N41m0r opened this issue Sep 14, 2017 · 1 comment
Assignees

Comments

@N41m0r
Copy link

N41m0r commented Sep 14, 2017

Hello Philippe,

When I build my projects (.net core 2) without configuration file "Evolve.json", my build crash because Evolve.json is not found and i would like to run Evolve only In App.

I have changed evolve.targets in my nuget package to solve this :
here is my code :

<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Evolve_PlatformSuffix Condition=" '$(Evolve_PlatformSuffix)' == '' and '$(MSBuildRuntimeType)' == 'Core' ">MSBuildCore/</Evolve_PlatformSuffix>
    <Evolve_PlatformSuffix Condition=" '$(Evolve_PlatformSuffix)' == '' ">MSBuildFull/</Evolve_PlatformSuffix>
    <IsConfigurationFile>False</IsConfigurationFile>
    <IsConfigurationFile Condition="Exists('Evolve.json')">True</IsConfigurationFile>
  </PropertyGroup>
  
  <UsingTask TaskName="Evolve.MsBuild.EvolveBoot" AssemblyFile="$(MSBuildThisFileDirectory)$(Evolve_PlatformSuffix)Evolve.dll" />
  
  <Target Name="SqlMigration" AfterTargets="Build">
    <EvolveBoot Condition="'$(IsConfigurationFile)' == 'True'" TargetPath="$(TargetPath)" ProjectDir="$(ProjectDir)" EvolveNugetPackageBuildDir="$(MSBuildThisFileDirectory)" IsDotNetStandardProject="true" Configuration="$(Configuration)" />
  </Target>
</Project>
@lecaillon lecaillon self-assigned this Sep 14, 2017
@lecaillon
Copy link
Owner

Evolve.targets updated to only execute the task if the Evolve.json configuration file is found.
A message is logged in the output window otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants