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

Produce outputs on build is removed from RC2 and PostCompile does not work as expected #6122

Closed
StefH opened this issue May 17, 2016 · 6 comments

Comments

@StefH
Copy link

StefH commented May 17, 2016

In RC1 (dnx) you could check the option "Produce outputs on build" which creates a NuGet after the build.

However in RC2 (dotnet) this does not work anymore, and the postcompile cannot be use for that.

I've defined this in my project.json:

"scripts": {
        "postcompile": [ "dotnet pack --no-build --version-suffix %project:Version% project.json" ]
    },

However this step is executed for every framework in my projoct.json ?

1>      0 Error(s)
1>  Time elapsed 00:00:01.9413921
1>   (The compilation time can be improved. Run "dotnet build --build-profile" for more information)
1>  Project Linq.PropertyTranslator.Core (.NETStandard,Version=v1.4) will be compiled because project is not safe for incremental compilation. Use --build-profile flag for more information.
1>  Compiling Linq.PropertyTranslator.Core for .NETStandard,Version=v1.4
1>  Producing nuget package "Linq.PropertyTranslator.Core.1.0.2-1.0.2" for Linq.PropertyTranslator.Core
1>  Linq.PropertyTranslator.Core -> C:\Projects\GitHub\Linq.PropertyTranslator.Core\src\Linq.PropertyTranslator.Core\bin\Debug\Linq.PropertyTranslator.Core.1.0.2-1.0.2.nupkg
1>  Producing nuget package "Linq.PropertyTranslator.Core.1.0.2-1.0.2.symbols" for Linq.PropertyTranslator.Core
1>  Linq.PropertyTranslator.Core -> C:\Projects\GitHub\Linq.PropertyTranslator.Core\src\Linq.PropertyTranslator.Core\bin\Debug\Linq.PropertyTranslator.Core.1.0.2-1.0.2.symbols.nupkg
1>  Compilation succeeded.
1>      0 Warning(s)
1>      0 Error(s)
1>  Time elapsed 00:00:01.9015257
1>   (The compilation time can be improved. Run "dotnet build --build-profile" for more information)
1>  Project Linq.PropertyTranslator.Core (.NETStandard,Version=v1.5) will be compiled because project is not safe for incremental compilation. Use --build-profile flag for more information.
1>  Compiling Linq.PropertyTranslator.Core for .NETStandard,Version=v1.5
1>  Producing nuget package "Linq.PropertyTranslator.Core.1.0.2-1.0.2" for Linq.PropertyTranslator.Core
1>  Linq.PropertyTranslator.Core -> C:\Projects\GitHub\Linq.PropertyTranslator.Core\src\Linq.PropertyTranslator.Core\bin\Debug\Linq.PropertyTranslator.Core.1.0.2-1.0.2.nupkg
1>  Producing nuget package "Linq.PropertyTranslator.Core.1.0.2-1.0.2.symbols" for Linq.PropertyTranslator.Core
1>  Linq.PropertyTranslator.Core -> C:\Projects\GitHub\Linq.PropertyTranslator.Core\src\Linq.PropertyTranslator.Core\bin\Debug\Linq.PropertyTranslator.Core.1.0.2-1.0.2.symbols.nupkg
1>  Compilation succeeded.
1>      0 Warning(s)
1>      0 Error(s)
1>  Time elapsed 00:00:01.9287423
@MarcoMiltenburg
Copy link

Instead of "postcompile" you should use "postpublish" or "postbuild" (if you'd like the package(s) to be created after each build).

@DazFahy
Copy link

DazFahy commented May 22, 2016

postbuild is not working in RC2, it never gets executed whereas postcompile does

@Mertsch
Copy link

Mertsch commented May 28, 2016

Yes, sadly postbuild does nothing. A possible workaround is to edit your .xproj file and add

<Target Name="AfterBuild">
  <Exec Command="dotnet pack"/>
</Target>

@StefH
Copy link
Author

StefH commented May 29, 2016

Maybe not that strange...

In the future all these things will maybe move to csproj so no worries...

@takazm
Copy link

takazm commented Jun 29, 2016

Any fix for this yet?

@TheRealPiotrP
Copy link
Contributor

@StefH had this right :) Preview3 moves this behavior to csproj and lets us use msbuild for build orchestration. Pack itself is now a target, making this sort of chaining even easier.

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
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

6 participants