* Add WASM000x warning code to all warning produced in WasmAppBuilder.
* Feedback from @radical.
* Fix analyzer.
}
}
- private bool ShouldCompile(string srcFile, string objFile, string[] depFiles, out string reason)
+ private static bool ShouldCompile(string srcFile, string objFile, string[] depFiles, out string reason)
{
if (!File.Exists(srcFile))
throw new LogAsErrorException($"Could not find source file {srcFile}");
{
if (!File.Exists(inFile))
{
- reason = $"Could not find dependency file {inFile} needed for compiling {srcFile} to {outFile}";
- Log.LogWarning(reason);
+ reason = $"the dependency file {inFile} needed for compiling {srcFile} to {outFile} could not be found.";
return true;
}
}
catch (NotImplementedException nie)
{
- Log.LogWarning($"Failed to generate icall function for method '[{method.DeclaringType!.Assembly.GetName().Name}] {className}::{method.Name}'" +
+ Log.LogWarning(null, "WASM0001", "", "", 0, 0, 0, 0, $"Failed to generate icall function for method '[{method.DeclaringType!.Assembly.GetName().Name}] {className}::{method.Name}'" +
$" because type '{nie.Message}' is not supported for parameter named '{par.Name}'. Ignoring.");
return null;
}
string imports = string.Join(Environment.NewLine,
candidates.Select(
p => $" {p.Method} (in [{p.Method.DeclaringType?.Assembly.GetName().Name}] {p.Method.DeclaringType})"));
- Log.LogWarning($"Found a native function ({first.EntryPoint}) with varargs in {first.Module}." +
+ Log.LogWarning(null, "WASM0001", "", "", 0, 0, 0, 0, $"Found a native function ({first.EntryPoint}) with varargs in {first.Module}." +
" Calling such functions is not supported, and will fail at runtime." +
$" Managed DllImports: {Environment.NewLine}{imports}");
string fullPath = assembly.GetMetadata("Identity");
if (string.IsNullOrEmpty(culture))
{
- Log.LogWarning($"Missing CultureName metadata for satellite assembly {fullPath}");
+ Log.LogWarning(null, "WASM0002", "", "", 0, 0, 0, 0, $"Missing CultureName metadata for satellite assembly {fullPath}");
continue;
}
// FIXME: validate the culture?
if (firstPath == secondPath)
{
- Log.LogWarning($"Found identical vfs mappings for target path: {targetPath}, source file: {firstPath}. Ignoring.");
+ Log.LogWarning(null, "WASM0003", "", "", 0, 0, 0, 0, $"Found identical vfs mappings for target path: {targetPath}, source file: {firstPath}. Ignoring.");
continue;
}
{
if (SkipMissingAssemblies)
{
- Log.LogWarning($"Loading assembly reference '{aname}' for '{assembly.GetName()}' failed: {ex.Message} Skipping.");
+ Log.LogWarning(null, "WASM0004", "", "", 0, 0, 0, 0, $"Loading assembly reference '{aname}' for '{assembly.GetName()}' failed: {ex.Message} Skipping.");
}
else
{