-
Notifications
You must be signed in to change notification settings - Fork 5
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
Expander ライブラリを作成 #50
Conversation
かなり本家と毛色が違う 個人的には、便利ではあるが少し自由が効かない方法だという印象を持ちました。毎デバッグの際にこれが実行されるのはあまり嬉しくはなさそうです。 コードベースとして依存フロー解析のコードはとても助かります。GitHub Actionでフロー解析を前処理しておくのは合理的ですし、 |
そう思いまして、
// do nothing if file is not updated.
Expander.Expand(checkLastWriteTime: true); とすると |
#21 に検討した内容を書き連ねました。 |
ファイルの中から直接呼び出すのではなくPowerShellから呼び出すサンプルを追加しました。 |
|
Expander はCC0にしたくないので一旦閉じます。 |
Expander の実装方法をいろいろ検討して、C# のみで完結してなおかつオーバーヘッドが小さい手法を思いついたので作成してみました。
の2つの機能にわかれているのでそれぞれ説明します。
GitHub Actions によるソースコード埋め込み
SourceCodeEmbeder を GitHub Actions で実行して、AtCoderLibrary にソースコード埋め込みファイルを自動コミットします。
ソースコード埋め込み用の型には
EditorBrowsable(EditorBrowsableState.Never)
をつけているので通常のライブラリ利用者からは見れません。SourceCodeEmbeder が行うこと
using
ディレクティブとその他のコードの分離Trivia
(Roslyn の用語) をすべて単一のスペースに置換することでコードを圧縮GitHub Actions の実行例
https://github.com/naminodarie/ac-library-cs/actions/runs/255529330
埋め込んだソースコードを利用するライブラリ
Expander が埋め込んだソースコードを展開するライブラリです。
README を書いてます。
https://github.com/naminodarie/ac-library-cs/blob/expander_cs/AtCoderLibrary.Expander/README.md
上記のようなファイルでためしたところ実行時間はそれぞれ
程度となりました。
#21