Skip to content

Commit 1ff8cf4

Browse files
author
Stewart Miles
committed
Changed Version Handler to only manage assets with the "gvh" label.
This reduces the likelihood that assets will be mutated by the VersionHandler based upon labels like "_manifest" being used in asset filenames. BUG=31144863 Change-Id: If4546dea5cd5d14c11c289cc1a154d902a8443ff
1 parent 4000b30 commit 1ff8cf4

9 files changed

+25
-5
lines changed

exploded/Assets/PlayServicesResolver/Editor/Google.IOSResolver_v1.2.0.0_tEditor.dll.meta

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exploded/Assets/PlayServicesResolver/Editor/Google.JarResolver_v1.2.0.0_tEditor.dll.meta

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exploded/Assets/PlayServicesResolver/Editor/Google.VersionHandler_v1.2.0.0_tEditor.dll.meta

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-46 Bytes
Binary file not shown.

plugin/Assets/PlayServicesResolver/Editor/Google.IOSResolver.dll.meta

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin/Assets/PlayServicesResolver/Editor/Google.JarResolver.dll.meta

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin/Assets/PlayServicesResolver/Editor/Google.VersionHandler.dll.meta

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/VersionHandler/src/VersionHandler.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ public FilenameComponents(string filename) {
8080
// Prefix for labels which encode metadata of an asset.
8181
private static string LABEL_PREFIX = "gvh_";
8282

83+
/// <summary>
84+
/// Label which flags whether an asset is should be managed by this
85+
/// module.
86+
/// </summary>
87+
public static string ASSET_LABEL = "gvh";
88+
8389
// Map of build target names to BuildTarget enumeration values.
8490
static public Dictionary<string, BuildTarget>
8591
BUILD_TARGET_NAME_TO_ENUM = new Dictionary<string, BuildTarget> {
@@ -261,10 +267,14 @@ public void UpdateAssetLabels() {
261267
List<string> labels = new List<String>();
262268
// Strip labels we're currently managing.
263269
foreach (string label in AssetDatabase.GetLabels(importer)) {
264-
if (!label.StartsWith(LABEL_PREFIX)) {
270+
if (!(label.ToLower().StartsWith(LABEL_PREFIX) ||
271+
label.ToLower().Equals(ASSET_LABEL))) {
265272
labels.Add(label);
266273
}
267274
}
275+
// Add / preserve the label that indicates this asset is managed by
276+
// this module.
277+
labels.Add(ASSET_LABEL);
268278
// Add labels for the metadata in this class.
269279
if (!String.IsNullOrEmpty(versionString)) {
270280
labels.Add(LABEL_PREFIX + TOKEN_VERSION + versionString);
@@ -998,10 +1008,8 @@ public static string[] SearchAssetDatabase(string assetsFilter = null,
9981008
/// Get all assets managed by this module.
9991009
/// </summary>
10001010
public static string[] FindAllAssets() {
1001-
return SearchAssetDatabase(filter: (filename) => {
1002-
string extension = Path.GetExtension(filename).ToLower();
1003-
return extension.Equals(".dll") || extension.Equals(".txt");
1004-
});
1011+
return SearchAssetDatabase(
1012+
assetsFilter: "l:" + FileMetadata.ASSET_LABEL);
10051013
}
10061014

10071015
/// <summary>

0 commit comments

Comments
 (0)