Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit a873192

Browse files
committed
Skip obsolete targets
1 parent dbec1bc commit a873192

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

PostProcessing/Editor/Tools/DefineSetter.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ static DefineSetter()
1212
{
1313
var targets = Enum.GetValues(typeof(BuildTargetGroup))
1414
.Cast<BuildTargetGroup>()
15-
.Where(x => x != BuildTargetGroup.Unknown);
15+
.Where(x => x != BuildTargetGroup.Unknown)
16+
.Where(x => !IsObsolete(x));
1617

1718
foreach (var target in targets)
1819
{
@@ -31,5 +32,14 @@ static DefineSetter()
3132
PlayerSettings.SetScriptingDefineSymbolsForGroup(target, defines);
3233
}
3334
}
35+
36+
static bool IsObsolete(BuildTargetGroup group)
37+
{
38+
var attrs = typeof(BuildTargetGroup)
39+
.GetField(group.ToString())
40+
.GetCustomAttributes(typeof(ObsoleteAttribute), false);
41+
42+
return attrs != null && attrs.Length > 0;
43+
}
3444
}
3545
}

0 commit comments

Comments
 (0)