コンテンツにスキップ

ファイルベース実行例2. File-based Apps で、NuGet パッケージの外部ライブラリを使用する

Page ID: 1114988189001

最終更新日:

ファイルベース実行例2.
File-based Apps で、NuGet パッケージの外部ライブラリを使用する

Section titled “ファイルベース実行例2. File-based Apps で、NuGet パッケージの外部ライブラリを使用する”

File-based Apps で、たとえば NuGet パッケージの外部ライブラリを追加して参照するには、#:package ディレクティブを使用します。

今回ここでは、Cygames グループ会社の Cysharp 製「Kokuban」ライブラリを使用してみます。

Hogera.cs
#!/usr/bin/env dotnet
#:package Kokuban@0.2.0
using Kokuban;
Console.WriteLine(Chalk.Bold.Red.BgYellow["Hello, World!"]);
使用ライブラリの、ライセンス表記
Kokuban
MIT License
Copyright (c) Cysharp, Inc.
Copyright (c) Mayuki Sawatari mayuki@misuzilla.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Part of the source code of this library is derived from the following libraries.
The original source codes are licensed under the MIT License.
chalk/supports-color
Copyright (c) Sindre Sorhus sindresorhus@gmail.com (https://sindresorhus.com)
chalk/ansi-styles
Copyright (c) Sindre Sorhus sindresorhus@gmail.com (https://sindresorhus.com)
Qix-/color-convert
Copyright c 2011-2016, Heather Arthur. Copyright c 2016-2021, Josh Junon.