Skip to content

Commit bfc12dc

Browse files
authored
Merge pull request googlesamples#383 from Si1ver/better-xml-docs
Improved inline xml documentation
2 parents a2380fe + 0a0d5e7 commit bfc12dc

27 files changed

+99
-83
lines changed

source/AndroidResolver/src/AndroidAbis.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public AndroidAbis(IEnumerable<string> abisSet) {
143143
/// <summary>
144144
/// Create a set of ABIs from a comma separated set of ABI strings.
145145
/// </summary>
146-
/// <param name="abisSet">Set of ABI strings.</param>
146+
/// <param name="abiString">Comma separated set of ABI strings.</param>
147147
public AndroidAbis(string abiString) {
148148
if (String.IsNullOrEmpty(abiString)) {
149149
abis = new HashSet<string>(Supported);
@@ -190,7 +190,7 @@ public override bool Equals(System.Object obj) {
190190
/// Get the supported set of Android ABIs for the current Unity version.
191191
/// The dictionary maps the official Android ABI name (i.e the directory name looked up by the
192192
/// operating system) to the UnityEditor.AndroidTargetDevice (Unity 5.x & 2017.x) or
193-
// UnityEditor.AndroidArchitecture enumeration value name.
193+
/// UnityEditor.AndroidArchitecture enumeration value name.
194194
/// </summary>
195195
private static Dictionary<string, string> SupportedAbiToAbiEnumValue {
196196
get { return PropertyConfiguration.Instance.SupportedAbiToAbiEnumValue; }
@@ -221,10 +221,10 @@ public static IEnumerable<string> AllSupported {
221221
/// </summary>
222222
/// <param name="enumValueObject">Enum object to convert.</param>
223223
private static ulong EnumValueObjectToULong(object enumValueObject) {
224-
/// Flags enum values can't be cast directly to an integral type, however it is possible to
225-
/// print the value as an integer string so convert to a string and then parse as an int.
226-
/// Enums are considered unsigned by the formatter, so if an enum is defined as -1 it will
227-
/// be formatted as UInt32.MaxValue, i.e. 4294967295.
224+
// Flags enum values can't be cast directly to an integral type, however it is possible to
225+
// print the value as an integer string so convert to a string and then parse as an int.
226+
// Enums are considered unsigned by the formatter, so if an enum is defined as -1 it will
227+
// be formatted as UInt32.MaxValue, i.e. 4294967295.
228228
return UInt64.Parse(String.Format("{0:D}", enumValueObject));
229229
}
230230

@@ -240,7 +240,7 @@ private static ulong EnumValueStringToULong(Type enumType, string enumValueStrin
240240
/// <summary>
241241
/// Get / set the target device ABI (Unity >= 5.0.x)
242242
/// Unity >= 2017.4 supports armeabi-v7a, arm64-v8a, x86 & fat (i.e armeabi-v7a, arm64, x86)
243-
/// Unity >= 5.0.x & <= 2017.3 only support armeabi-v7a, x86 & fat (i.e armeabi-v7a & x86)
243+
/// Unity >= 5.0.x & &lt;= 2017.3 only support armeabi-v7a, x86 & fat (i.e armeabi-v7a & x86)
244244
/// </summary>
245245
public static AndroidAbis Current {
246246
set {

source/AndroidResolver/src/AndroidSdkManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ internal class AndroidSdkManager {
975975
/// </summary>
976976
/// <param name="toolName">Name of the tool to search for.</param>
977977
/// <param name="sdkPath">SDK path to search for the tool. If this is null or empty, the
978-
// system path is searched instead.</param>
978+
/// system path is searched instead.</param>
979979
/// <returns>String with the path to the tool if found, null otherwise.</returns>
980980
private static string FindAndroidSdkTool(string toolName, string sdkPath = null) {
981981
if (String.IsNullOrEmpty(sdkPath)) {

source/AndroidResolver/src/CommandLine.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ public LineReader(IOHandler handler = null)
375375
/// a newline isn't present.
376376
/// </summary>
377377
/// <param name="handle">Handle of the stream to query.</param>
378-
/// <returns>List of data for the requested stream.</return>
378+
/// <returns>List of data for the requested stream.</returns>
379379
public List<StreamData> GetBufferedData(int handle)
380380
{
381381
List<StreamData> handleData;
@@ -397,7 +397,6 @@ public void Flush()
397397
/// <summary>
398398
/// Aggregate the specified list of StringBytes into a single structure.
399399
/// </summary>
400-
/// <param name="handle">Stream handle.</param>
401400
/// <param name="dataStream">Data to aggregate.</param>
402401
public static StreamData Aggregate(List<StreamData> dataStream)
403402
{

source/AndroidResolver/src/EmbeddedResource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public bool Extract(Logger logger) {
132132
/// directories if they're required.
133133
/// </summary>
134134
/// <param name="assembly">Assembly to extract resources from.</param>
135-
/// <param name="resourceNameToTargetPath">Each Key is the resource to extract and each
135+
/// <param name="resourceNameToTargetPaths">Each Key is the resource to extract and each
136136
/// Value is the path to extract to. If the resource name (Key) is null or empty, this
137137
/// method will attempt to extract a resource matching the filename component of the path.
138138
/// </param>

source/AndroidResolver/src/GradleResolver.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ internal static Dictionary<string, string> DependenciesToPackageSpecs(
139139
/// * Path relative to project folder, ex."Assets/Firebase/m2repository"
140140
/// </summary>
141141
/// <param name="repoPath">Repo path to convert.</param>
142-
/// <param name="sourceLocation>XML or source file this path is referenced from. If this is
142+
/// <param name="sourceLocation">XML or source file this path is referenced from. If this is
143143
/// null the calling method's source location is used when logging the source of this
144144
/// repo declaration.</param>
145145
/// <returns>URI to the repo.</returns>
@@ -1025,16 +1025,20 @@ private string DetermineExplodedAarPath(string aarPath) {
10251025
/// <summary>
10261026
/// Processes the aars.
10271027
/// </summary>
1028-
/// <remarks>Each aar copied is inspected and determined if it should be
1028+
/// <remarks>
1029+
/// <para>
1030+
/// Each aar copied is inspected and determined if it should be
10291031
/// exploded into a directory or not. Unneeded exploded directories are
10301032
/// removed.
1033+
/// </para>
10311034
/// <para>
10321035
/// Exploding is needed if the version of Unity is old, or if the artifact
10331036
/// has been explicitly flagged for exploding. This allows the subsequent
10341037
/// processing of variables in the AndroidManifest.xml file which is not
10351038
/// supported by the current versions of the manifest merging process that
10361039
/// Unity uses.
10371040
/// </para>
1041+
/// </remarks>
10381042
/// <param name="dir">The directory to process.</param>
10391043
/// <param name="updatedFiles">Set of files that were recently updated and should be
10401044
/// processed.</param>

source/AndroidResolver/src/GradleWrapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public bool Extract(Logger logger) {
133133
/// <param name="buildScript">Path to the Gradle build script to use.</param>
134134
/// <param name="projectProperties">Project properties to use when running the script.
135135
/// </param>
136-
/// <param name="arguments>Other arguments to pass to Gradle.</param>
136+
/// <param name="arguments">Other arguments to pass to Gradle.</param>
137137
/// <param name="logger">Logger to report errors to.</param>
138138
/// <param name="executeCommand">Closure which takes the tool path to execute
139139
/// (gradle wrapper) and a string of arguments returning true if successful,

source/AndroidResolver/src/JavaUtilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private static string JavaHomeBinaryPath(string javaTool) {
132132
/// <summary>
133133
/// Find a Java tool.
134134
/// </summary>
135-
/// <param name="toolName">Name of the tool to search for.</param>
135+
/// <param name="javaTool">Name of the tool to search for.</param>
136136
/// <returns>Path to the tool if it's found, throws a ToolNotFoundException
137137
/// otherwise.</returns>
138138
private static string FindJavaTool(string javaTool)

source/AndroidResolver/src/LocalMavenRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static List<string> FindAarsInLocalRepos(ICollection<Dependency> dependen
8282
/// <summary>
8383
/// Get a path without a filename extension.
8484
/// </summary>
85-
/// <param name="filename">Path to a file.</param>
85+
/// <param name="path">Path to a file.</param>
8686
/// <returns>Path (including directory) without a filename extension.</returns>
8787
internal static string PathWithoutExtension(string path) {
8888
return Path.Combine(Path.GetDirectoryName(path),

source/AndroidResolver/src/PlayServicesResolver.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ private static string SetToString(HashSet<string> setToConvert) {
261261
/// <summary>
262262
/// Convert a dictionary to a sorted comma separated string.
263263
/// </summary>
264-
/// <returns>Comma separated string in the form key=value.<returns>
264+
/// <returns>Comma separated string in the form key=value.</returns>
265265
private static string DictionaryToString(Dictionary<string, string> dict) {
266266
var components = new List<string>();
267267
foreach (var key in SortSet(dict.Keys)) {
@@ -319,7 +319,7 @@ internal class PropertyPoller<T> {
319319
/// <param name="delayTimeInSeconds">Time to wait before signalling that the value
320320
/// has changed.</param>
321321
/// <param name="checkIntervalInSeconds">Time to check the value of the property for
322-
/// changes.<param>
322+
/// changes.</param>
323323
public PropertyPoller(string propertyName,
324324
int delayTimeInSeconds = 3,
325325
int checkIntervalInSeconds = 1) {
@@ -628,7 +628,7 @@ public static bool GradleProjectExportEnabled {
628628
/// </summary>
629629
private struct AndroidBuildSystemSettings {
630630
/// <summary>
631-
// Whether the Gradle build is enabled.
631+
/// Whether the Gradle build is enabled.
632632
/// </summary>
633633
public bool GradleBuildEnabled { get; private set; }
634634

@@ -638,7 +638,7 @@ private struct AndroidBuildSystemSettings {
638638
public bool GradleTemplateEnabled { get; private set; }
639639

640640
/// <summary>
641-
// Whether project export is enabled.
641+
/// Whether project export is enabled.
642642
/// </summary>
643643
public bool ProjectExportEnabled { get; private set; }
644644

@@ -656,7 +656,7 @@ public static AndroidBuildSystemSettings Current {
656656
}
657657

658658
/// <summary>
659-
// Compare with another AndroidBuildSystemSettings.
659+
/// Compare with another AndroidBuildSystemSettings.
660660
/// </summary>
661661
/// <param name="obj">Object to compare with.</param>
662662
/// <returns>true if the object is the same as this, false otherwise.</returns>
@@ -1217,7 +1217,7 @@ private static void Reresolve() {
12171217
/// * foo.com.my.app.service --> foo.com.my.app.service (unchanged)
12181218
/// </param>
12191219
/// <param name="path">Path of this node in the hierarchy of nodes. For example:
1220-
/// given node is "<c>" in "<a><b><c>" this should be "a/b/c". If this
1220+
/// given node is "&lt;c>" in "&lt;a>&lt;b>&lt;c>" this should be "a/b/c". If this
12211221
/// value is null the name of the current node is used.</param>
12221222
/// <returns>true if any replacements are applied, false otherwise.</returns>
12231223
private static bool ReplaceVariablesInXmlElementTree(

source/AndroidResolver/src/UnityCompat.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ public static int FindNewestInstalledAndroidSDKVersion() {
399399
/// </summary>
400400
/// Unfortunately the Unity API does not provide a way to get the current BuildTargetGroup from
401401
/// the currently active BuildTarget.
402-
/// <param name="target">BuildTarget to convert.</param>
402+
/// <param name="buildTarget">BuildTarget to convert.</param>
403403
/// <returns>BuildTargetGroup enum value.</returns>
404404
private static BuildTargetGroup ConvertBuildTargetToBuildTargetGroup(BuildTarget buildTarget) {
405405
var buildTargetToGroup = new Dictionary<string, string>() {

source/AndroidResolver/test/src/AndroidResolverIntegrationTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@ private static void ResolveWithGradleTemplate(
684684
/// This filters all Unity .meta files from the resultant list.
685685
/// </summary>
686686
/// <param name="searchDir">Directory to search.</param>
687+
/// <param name="filesToIgnore">Set of files to relative to the generatedAssetsDir.</param>
687688
/// <param name="relativeDir">Root path for relative filenames. This should be any directory
688689
/// under the specified searchDir argument. If this is null, searchDir is used.</param>
689690
/// <returns>Dictionary of file paths mapped to relative file paths.</returns>

source/IOSResolver/src/IOSResolver.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private class Pod {
7272
/// Since order is important sources specified in this list
7373
/// are interleaved across each Pod added to the resolver.
7474
/// e.g Pod1.source[0], Pod2.source[0] ...
75-
//// Pod1.source[1], Pod2.source[1] etc.
75+
/// Pod1.source[1], Pod2.source[1] etc.
7676
///
7777
/// See: https://guides.cocoapods.org/syntax/podfile.html#source
7878
/// </summary>
@@ -186,9 +186,9 @@ public Pod(string name, string version, bool bitcodeEnabled, string minTargetSdk
186186

187187
/// <summary>
188188
/// Convert min target SDK to an integer in the form
189-
// (major * 10) + minor.
189+
/// (major * 10) + minor.
190190
/// </summary>
191-
/// <return>Numeric minimum SDK revision required by this pod.</return>
191+
/// <returns>Numeric minimum SDK revision required by this pod.</returns>
192192
public int MinTargetSdkToVersion() {
193193
string sdkString =
194194
String.IsNullOrEmpty(minTargetSdk) ? "0.0" : minTargetSdk;
@@ -1349,7 +1349,7 @@ static int TargetSdkVersion {
13491349

13501350
/// <summary>
13511351
/// Convert a target SDK string into a value of the form
1352-
// (major * 10) + minor.
1352+
/// (major * 10) + minor.
13531353
/// </summary>
13541354
/// <returns>Integer representation of the SDK.</returns>
13551355
internal static int TargetSdkStringToVersion(string targetSdk) {
@@ -1385,7 +1385,7 @@ internal static string TargetSdkVersionToString(int version) {
13851385
/// <summary>
13861386
/// Determine whether any pods need bitcode disabled.
13871387
/// </summary>
1388-
/// <returns>List of pod names with bitcode disabled.</return>
1388+
/// <returns>List of pod names with bitcode disabled.</returns>
13891389
private static List<string> FindPodsWithBitcodeDisabled() {
13901390
var disabled = new List<string>();
13911391
foreach (var pod in pods.Values) {
@@ -1858,7 +1858,7 @@ private static void ParseUnityDeps(string unityPodfilePath) {
18581858
/// this returns the string...
18591859
///
18601860
/// source 'http://myrepo.com/Specs.git'
1861-
/// source 'http://anotherrepo.com/Specs.git'
1861+
/// source 'http://anotherrepo.com/Specs.git'</returns>
18621862
private static string GeneratePodfileSourcesSection() {
18631863
var interleavedSourcesLines = new List<string>();
18641864
var processedSources = new HashSet<string>();
@@ -2083,7 +2083,7 @@ private class DelegateContainer<T> {
20832083
/// Delegate method associated with the container. This enables the
20842084
/// following pattern:
20852085
///
2086-
/// var container = new DelegateContainer<CommandLine.CompletionHandler>();
2086+
/// var container = new DelegateContainer&lt;CommandLine.CompletionHandler>();
20872087
/// container.Handler = (CommandLine.Result result) => { RunNext(container.Handler); };
20882088
/// </summary>
20892089
public T Handler { get; set; }

source/IntegrationTester/src/Runner.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ public static void ScheduleTestCases(IEnumerable<TestCase> tests) {
116116
/// <summary>
117117
/// Add a single test case to the list to be executed.
118118
/// </summary>
119-
/// <remarks>
120119
/// <param name="test">Test case to add to the list to execute.</param>
121120
public static void ScheduleTestCase(TestCase test) {
122121
testCases.Add(test);
@@ -139,7 +138,6 @@ public static void VersionHandlerReady() {
139138
/// <remarks>
140139
/// Finds and calls all initialization methods with the InitializerAttribute.
141140
/// </remarks>
142-
/// <param name="unityVersion">Major & minor version of Unity.</param>
143141
private static void ConfigureTestCases() {
144142
unityVersion = Google.VersionHandler.GetUnityVersionMajorMinor();
145143

@@ -332,8 +330,8 @@ private static List<TestCaseResult> ReadTestCaseResults() {
332330
}
333331

334332
/// <summary>
335-
// Log a test case result to the journal so that it isn't executed again if the app
336-
// domain is reloaded.
333+
/// Log a test case result to the journal so that it isn't executed again if the app
334+
/// domain is reloaded.
337335
/// </summary>
338336
private static bool WriteTestCaseResult(TestCaseResult testCaseResult) {
339337
var existingTestCaseResults = ReadTestCaseResults();

source/PackageManagerResolver/src/PackageManagerClient.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ public Wrapper(object instance) {
5656
/// Convert a collection of objects to a field separated string.
5757
/// </summary>
5858
/// <param name="objects">Collection of objects to convert to a list of strings.</param>
59-
/// <returns>Comma separated string.</returns>.
59+
/// <param name="separator">The string to use as a separator.</param>
60+
/// <returns>A string that consists of members of <paramref name="objects"/> delimited
61+
/// by <paramref name="separator"/> string.</returns>.
6062
protected static string ObjectCollectionToString<T>(IEnumerable<T> objects,
6163
string separator) {
6264
var components = new List<string>();
@@ -968,7 +970,7 @@ private class EnumeratorProgressReporter {
968970
/// Construct the instance.
969971
/// </summary>
970972
/// <param name="items">Items to iterate through.</param>
971-
/// <param name="progress">Reports progress as iteration proceeds.</param>
973+
/// <param name="progressReporter">Reports progress as iteration proceeds.</param>
972974
public EnumeratorProgressReporter(ICollection<string> items,
973975
Action<float, string> progressReporter) {
974976
itemCount = items.Count;
@@ -1081,6 +1083,7 @@ private class PackageInstaller : EnumeratorProgressReporter {
10811083
/// Install a set of packages using the package manager.
10821084
/// </summary>
10831085
/// <param name="packageIdsOrNames">Package IDs or names to search for.</param>
1086+
/// <param name="complete">Called when the operation is complete.</param>
10841087
/// <param name="progress">Reports progress through the search.</param>
10851088
public PackageInstaller(ICollection<string> packageIdsOrNames,
10861089
Action<Dictionary<string, InstallResult>> complete,
@@ -1163,6 +1166,7 @@ private class PackageSearcher : EnumeratorProgressReporter {
11631166
/// Search for a set of packages in the package manager.
11641167
/// </summary>
11651168
/// <param name="packageIdsOrNames">Package IDs or names to search for.</param>
1169+
/// <param name="complete">Called when the operation is complete.</param>
11661170
/// <param name="progress">Reports progress through the search.</param>
11671171
public PackageSearcher(ICollection<string> packageIdsOrNames,
11681172
Action<Dictionary<string, SearchResult>> complete,
@@ -1245,6 +1249,7 @@ public static void AddPackage(string packageIdOrName, Action<InstallResult> comp
12451249
/// Add packages to the project.
12461250
/// </summary>
12471251
/// <param name="packageIdsOrNames">IDs or names of the packages to add.</param>
1252+
/// <param name="complete">Called when the operation is complete.</param>
12481253
/// <param name="progress">Reports progress through the installation.</param>
12491254
public static void AddPackages(ICollection<string> packageIdsOrNames,
12501255
Action<Dictionary<string, InstallResult>> complete,

source/PackageManagerResolver/src/PackageManagerRegistry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public PackageManagerRegistry() {
8080
/// <summary>
8181
/// Convert to a human readable string excluding the TermsOfService and CreatedBy fields.
8282
/// </summary>
83-
/// <returns>String representation of this instance.</return>
83+
/// <returns>String representation of this instance.</returns>
8484
public override string ToString() {
8585
return String.Format("name: {0}, url: {1}, scopes: {2}",
8686
Name, Url,

0 commit comments

Comments
 (0)