-
Notifications
You must be signed in to change notification settings - Fork 160
Expand file tree
/
Copy pathV8ScriptEngine.InitScript.tt
More file actions
35 lines (28 loc) · 1.05 KB
/
V8ScriptEngine.InitScript.tt
File metadata and controls
35 lines (28 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ output extension=".cs" #>
<#@ assembly name="EnvDTE" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="System.Net.Http" #>
<#@ import namespace="EnvDTE" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Net.Http" #>
<#
var dte = (DTE)((IServiceProvider)Host).GetService(typeof(DTE));
var solutionPath = Path.GetDirectoryName(dte.Solution.FullName);
var scriptPath = Path.Combine(solutionPath, "ClearScript", "V8", "V8ScriptEngine.InitScript.js");
var lines = File.ReadAllLines(scriptPath).Select(line => string.IsNullOrWhiteSpace(line) ? string.Empty : " " + line);
var script = string.Join("\r\n", lines);
#>
namespace Microsoft.ClearScript.V8
{
public sealed partial class V8ScriptEngine
{
private const string initScript = @"
<#= script #>
";
}
}