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

Resolve dependencies using UnityNuGet scoped registry #9

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 78 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,66 @@ Architecture/Platform | Windows | macOS | Linux | Android | iOS
## Installation
### Unity

To install this library, specify the following URL in `Add package from git URL...` of Package Manager on Unity.
> This library depends on the following additional libraries:
>
> - [System.IO.Pipelines](https://www.nuget.org/packages/System.IO.Pipelines) (netstandard2.1)
> - [System.Runtime.CompilerServices.Unsafe](https://www.nuget.org/packages/System.Runtime.CompilerServices.Unsafe) (netstandard2.1)

#### Method 1: using UnityNuGet + OpenUPM scope registry

1. Add the [UnityNuget](https://github.com/xoofx/UnityNuGet) scope registry:

```
https://github.com/xoofx/UnityNuGet#add-scope-registry-manifestjson
```

2. Add the following additional libraries to `manifest.json`:

```json
{
"dependencies": {
"org.nuget.system.io.pipelines": "{version_1}",
"org.nuget.system.runtime.compilerservices.unsafe": "{version_2}"
}
}
```

> Replace `{version_1}` with the latest version available in NuGet: https://www.nuget.org/packages/System.IO.Pipelines#versions-body-tab

> Replace `{version_2}` with the latest version available in NuGet: https://www.nuget.org/packages/System.Runtime.CompilerServices.Unsafe#versions-body-tab

3. Follow the steps in `Manual installation`: https://openupm.com/packages/com.cysharp.yetanotherhttphandler/

#### Method 2: using UnityNuGet scope registry

1. Add the [UnityNuget](https://github.com/xoofx/UnityNuGet) scope registry:

```
https://github.com/xoofx/UnityNuGet#add-scope-registry-manifestjson
```

2. Specify the following URL in `Add package from git URL...` of Package Manager on Unity. This is the package that resolves NuGet dependencies.

```
https://github.com/Cysharp/YetAnotherHttpHandler.git?path=src/YetAnotherHttpHandler.Dependencies#v0.1.0
```

3. Specify the following URL in `Add package from git URL...` of Package Manager on Unity. This is the main packagee.

```
https://github.com/Cysharp/YetAnotherHttpHandler.git?path=src/YetAnotherHttpHandler#v0.1.0
```

Additionally, this library depends on the following additional libraries.
#### Method 3: without additional scope registries

- [System.IO.Pipelines](https://www.nuget.org/packages/System.IO.Pipelines) (netstandard2.1)
- [System.Runtime.CompilerServices.Unsafe](https://www.nuget.org/packages/System.Runtime.CompilerServices.Unsafe) (netstandard2.1)
1. Please download and install [Cysharp.Net.Http.YetAnotherHttpHandler.Dependencies.unitypackage
from the dependency redistribution on the release page](https://github.com/Cysharp/YetAnotherHttpHandler/releases/tag/redist-20230728-01).

Please download and install [Cysharp.Net.Http.YetAnotherHttpHandler.Dependencies.unitypackage
from the dependency redistribution on the release page](https://github.com/Cysharp/YetAnotherHttpHandler/releases/tag/redist-20230728-01), or obtain the library from NuGet.
2. Specify the following URL in `Add package from git URL...` of Package Manager on Unity.

📦 **Tips:** You can download NuGet packages from the "Download package" link on the right side of the package page on NuGet.org. The downloaded .nupkg file can be opened as a Zip archive, allowing you to extract individual assemblies from the `lib` directory.
```
https://github.com/Cysharp/YetAnotherHttpHandler.git?path=src/YetAnotherHttpHandler#v0.1.0
```

## Usage

Expand All @@ -96,7 +141,7 @@ Create an instance of YetAnotherHttpHandler and pass it to HttpClient.
using Cysharp.Net.Http;

using var handler = new YetAnotherHttpHandler();
var httpCilent = new HttpClient(handler);
var httpClient = new HttpClient(handler);

var result = await httpClient.GetStringAsync("https://www.example.com");
```
Expand All @@ -109,16 +154,32 @@ However, since it does not have features such as connection control by the numbe

### Using gRPC (grpc-dotnet) library

To use grpc-dotnet (Grpc.Net.Client), add the following additional libraries:
> To use grpc-dotnet (Grpc.Net.Client), add the following additional libraries:
>
> - Grpc.Core.Api
> - Grpc.Net.Client
> - Grpc.Net.Common
> - Microsoft.Extensions.Logging.Abstractions
> - System.Buffers
> - System.Diagnostics.DiagnosticSource
> - System.Memory
> - System.Numerics.Vectors

#### Method 1: using UnityNuget scope registry

To use grpc-dotnet (Grpc.Net.Client), add the following additional library to `manifest.json`:

```json
{
"dependencies": {
"org.nuget.grpc.net.client": "{version}"
}
}
```

> Replace `{version}` with the latest version available in NuGet: https://www.nuget.org/packages/Grpc.Net.Client#versions-body-tab

- Grpc.Core.Api
- Grpc.Net.Client
- Grpc.Net.Common
- Microsoft.Extensions.Logging.Abstractions
- System.Buffers
- System.Diagnostics.DiagnosticSource
- System.Memory
- System.Numerics.Vectors
#### Method 2: without additional scope registries

Please download and install [Grpc.Net.Client.Dependencies.unitypackage
from the dependency redistribution on the release page](https://github.com/Cysharp/YetAnotherHttpHandler/releases/tag/redist-20230728-01), or obtain the library from NuGet.
Expand Down
100 changes: 44 additions & 56 deletions YetAnotherHttpHandler.sln
Original file line number Diff line number Diff line change
@@ -1,56 +1,44 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YetAnotherHttpHandler", "src\YetAnotherHttpHandler\YetAnotherHttpHandler.csproj", "{2897D411-9788-4BF2-8D5F-FACD8CC56B39}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YetAnotherHttpHandler.Test", "test\YetAnotherHttpHandler.Test\YetAnotherHttpHandler.Test.csproj", "{22CFEF14-D36A-4E21-B51F-F31053C0E870}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{EDDCC9A6-BB1C-4AB9-A0C1-9AD888858442}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9D970D42-0D6A-4483-886F-3003AB62E04C}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
README.md = README.md
THIRD-PARTY-NOTICES = THIRD-PARTY-NOTICES
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YetAnotherHttpHandler.Unity.Dependencies", "src\YetAnotherHttpHandler.Unity.Dependencies\YetAnotherHttpHandler.Unity.Dependencies.csproj", "{9F9F6B43-8CBF-4025-8B8B-A4465C04740E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YetAnotherHttpHandler.Unity.Dependencies.Sync", "src\YetAnotherHttpHandler.Unity.Dependencies.Sync\YetAnotherHttpHandler.Unity.Dependencies.Sync.csproj", "{7038AD7C-6767-4427-8B89-473BC27E9C9A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2897D411-9788-4BF2-8D5F-FACD8CC56B39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2897D411-9788-4BF2-8D5F-FACD8CC56B39}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2897D411-9788-4BF2-8D5F-FACD8CC56B39}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2897D411-9788-4BF2-8D5F-FACD8CC56B39}.Release|Any CPU.Build.0 = Release|Any CPU
{22CFEF14-D36A-4E21-B51F-F31053C0E870}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{22CFEF14-D36A-4E21-B51F-F31053C0E870}.Debug|Any CPU.Build.0 = Debug|Any CPU
{22CFEF14-D36A-4E21-B51F-F31053C0E870}.Release|Any CPU.ActiveCfg = Release|Any CPU
{22CFEF14-D36A-4E21-B51F-F31053C0E870}.Release|Any CPU.Build.0 = Release|Any CPU
{9F9F6B43-8CBF-4025-8B8B-A4465C04740E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9F9F6B43-8CBF-4025-8B8B-A4465C04740E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9F9F6B43-8CBF-4025-8B8B-A4465C04740E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9F9F6B43-8CBF-4025-8B8B-A4465C04740E}.Release|Any CPU.Build.0 = Release|Any CPU
{7038AD7C-6767-4427-8B89-473BC27E9C9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7038AD7C-6767-4427-8B89-473BC27E9C9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7038AD7C-6767-4427-8B89-473BC27E9C9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7038AD7C-6767-4427-8B89-473BC27E9C9A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{22CFEF14-D36A-4E21-B51F-F31053C0E870} = {EDDCC9A6-BB1C-4AB9-A0C1-9AD888858442}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0F200E0E-4EC0-4C1A-BF65-BA52D3291577}
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YetAnotherHttpHandler", "src\YetAnotherHttpHandler\YetAnotherHttpHandler.csproj", "{2897D411-9788-4BF2-8D5F-FACD8CC56B39}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YetAnotherHttpHandler.Test", "test\YetAnotherHttpHandler.Test\YetAnotherHttpHandler.Test.csproj", "{22CFEF14-D36A-4E21-B51F-F31053C0E870}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{EDDCC9A6-BB1C-4AB9-A0C1-9AD888858442}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9D970D42-0D6A-4483-886F-3003AB62E04C}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
README.md = README.md
THIRD-PARTY-NOTICES = THIRD-PARTY-NOTICES
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2897D411-9788-4BF2-8D5F-FACD8CC56B39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2897D411-9788-4BF2-8D5F-FACD8CC56B39}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2897D411-9788-4BF2-8D5F-FACD8CC56B39}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2897D411-9788-4BF2-8D5F-FACD8CC56B39}.Release|Any CPU.Build.0 = Release|Any CPU
{22CFEF14-D36A-4E21-B51F-F31053C0E870}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{22CFEF14-D36A-4E21-B51F-F31053C0E870}.Debug|Any CPU.Build.0 = Debug|Any CPU
{22CFEF14-D36A-4E21-B51F-F31053C0E870}.Release|Any CPU.ActiveCfg = Release|Any CPU
{22CFEF14-D36A-4E21-B51F-F31053C0E870}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{22CFEF14-D36A-4E21-B51F-F31053C0E870} = {EDDCC9A6-BB1C-4AB9-A0C1-9AD888858442}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0F200E0E-4EC0-4C1A-BF65-BA52D3291577}
EndGlobalSection
EndGlobal
3 changes: 3 additions & 0 deletions src/YetAnotherHttpHandler.Dependencies/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# YetAnotherHttpHandler.Dependencies

A project for managing NuGet references for Unity.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions src/YetAnotherHttpHandler.Dependencies/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "com.cysharp.yetanotherhttphandler.dependencies",
"version": "0.1.0",
"author": { "name": "Cysharp, Inc.", "url": "https://cysharp.co.jp/en/" },
"displayName": "YetAnotherHttpHandler (Dependencies)",
"description": "YetAnotherHttpHandler NuGet dependencies.",
"unity": "2021.3",
"license": "MIT",
"dependencies": {
"org.nuget.system.io.pipelines": "7.0.0",
"org.nuget.system.runtime.compilerservices.unsafe": "4.5.3"
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

136 changes: 0 additions & 136 deletions src/YetAnotherHttpHandler.Unity.Dependencies.Sync/Program.cs

This file was deleted.

Loading