Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit f054bbf

Browse files
authored
UTY-1060: Prepend warning to copied schema files (#612)
1 parent 4d6c5b6 commit f054bbf

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- Added support for the Steam authentication flow.
88
- Added a reference to Blank Starter Project in the README.
99
- Added Frames Per Second (FPS) and Unity heap usage as metrics sent by `MetricSendSystem.cs`.
10+
- Added a warning message to the top of schema files copied into the `from_gdk_packages` directory.
1011

1112
### Changed
1213

workers/unity/Packages/com.improbable.gdk.tools/GenerateCode.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ internal static class GenerateCode
1414
private const string FromGdkPackagesDir = "from_gdk_packages";
1515
private const string ImprobableJsonDir = "build/ImprobableJson";
1616

17-
17+
private static string SchemaWarningMessage =
18+
"// ------------------------------------------------------------------------" + Environment.NewLine +
19+
"// WARNING: DO NOT EDIT." + Environment.NewLine +
20+
"// Any changes made to this file will be overwritten by the Code Generator." + Environment.NewLine +
21+
"// ------------------------------------------------------------------------" + Environment.NewLine +
22+
Environment.NewLine;
1823

1924
private static readonly string SchemaCompilerRelativePath =
2025
$"../build/CoreSdk/{Common.CoreSdkVersion}/schema_compiler/schema_compiler";
@@ -206,7 +211,7 @@ private static void CopySchemaFiles(string schemaRoot, KeyValuePair<string, stri
206211
}
207212
}
208213

209-
File.Copy(file, to);
214+
File.WriteAllText(to, SchemaWarningMessage + File.ReadAllText(file));
210215
}
211216
}
212217

0 commit comments

Comments
 (0)