diff options
| author | Rob Mensching <rob@firegiant.com> | 2018-07-23 14:21:40 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2018-07-23 14:27:11 -0700 |
| commit | 5a1afc9030a1fcc101b6bb52b576fbbfa3ad33c2 (patch) | |
| tree | d409a2399bd831f16ecdb8e68947ea672dcd65d4 /src/WixToolset.Core/ExtensibilityServices | |
| parent | 2724cfee4c163f3297ee25edfd2372767cfd4945 (diff) | |
| download | wix-5a1afc9030a1fcc101b6bb52b576fbbfa3ad33c2.tar.gz wix-5a1afc9030a1fcc101b6bb52b576fbbfa3ad33c2.tar.bz2 wix-5a1afc9030a1fcc101b6bb52b576fbbfa3ad33c2.zip | |
Integrate Extensibility.Data namespace change from Extensibility repo
Diffstat (limited to 'src/WixToolset.Core/ExtensibilityServices')
| -rw-r--r-- | src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs | 3 | ||||
| -rw-r--r-- | src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs | 25 |
2 files changed, 17 insertions, 11 deletions
diff --git a/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs b/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs index b65abdfb..f62f8f10 100644 --- a/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs +++ b/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs | |||
| @@ -12,10 +12,11 @@ namespace WixToolset.Core.ExtensibilityServices | |||
| 12 | using System.Text.RegularExpressions; | 12 | using System.Text.RegularExpressions; |
| 13 | using System.Xml.Linq; | 13 | using System.Xml.Linq; |
| 14 | using WixToolset.Data; | 14 | using WixToolset.Data; |
| 15 | using Wix = WixToolset.Data.Serialize; | ||
| 16 | using WixToolset.Data.Tuples; | 15 | using WixToolset.Data.Tuples; |
| 17 | using WixToolset.Extensibility; | 16 | using WixToolset.Extensibility; |
| 17 | using WixToolset.Extensibility.Data; | ||
| 18 | using WixToolset.Extensibility.Services; | 18 | using WixToolset.Extensibility.Services; |
| 19 | using Wix = WixToolset.Data.Serialize; | ||
| 19 | 20 | ||
| 20 | internal class ParseHelper : IParseHelper | 21 | internal class ParseHelper : IParseHelper |
| 21 | { | 22 | { |
diff --git a/src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs b/src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs index 0331c815..0e4bba51 100644 --- a/src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs +++ b/src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs | |||
| @@ -9,6 +9,7 @@ namespace WixToolset.Core.ExtensibilityServices | |||
| 9 | using System.Xml.Linq; | 9 | using System.Xml.Linq; |
| 10 | using WixToolset.Data; | 10 | using WixToolset.Data; |
| 11 | using WixToolset.Extensibility; | 11 | using WixToolset.Extensibility; |
| 12 | using WixToolset.Extensibility.Data; | ||
| 12 | using WixToolset.Extensibility.Services; | 13 | using WixToolset.Extensibility.Services; |
| 13 | 14 | ||
| 14 | internal class PreprocessHelper : IPreprocessHelper | 15 | internal class PreprocessHelper : IPreprocessHelper |
| @@ -19,10 +20,14 @@ namespace WixToolset.Core.ExtensibilityServices | |||
| 19 | public PreprocessHelper(IServiceProvider serviceProvider) | 20 | public PreprocessHelper(IServiceProvider serviceProvider) |
| 20 | { | 21 | { |
| 21 | this.ServiceProvider = serviceProvider; | 22 | this.ServiceProvider = serviceProvider; |
| 23 | |||
| 24 | this.Messaging = this.ServiceProvider.GetService<IMessaging>(); | ||
| 22 | } | 25 | } |
| 23 | 26 | ||
| 24 | private IServiceProvider ServiceProvider { get; } | 27 | private IServiceProvider ServiceProvider { get; } |
| 25 | 28 | ||
| 29 | private IMessaging Messaging { get; } | ||
| 30 | |||
| 26 | private Dictionary<string, IPreprocessorExtension> ExtensionsByPrefix { get; set; } | 31 | private Dictionary<string, IPreprocessorExtension> ExtensionsByPrefix { get; set; } |
| 27 | 32 | ||
| 28 | public void AddVariable(IPreprocessContext context, string name, string value) | 33 | public void AddVariable(IPreprocessContext context, string name, string value) |
| @@ -42,7 +47,7 @@ namespace WixToolset.Core.ExtensibilityServices | |||
| 42 | { | 47 | { |
| 43 | if (showWarning) | 48 | if (showWarning) |
| 44 | { | 49 | { |
| 45 | context.Messaging.Write(WarningMessages.VariableDeclarationCollision(context.CurrentSourceLineNumber, name, value, currentValue)); | 50 | this.Messaging.Write(WarningMessages.VariableDeclarationCollision(context.CurrentSourceLineNumber, name, value, currentValue)); |
| 46 | } | 51 | } |
| 47 | 52 | ||
| 48 | context.Variables[name] = value; | 53 | context.Variables[name] = value; |
| @@ -220,7 +225,7 @@ namespace WixToolset.Core.ExtensibilityServices | |||
| 220 | return context.CurrentSourceLineNumber.FileName; | 225 | return context.CurrentSourceLineNumber.FileName; |
| 221 | 226 | ||
| 222 | case "PLATFORM": | 227 | case "PLATFORM": |
| 223 | context.Messaging.Write(WarningMessages.DeprecatedPreProcVariable(context.CurrentSourceLineNumber, "$(sys.PLATFORM)", "$(sys.BUILDARCH)")); | 228 | this.Messaging.Write(WarningMessages.DeprecatedPreProcVariable(context.CurrentSourceLineNumber, "$(sys.PLATFORM)", "$(sys.BUILDARCH)")); |
| 224 | 229 | ||
| 225 | goto case "BUILDARCH"; | 230 | goto case "BUILDARCH"; |
| 226 | 231 | ||
| @@ -295,7 +300,7 @@ namespace WixToolset.Core.ExtensibilityServices | |||
| 295 | { | 300 | { |
| 296 | // Add any core defined pragmas here | 301 | // Add any core defined pragmas here |
| 297 | default: | 302 | default: |
| 298 | context.Messaging.Write(WarningMessages.PreprocessorUnknownPragma(context.CurrentSourceLineNumber, pragmaName)); | 303 | this.Messaging.Write(WarningMessages.PreprocessorUnknownPragma(context.CurrentSourceLineNumber, pragmaName)); |
| 299 | break; | 304 | break; |
| 300 | } | 305 | } |
| 301 | break; | 306 | break; |
| @@ -306,7 +311,7 @@ namespace WixToolset.Core.ExtensibilityServices | |||
| 306 | { | 311 | { |
| 307 | if (!extension.ProcessPragma(prefix, pragma, args, parent)) | 312 | if (!extension.ProcessPragma(prefix, pragma, args, parent)) |
| 308 | { | 313 | { |
| 309 | context.Messaging.Write(WarningMessages.PreprocessorUnknownPragma(context.CurrentSourceLineNumber, pragmaName)); | 314 | this.Messaging.Write(WarningMessages.PreprocessorUnknownPragma(context.CurrentSourceLineNumber, pragmaName)); |
| 310 | } | 315 | } |
| 311 | } | 316 | } |
| 312 | break; | 317 | break; |
| @@ -339,7 +344,7 @@ namespace WixToolset.Core.ExtensibilityServices | |||
| 339 | currentPosition = remainder.IndexOf(')'); | 344 | currentPosition = remainder.IndexOf(')'); |
| 340 | if (-1 == currentPosition) | 345 | if (-1 == currentPosition) |
| 341 | { | 346 | { |
| 342 | context.Messaging.Write(ErrorMessages.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, remainder)); | 347 | this.Messaging.Write(ErrorMessages.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, remainder)); |
| 343 | break; | 348 | break; |
| 344 | } | 349 | } |
| 345 | 350 | ||
| @@ -385,12 +390,12 @@ namespace WixToolset.Core.ExtensibilityServices | |||
| 385 | { | 390 | { |
| 386 | if (isFunction) | 391 | if (isFunction) |
| 387 | { | 392 | { |
| 388 | context.Messaging.Write(ErrorMessages.InvalidPreprocessorFunction(context.CurrentSourceLineNumber, remainder)); | 393 | this.Messaging.Write(ErrorMessages.InvalidPreprocessorFunction(context.CurrentSourceLineNumber, remainder)); |
| 389 | break; | 394 | break; |
| 390 | } | 395 | } |
| 391 | else | 396 | else |
| 392 | { | 397 | { |
| 393 | context.Messaging.Write(ErrorMessages.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, remainder)); | 398 | this.Messaging.Write(ErrorMessages.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, remainder)); |
| 394 | break; | 399 | break; |
| 395 | } | 400 | } |
| 396 | } | 401 | } |
| @@ -410,12 +415,12 @@ namespace WixToolset.Core.ExtensibilityServices | |||
| 410 | { | 415 | { |
| 411 | if (isFunction) | 416 | if (isFunction) |
| 412 | { | 417 | { |
| 413 | context.Messaging.Write(ErrorMessages.UndefinedPreprocessorFunction(context.CurrentSourceLineNumber, subString)); | 418 | this.Messaging.Write(ErrorMessages.UndefinedPreprocessorFunction(context.CurrentSourceLineNumber, subString)); |
| 414 | break; | 419 | break; |
| 415 | } | 420 | } |
| 416 | else | 421 | else |
| 417 | { | 422 | { |
| 418 | context.Messaging.Write(ErrorMessages.UndefinedPreprocessorVariable(context.CurrentSourceLineNumber, subString)); | 423 | this.Messaging.Write(ErrorMessages.UndefinedPreprocessorVariable(context.CurrentSourceLineNumber, subString)); |
| 419 | break; | 424 | break; |
| 420 | } | 425 | } |
| 421 | } | 426 | } |
| @@ -448,7 +453,7 @@ namespace WixToolset.Core.ExtensibilityServices | |||
| 448 | { | 453 | { |
| 449 | if (!context.Variables.Remove(name)) | 454 | if (!context.Variables.Remove(name)) |
| 450 | { | 455 | { |
| 451 | context.Messaging.Write(ErrorMessages.CannotReundefineVariable(context.CurrentSourceLineNumber, name)); | 456 | this.Messaging.Write(ErrorMessages.CannotReundefineVariable(context.CurrentSourceLineNumber, name)); |
| 452 | } | 457 | } |
| 453 | } | 458 | } |
| 454 | 459 | ||
