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

Nugetize #26

Merged
merged 9 commits into from
Sep 5, 2018
Merged

Nugetize #26

merged 9 commits into from
Sep 5, 2018

Conversation

TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Sep 1, 2018

This nugetizes the worker so that another project can bring it in via nuget package.

also fixes a test

@TylerLeonhardt
Copy link
Member Author

TylerLeonhardt commented Sep 1, 2018

After dotnet build

The resulting nupkg looks right:

nuspec:

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
  <metadata>
    <id>Azure.Functions.PowerShell.Worker</id>
    <version>0.1.0</version>
    <title>Azure Function PowerShell Language Worker</title>
    <authors>Microsoft</authors>
    <owners>Microsoft</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <licenseUrl>https://github.com/Azure/azure-functions-powershell-worker/blob/dev/LICENSE</licenseUrl>
    <projectUrl>https://github.com/Azure/azure-functions-powershell-worker</projectUrl>
    <iconUrl>https://github.com/PowerShell/PowerShell/blob/master/assets/Powershell_64.png</iconUrl>
    <description>The Azure Function PowerShell Language Worker allows users to write Azure Function Apps using PowerShell. It leverages the PowerShell Core SDK.</description>
    <releaseNotes># 0.1.0

    Initial Release</releaseNotes>
    <copyright>© Microsoft Corporation. All rights reserved.</copyright>
    <tags>azure,functions,powershell,worker</tags>
    <dependencies>
      <group targetFramework=".NETCoreApp2.1">
        <dependency id="CommandLineParser" version="2.3.0" exclude="Build,Analyzers" />
        <dependency id="Google.Protobuf" version="3.6.1" exclude="Build,Analyzers" />
        <dependency id="Grpc" version="1.14.1" exclude="Build,Analyzers" />
        <dependency id="Microsoft.NETCore.App" version="2.1.0" exclude="Build,Analyzers" />
        <dependency id="Microsoft.PowerShell.SDK" version="6.1.0-rc.1" exclude="Build,Analyzers" />
        <dependency id="Newtonsoft.Json" version="11.0.2" exclude="Build,Analyzers" />
      </group>
    </dependencies>
    <contentFiles>
      <files include="any/netcoreapp2.1/worker.config.json" buildAction="Content" />
      <files include="any/netcoreapp2.1/Modules/Azure.Functions.PowerShell.Worker.Module/Azure.Functions.PowerShell.Worker.Module.psd1" buildAction="Content" />
      <files include="any/netcoreapp2.1/Modules/Azure.Functions.PowerShell.Worker.Module/Azure.Functions.PowerShell.Worker.Module.psm1" buildAction="Content" />
    </contentFiles>
  </metadata>
</package>

Directory structure:
image

There's one strange thing I can't figure out... Why the worker.config.json file, and the helper PowerShell module aren't being copied to the Publish folder when you add the newly generated nuget package to a random other .net project.

I used this example to test...
https://github.com/dasMulli/LocalNupkgExample

I added the nugetized worker to this project and then did a dotnet publish.

Tylers-MacBook-Pro:testProj tyler$ ls bin/Debug/netcoreapp2.1/publish/
Azure.Functions.PowerShell.Worker.dll		System.Data.SqlClient.dll			System.Security.Permissions.dll
CommandLine.dll					System.Diagnostics.EventLog.dll			System.ServiceModel.Duplex.dll
Google.Protobuf.dll				System.Diagnostics.PerformanceCounter.dll	System.ServiceModel.Http.dll
Grpc.Core.dll					System.DirectoryServices.AccountManagement.dll	System.ServiceModel.NetTcp.dll
Markdig.dll					System.DirectoryServices.Protocols.dll		System.ServiceModel.Primitives.dll
Microsoft.ApplicationInsights.dll		System.DirectoryServices.dll			System.ServiceModel.Security.dll
Microsoft.CodeAnalysis.CSharp.dll		System.Drawing.Common.dll			System.ServiceModel.Syndication.dll
Microsoft.CodeAnalysis.dll			System.IO.Packaging.dll				System.ServiceModel.dll
Microsoft.Win32.Registry.AccessControl.dll	System.IO.Ports.dll				System.ServiceProcess.ServiceController.dll
Microsoft.Win32.SystemEvents.dll		System.Interactive.Async.dll			System.Text.Encoding.CodePages.dll
NJsonSchema.dll					System.Management.dll				System.Text.Encodings.Web.dll
Newtonsoft.Json.dll				System.Net.Http.WinHttpHandler.dll		System.Threading.AccessControl.dll
System.CodeDom.dll				System.Runtime.Caching.dll			runtimes
System.ComponentModel.Composition.dll		System.Runtime.CompilerServices.Unsafe.dll	testProj.deps.json
System.Configuration.ConfigurationManager.dll	System.Security.Cryptography.Pkcs.dll		testProj.dll
System.Data.DataSetExtensions.dll		System.Security.Cryptography.ProtectedData.dll	testProj.pdb
System.Data.Odbc.dll				System.Security.Cryptography.Xml.dll		testProj.runtimeconfig.json

For some reason, all the dlls are in there but none of the other assets I mentioned before... I don't know why

@TylerLeonhardt
Copy link
Member Author

@SteveL-MSFT + @daxian-dbw and idea? or any idea who is knowledgeable on nuget packages?

@daxian-dbw
Copy link
Contributor

@tylerl0706 You can take a look at the layout of PowerShellHelpFiles and PSDesiredConfiguration packages. Their content can be deployed to our publish folder without problem:

https://powershell.myget.org/feed/powershell-core/package/nuget/PowerShellHelpFiles
https://powershell.myget.org/feed/powershell-core/package/nuget/PSDesiredStateConfiguration

@TylerLeonhardt
Copy link
Member Author

Ok fixed it. We needed to add PackageCopyToOutput="true" to the Content tags. Removing WIP.

Please review @daxian-dbw :)

@TylerLeonhardt TylerLeonhardt changed the title WIP: Nugetize Nugetize Sep 4, 2018
<Project>
<PropertyGroup>
<Version>0.1.0</Version>
<PackageId>Azure.Functions.PowerShell.Worker</PackageId>
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we do the renaming (from Azure.Functions.PowerShell.Worker to Microsoft.Azure.Functions.PowerShellWorker) in this repo before publishing NuGet package?

Not necessarily be done in this PR. I think it's better to do it after merging this PR.

Copy link
Member Author

@TylerLeonhardt TylerLeonhardt Sep 5, 2018

Choose a reason for hiding this comment

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

Yeah I agree. We should see what the other language workers are called and try to be consistent.

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<Product>Azure Function PowerShell Language Worker</Product>
Copy link
Contributor

Choose a reason for hiding this comment

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

<Company> and <CopyRight> tags are included in the package.props, but the <Product> tag probably should be kept?

Copy link
Member Author

Choose a reason for hiding this comment

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

added.

</None>
<None Include="Modules\**">
</Content>
<Content Include="Modules\**" PackageCopyToOutput="true">
Copy link
Contributor

Choose a reason for hiding this comment

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

Yay!! 💯

@TylerLeonhardt TylerLeonhardt merged commit 7faeea5 into dev Sep 5, 2018
@daxian-dbw daxian-dbw deleted the nugetize branch September 7, 2018 06:33
davidmrdavid added a commit that referenced this pull request Apr 7, 2022
# This is the 1st commit message:

separate DF SDK classes from DF worker classes

# This is the commit message #2:

fix typo

# This is the commit message #3:

DurableSDK now compiles by itself

# This is the commit message #4:

Allow ExternalSDK to handle orchestration

# This is the commit message #5:

document next steps

# This is the commit message #6:

allow external SDK to set the user-code's input. Still need to refactor this logic for the worker to continue working with old SDK

# This is the commit message #7:

add import module

# This is the commit message #8:

supress traces

# This is the commit message #9:

avoid nullptr

# This is the commit message #10:

pass tests

# This is the commit message #11:

fix E2E tests

# This is the commit message #12:

develop E2E tests

# This is the commit message #13:

Enabled external durable client (#765)

Co-authored-by: Michael Peng <michaelpeng@microsoft.com>
# This is the commit message #14:

bindings work

# This is the commit message #15:

conditional binding intialization

# This is the commit message #16:

conditional import

# This is the commit message #17:

Added exception handling logic

# This is the commit message #18:

Revert durableController name to durableFunctionsUtils

# This is the commit message #19:

Ensure unit tests are functioning properly

# This is the commit message #20:

Corrected unit test names

# This is the commit message #21:

Turned repeated variables in unit tests into static members

# This is the commit message #22:

Fixed issue with building the worker

# This is the commit message #23:

Fix E2E test

# This is the commit message #24:

Fixed unit test setup

# This is the commit message #25:

Fixed another unit test setup

# This is the commit message #26:

Remove string representation of booleans

# This is the commit message #27:

patch e2e test
# This is the commit message #28:

remove typo in toString
# This is the commit message #29:

Update PowerShell language worker pipelines (#750)

* Install .Net to a global location

* Remove .Net installation tasks

* Update install .Net 6 task

* Update Windows image to use windows-latest
# This is the commit message #30:

Make throughput warning message visible for tooling diagnosis (#757)


# This is the commit message #31:

Update grpc.tools to version 2.43.0

# This is the commit message #32:

Update Google.Protobuf.Tools to version 3.19.4

# This is the commit message #33:

Revert "Update Google.Protobuf.Tools to version 3.19.4"

This reverts commit bcbd022.

# This is the commit message #34:

Revert "Update grpc.tools to version 2.43.0"

This reverts commit ccb323a.

# This is the commit message #35:

Update Google.Protobuf to 3.19.4 and grpc.tools to  2.43.0 (#762)

* Update grpc.tools to version 2.43.0

* Update Google.Protobuf.Tools to version 3.19.4
# This is the commit message #36:

Switch from Grpc.Core to Grpc.Net.Client (#758)

* Upgraded protobuf versions and removed Grpc.Core dependency

* Updated channel and option types used

* Change channel credentials

* Added http prefix to url

* Add valid URL check and explicitly include credentials
# This is the commit message #37:

Update pipeline logic to generate the SBOM for release builds (#767)
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

Successfully merging this pull request may close these issues.

None yet

2 participants