-
Notifications
You must be signed in to change notification settings - Fork 19
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
Incremental building #448
Labels
Comments
I've managed to work around it, for now, by manually importing the SDK and pasting some code from <Project>
<PropertyGroup>
<!-- https://github.com/microsoft/MSBuildSdks/blob/32403937dc2bb90f74c2156b9e140538b3f25d51/src/NoTargets/Sdk/Sdk.props#L49 -->
<!-- Don't log the high priority message mentioning this project's name (or copy the product we didn't build). -->
<SkipCopyBuildProduct>true</SkipCopyBuildProduct>
</PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.Build.Sql" Version="0.1.15-preview" />
<PropertyGroup>
<Name>MyDb</Name>
<DSP>Microsoft.Data.Tools.Schema.Sql.Sql160DatabaseSchemaProvider</DSP>
<ModelCollation>1033, CI</ModelCollation>
</PropertyGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.Build.Sql" Version="0.1.15-preview" />
<!-- https://github.com/microsoft/MSBuildSdks/blob/32403937dc2bb90f74c2156b9e140538b3f25d51/src/NoTargets/Sdk/Sdk.targets#L34 -->
<PropertyGroup>
<!-- This property must be overridden to remove a few targets that compile assemblies -->
<CoreBuildDependsOn>
BuildOnlySettings;
PrepareForBuild;
PreBuildEvent;
ResolveReferences;
Compile;
GetTargetPath;
PrepareForRun;
IncrementalClean;
PostBuildEvent
</CoreBuildDependsOn>
<!-- Disable symbol generation -->
<DebugType>None</DebugType>
<DebugSymbols>false</DebugSymbols>
<!-- Don't emit a reference assembly -->
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
</PropertyGroup>
<!-- Clear output group items which are read by the IDE and NuGet. -->
<ItemGroup>
<BuiltProjectOutputGroupKeyOutput Remove="@(BuiltProjectOutputGroupKeyOutput)" />
<DebugSymbolsProjectOutputGroupOutput Remove="@(DebugSymbolsProjectOutputGroupOutput)" />
<IntermediateAssembly Remove="@(IntermediateAssembly)" />
<IntermediateRefAssembly Remove="@(IntermediateRefAssembly)" />
<Reference Remove="mscorlib" />
</ItemGroup>
<!-- https://github.com/microsoft/MSBuildSdks/blob/32403937dc2bb90f74c2156b9e140538b3f25d51/src/NoTargets/Sdk/Sdk.targets#L95 -->
<!-- Override stock CoreCompile target to do nothing but keep extensibility points -->
<Target
Name="CoreCompile"
DependsOnTargets="$(CoreCompileDependsOn)">
<CallTarget Targets="$(TargetsTriggeredByCompilation)" Condition="'$(TargetsTriggeredByCompilation)' != ''" />
</Target>
</Project> Would you consider moving this code (or something similar) into the SDK? |
zijchen
added
enhancement
New feature or request
area: build sdk
Related to Microsoft.Build.Sql SDK
labels
May 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
If I've built my
sqlproj
already, and none of the.sql
files in the project have changed, the outputdacpac
should not be rebuilt the next time I rundotnet build
.From what I can tell, this seems to be something to do with the fact that
Microsoft.Build.Sql
inherits the default C# targets and produces adll
by default. The log says:Input file "D:\test\MyDb\obj\Debug\MyDb.dll" is newer than output file "D:\test\MyDb\bin\Debug\MyDb.dacpac".
andMyDb.dll
appears to be produced byCoreCompile
running right beforeSqlBuild
.Perhaps
Microsoft.Build.Sql
should do something similar to whatMicrosoft.Build.NoTargets
does to suppress the production of an assembly?The text was updated successfully, but these errors were encountered: