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 a build target for convenient creation of local nuget packages #47

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

josephdecock
Copy link
Member

This PR creates a PackAndMove target that packages our libraries locally and moves them to a shared location. This is much more convenient than dealing with a whole bunch of nested subdirectories like
\identity-model\src\IdentityModel\bin\Debug\, both for checking details of the output file and for consuming local builds of packages for testing.

Each package can individually be packed and moved, or you can just run the target from the root of the repo and package everything. To ensure that we only package the right things, we respect the property, and there's a bit of cleanup in this PR to make sure IsPackable is set correctly everywhere. There's a new samples.props file to turn it off for sample and client projects.

You can either use the default /packages directory within the repo as the destination, or specify it via environment variable or command line arg.

This PR also creates a docs directory within the foss repo as a home for internal documentation. The first page of that internal doc is a description of this target. I've recently been experimenting with different possible homes for developer docs, and I think I prefer this over anything else, because it co-locates everything - this one PR contains both the new tooling and the documentation for that new tooling.

@damianh damianh added priority/3 Medium area/all Across all components. labels Nov 16, 2024
Comment on lines 1 to 10
<Project>
<PropertyGroup>
<DuendePackageDir Condition=" '$(DuendePackageDir)' == '' ">$(MSBuildThisFileDirectory)packages</DuendePackageDir>
</PropertyGroup>

<Target Name="PackAndMove" Condition="'$(IsPackable)' == 'true'">
<Exec Command="dotnet pack --configuration Release --output $(DuendePackageDir)" />
</Target>

</Project>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dotnet pack -o <OutputDir>, dotnet pack -o $env:PACKAGES_PATH at solution level should be sufficient I'd say so don't think we need a custom build target.

@@ -0,0 +1,52 @@
# Building Packages Locally
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Directory.Build.targets is removed, can remove this.

Was just thinking if we even need to mention how to build in the readme... it's all standard dotnet CLI after all.

Copy link
Member

@damianh damianh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think we need the custom build target.

The rest of the clean up in the PR (samples.props etc) is 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/all Across all components. priority/3 Medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants