-
Notifications
You must be signed in to change notification settings - Fork 3
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
Indirect build scheme overrides #16
base: main
Are you sure you want to change the base?
Conversation
|
||
foreach (var scheme in treeFromLeafToRoot) | ||
{ | ||
if (typeof(TContext).IsAssignableFrom(typeof(IPreBuildContext))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typeofも多少のコストがあったはずだから、ループの外でキャッシュしておいてもいいかも
そもそもループの外で targetConfigurations を PreBuildConfigurations / InternalPrepareConfigurations / PostBuildConfigurationsから選出してしまえばループ内もシンプルになりそうな
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
見た目長くなってしまう感はあるので、ちょっと迷ってます
public static IEnumerable<IBuildConfiguration> EnumerateComposedConfigurations<TContext>(
IEnumerable<IBuildScheme> treeFromLeafToRoot) where TContext : IBuildContext
{
HashSet<Type> taskTypes = new();
var configurationsByScheme = treeFromLeafToRoot.Select(s =>
{
var t = typeof(TContext);
if (t.IsAssignableFrom(typeof(IPreBuildContext)))
{
return s.PreBuildConfigurations;
}
if (t.IsAssignableFrom(typeof(IInternalPrepareContext)))
{
return s.InternalPrepareConfigurations;
}
if (t.IsAssignableFrom(typeof(IPostBuildContext)))
{
return s.PostBuildConfigurations;
}
return Enumerable.Empty<IBuildConfiguration>();
});
foreach (var configurations in configurationsByScheme)
{
foreach (var configuration in configurations)
if (taskTypes.Add(configuration.TaskType))
yield return configuration;
}
}
@@ -42,7 +42,10 @@ public void Dispose() | |||
|
|||
public void Bind(SerializedObject so) | |||
{ | |||
_rootVisualElement.Unbind(); | |||
_rightPaneView.OnBind(so); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rightのOnBindが実際のBindより前にあるけどいいのかな
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bindされた状態のままbindingPathなどをいじるとたまにバグるので、Unbind入れた上で順番を変えてます…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
あとOnBindだと自身がBindされたときなのか親階層がBindされたときなのか分かりづらいなともレビューしてて思ったり
Closes #4
Pipeline
UI