Skip to content

Commit e54d6d2

Browse files
committed
In JavaScriptEngineSwitcher.V8 added support of .NET Framework 4.5.2
1 parent d682113 commit e54d6d2

File tree

16 files changed

+166
-49
lines changed

16 files changed

+166
-49
lines changed

JavaScriptEngineSwitcher.DotNet.sln

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{0C281F46-F1D
99
EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{53B43213-2E66-42C2-8476-600A2FD2DA75}"
1111
EndProject
12+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ClearScriptPrecompiled", "precompiled\ClearScriptPrecompiled\ClearScriptPrecompiled.xproj", "{92B9BBB1-DDC9-45D9-A27E-1358A085FA6E}"
13+
EndProject
1214
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "JurassicPrecompiled", "precompiled\JurassicPrecompiled\JurassicPrecompiled.xproj", "{6108205A-FDC7-4B5B-AB57-33E03B2E418A}"
1315
EndProject
1416
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "JavaScriptEngineSwitcher.Core", "src\JavaScriptEngineSwitcher.Core\JavaScriptEngineSwitcher.Core.xproj", "{13559975-F99D-4B93-BF46-227C0B6E0DFB}"
1517
EndProject
1618
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "JavaScriptEngineSwitcher.Msie", "src\JavaScriptEngineSwitcher.Msie\JavaScriptEngineSwitcher.Msie.xproj", "{B3C4AA95-2227-47DD-B58C-22FA589CB28D}"
1719
EndProject
20+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "JavaScriptEngineSwitcher.V8", "src\JavaScriptEngineSwitcher.V8\JavaScriptEngineSwitcher.V8.xproj", "{C24E1F3C-5680-463A-8703-B9F40BCDAC77}"
21+
EndProject
1822
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "JavaScriptEngineSwitcher.Jurassic", "src\JavaScriptEngineSwitcher.Jurassic\JavaScriptEngineSwitcher.Jurassic.xproj", "{D31B5A77-8018-4D76-B372-325564385B2D}"
1923
EndProject
2024
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "JavaScriptEngineSwitcher.Jint", "src\JavaScriptEngineSwitcher.Jint\JavaScriptEngineSwitcher.Jint.xproj", "{22D73C6E-5F35-497B-A93B-F9EAAAE4DDAA}"
@@ -29,6 +33,10 @@ Global
2933
Release|Any CPU = Release|Any CPU
3034
EndGlobalSection
3135
GlobalSection(ProjectConfigurationPlatforms) = postSolution
36+
{6108205A-FDC7-4B5B-AB57-33E03B2E418A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37+
{6108205A-FDC7-4B5B-AB57-33E03B2E418A}.Debug|Any CPU.Build.0 = Debug|Any CPU
38+
{6108205A-FDC7-4B5B-AB57-33E03B2E418A}.Release|Any CPU.ActiveCfg = Release|Any CPU
39+
{6108205A-FDC7-4B5B-AB57-33E03B2E418A}.Release|Any CPU.Build.0 = Release|Any CPU
3240
{13559975-F99D-4B93-BF46-227C0B6E0DFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3341
{13559975-F99D-4B93-BF46-227C0B6E0DFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
3442
{13559975-F99D-4B93-BF46-227C0B6E0DFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -37,6 +45,10 @@ Global
3745
{B3C4AA95-2227-47DD-B58C-22FA589CB28D}.Debug|Any CPU.Build.0 = Debug|Any CPU
3846
{B3C4AA95-2227-47DD-B58C-22FA589CB28D}.Release|Any CPU.ActiveCfg = Release|Any CPU
3947
{B3C4AA95-2227-47DD-B58C-22FA589CB28D}.Release|Any CPU.Build.0 = Release|Any CPU
48+
{D31B5A77-8018-4D76-B372-325564385B2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
49+
{D31B5A77-8018-4D76-B372-325564385B2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
50+
{D31B5A77-8018-4D76-B372-325564385B2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
51+
{D31B5A77-8018-4D76-B372-325564385B2D}.Release|Any CPU.Build.0 = Release|Any CPU
4052
{22D73C6E-5F35-497B-A93B-F9EAAAE4DDAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4153
{22D73C6E-5F35-497B-A93B-F9EAAAE4DDAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
4254
{22D73C6E-5F35-497B-A93B-F9EAAAE4DDAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -49,25 +61,27 @@ Global
4961
{E95FDEF6-18A0-4E26-8FDF-B4B590E6EDAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
5062
{E95FDEF6-18A0-4E26-8FDF-B4B590E6EDAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
5163
{E95FDEF6-18A0-4E26-8FDF-B4B590E6EDAF}.Release|Any CPU.Build.0 = Release|Any CPU
52-
{D31B5A77-8018-4D76-B372-325564385B2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
53-
{D31B5A77-8018-4D76-B372-325564385B2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
54-
{D31B5A77-8018-4D76-B372-325564385B2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
55-
{D31B5A77-8018-4D76-B372-325564385B2D}.Release|Any CPU.Build.0 = Release|Any CPU
56-
{6108205A-FDC7-4B5B-AB57-33E03B2E418A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
57-
{6108205A-FDC7-4B5B-AB57-33E03B2E418A}.Debug|Any CPU.Build.0 = Debug|Any CPU
58-
{6108205A-FDC7-4B5B-AB57-33E03B2E418A}.Release|Any CPU.ActiveCfg = Release|Any CPU
59-
{6108205A-FDC7-4B5B-AB57-33E03B2E418A}.Release|Any CPU.Build.0 = Release|Any CPU
64+
{92B9BBB1-DDC9-45D9-A27E-1358A085FA6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
65+
{92B9BBB1-DDC9-45D9-A27E-1358A085FA6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
66+
{92B9BBB1-DDC9-45D9-A27E-1358A085FA6E}.Release|Any CPU.ActiveCfg = Release|Any CPU
67+
{92B9BBB1-DDC9-45D9-A27E-1358A085FA6E}.Release|Any CPU.Build.0 = Release|Any CPU
68+
{C24E1F3C-5680-463A-8703-B9F40BCDAC77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
69+
{C24E1F3C-5680-463A-8703-B9F40BCDAC77}.Debug|Any CPU.Build.0 = Debug|Any CPU
70+
{C24E1F3C-5680-463A-8703-B9F40BCDAC77}.Release|Any CPU.ActiveCfg = Release|Any CPU
71+
{C24E1F3C-5680-463A-8703-B9F40BCDAC77}.Release|Any CPU.Build.0 = Release|Any CPU
6072
EndGlobalSection
6173
GlobalSection(SolutionProperties) = preSolution
6274
HideSolutionNode = FALSE
6375
EndGlobalSection
6476
GlobalSection(NestedProjects) = preSolution
77+
{6108205A-FDC7-4B5B-AB57-33E03B2E418A} = {D36F06D5-6CE7-4295-B035-513A99013A26}
6578
{13559975-F99D-4B93-BF46-227C0B6E0DFB} = {0C281F46-F1D2-4A1C-8560-375EDA65D680}
6679
{B3C4AA95-2227-47DD-B58C-22FA589CB28D} = {0C281F46-F1D2-4A1C-8560-375EDA65D680}
80+
{D31B5A77-8018-4D76-B372-325564385B2D} = {0C281F46-F1D2-4A1C-8560-375EDA65D680}
6781
{22D73C6E-5F35-497B-A93B-F9EAAAE4DDAA} = {0C281F46-F1D2-4A1C-8560-375EDA65D680}
6882
{2EFFFC6B-E642-477F-B537-4241EBD93410} = {0C281F46-F1D2-4A1C-8560-375EDA65D680}
6983
{E95FDEF6-18A0-4E26-8FDF-B4B590E6EDAF} = {53B43213-2E66-42C2-8476-600A2FD2DA75}
70-
{D31B5A77-8018-4D76-B372-325564385B2D} = {0C281F46-F1D2-4A1C-8560-375EDA65D680}
71-
{6108205A-FDC7-4B5B-AB57-33E03B2E418A} = {D36F06D5-6CE7-4295-B035-513A99013A26}
84+
{92B9BBB1-DDC9-45D9-A27E-1358A085FA6E} = {D36F06D5-6CE7-4295-B035-513A99013A26}
85+
{C24E1F3C-5680-463A-8703-B9F40BCDAC77} = {0C281F46-F1D2-4A1C-8560-375EDA65D680}
7286
EndGlobalSection
7387
EndGlobal

NuGet/JavaScriptEngineSwitcher.V8/JavaScriptEngineSwitcher.V8.nuspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
<group targetFramework=".NETFramework4.0-Client">
2121
<dependency id="JavaScriptEngineSwitcher.Core" version="2.0.0-alpha1" />
2222
</group>
23+
<group targetFramework=".NETFramework4.5.2">
24+
<dependency id="JavaScriptEngineSwitcher.Core" version="2.0.0-alpha1" />
25+
</group>
2326
</dependencies>
2427
<references>
2528
<reference file="JavaScriptEngineSwitcher.V8.dll" />

NuGet/JavaScriptEngineSwitcher.V8/build-package.cmd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ xcopy "%project_bin_dir%\%project_name%.dll" lib\net40-client\
1818
xcopy "%project_bin_dir%\ru-ru\%project_name%.resources.dll" lib\net40-client\ru-ru\
1919
xcopy "%binaries_dir%\ClearScript.dll" lib\net40-client\
2020

21+
%dotnet_cli% build "%project_source_dir%" --framework net452 --configuration Release --no-dependencies --no-incremental
22+
xcopy "%project_bin_dir%\net452\%project_name%.dll" lib\net452\
23+
xcopy "%project_bin_dir%\net452\%project_name%.xml" lib\net452\
24+
xcopy "%project_bin_dir%\net452\ru-ru\%project_name%.resources.dll" lib\net452\ru-ru\
25+
xcopy "%binaries_dir%\ClearScript.dll" lib\net452\
26+
2127
xcopy "%binaries_dir%\x86\ClearScriptV8-32.dll" runtimes\win7-x86\native\
2228
xcopy "%binaries_dir%\x86\v8-ia32.dll" runtimes\win7-x86\native\
2329
xcopy "%binaries_dir%\x64\ClearScriptV8-64.dll" runtimes\win7-x64\native\
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
8+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
9+
<PropertyGroup Label="Globals">
10+
<ProjectGuid>92b9bbb1-ddc9-45d9-a27e-1358a085fa6e</ProjectGuid>
11+
<RootNamespace>ClearScriptPrecompiled</RootNamespace>
12+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
13+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
14+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
15+
</PropertyGroup>
16+
17+
<PropertyGroup>
18+
<SchemaVersion>2.0</SchemaVersion>
19+
</PropertyGroup>
20+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
21+
</Project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System.Reflection;
2+
using System.Runtime.InteropServices;
3+
4+
[assembly: AssemblyTitle("ClearScriptPrecompiled")]
5+
[assembly: AssemblyDescription("")]
6+
[assembly: AssemblyConfiguration("")]
7+
[assembly: AssemblyCompany("Microsoft")]
8+
[assembly: AssemblyProduct("ClearScript Precompiled")]
9+
[assembly: AssemblyCopyright("(c) Microsoft Corporation")]
10+
[assembly: AssemblyTrademark("")]
11+
[assembly: AssemblyCulture("")]
12+
13+
[assembly: ComVisible(false)]
14+
[assembly: Guid("1e4eb77e-0771-4109-832f-20e3475315ed")]
15+
16+
[assembly: AssemblyVersion("2016.6.20.0")]
17+
[assembly: AssemblyFileVersion("2016.6.20.0")]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "2016.6.20",
3+
4+
"frameworks": {
5+
"net452": {
6+
"bin": {
7+
"assembly": "../../Binaries/ClearScript/ClearScript.dll"
8+
}
9+
}
10+
}
11+
}

src/JavaScriptEngineSwitcher.ChakraCore/AssemblyResolver.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,21 @@ public static void Initialize()
5757
string assemblyFileName = ASSEMBLY_NAME + ".dll";
5858
string assemblyDirectoryPath = Path.Combine(baseDirectoryPath, platform);
5959
string assemblyFilePath = Path.Combine(assemblyDirectoryPath, assemblyFileName);
60+
bool assemblyFileExists = File.Exists(assemblyFilePath);
6061

61-
if (!File.Exists(assemblyFilePath))
62+
if (!assemblyFileExists)
6263
{
6364
string projectDirectoryPath = PathHelpers.RemoveDirectoryFromPath(baseDirectoryPath, "bin");
6465
string solutionDirectoryPath = Path.GetFullPath(Path.Combine(projectDirectoryPath, "../../"));
6566
assemblyDirectoryPath = Path.GetFullPath(
6667
Path.Combine(solutionDirectoryPath, "Binaries/ChakraCore/", platform));
68+
assemblyFilePath = Path.Combine(assemblyDirectoryPath, assemblyFileName);
69+
assemblyFileExists = File.Exists(assemblyFilePath);
70+
}
71+
72+
if (!assemblyFileExists)
73+
{
74+
return;
6775
}
6876

6977
if (!SetDllDirectory(assemblyDirectoryPath))

src/JavaScriptEngineSwitcher.Jurassic/project.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
"JavaScriptEngineSwitcher.Core": "2.0.0-alpha1"
77
},
88

9-
"frameworks": {
10-
"net452": {}
11-
},
12-
139
"buildOptions": {
1410
"warningsAsErrors": true,
1511
"keyFile": "../../tools/Key.snk",
1612
"nowarn": [
1713
"CS1591"
1814
],
1915
"xmlDoc": true
16+
},
17+
18+
"frameworks": {
19+
"net452": {}
2020
}
2121
}

src/JavaScriptEngineSwitcher.V8/AssemblyResolver.cs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
using System.IO;
33
using System.Reflection;
44

5+
using JavaScriptEngineSwitcher.Core.Helpers;
6+
57
using JavaScriptEngineSwitcher.V8.Resources;
68

79
namespace JavaScriptEngineSwitcher.V8
@@ -30,12 +32,12 @@ private static Assembly AssemblyResolveHandler(object sender, ResolveEventArgs a
3032
if (args.Name.StartsWith(ASSEMBLY_NAME, StringComparison.OrdinalIgnoreCase))
3133
{
3234
var currentDomain = (AppDomain)sender;
33-
string binDirectoryPath = currentDomain.SetupInformation.PrivateBinPath;
34-
if (string.IsNullOrEmpty(binDirectoryPath))
35+
string baseDirectoryPath = currentDomain.SetupInformation.PrivateBinPath;
36+
if (string.IsNullOrEmpty(baseDirectoryPath))
3537
{
3638
// `PrivateBinPath` property is empty in test scenarios, so
3739
// need to use the `BaseDirectory` property
38-
binDirectoryPath = currentDomain.BaseDirectory;
40+
baseDirectoryPath = currentDomain.BaseDirectory;
3941
}
4042

4143
string platformName;
@@ -51,20 +53,26 @@ private static Assembly AssemblyResolveHandler(object sender, ResolveEventArgs a
5153
platformBitness = 32;
5254
}
5355

54-
string assemblyDirectoryPath = Path.Combine(binDirectoryPath, platformName);
56+
string assemblyDirectoryPath = Path.Combine(baseDirectoryPath, platformName);
5557
string assemblyFileName = string.Format("{0}-{1}.dll", ASSEMBLY_NAME, platformBitness);
5658
string assemblyFilePath = Path.Combine(assemblyDirectoryPath, assemblyFileName);
59+
bool assemblyFileExists = File.Exists(assemblyFilePath);
5760

58-
if (!Directory.Exists(assemblyDirectoryPath))
61+
if (!assemblyFileExists)
5962
{
60-
throw new DirectoryNotFoundException(
61-
string.Format(Strings.Engines_ClearScriptV8AssembliesDirectoryNotFound, assemblyDirectoryPath));
63+
string projectDirectoryPath = PathHelpers.RemoveDirectoryFromPath(baseDirectoryPath, "bin");
64+
string solutionDirectoryPath = Path.GetFullPath(Path.Combine(projectDirectoryPath, "../../"));
65+
assemblyDirectoryPath = Path.GetFullPath(
66+
Path.Combine(solutionDirectoryPath, "Binaries/ClearScript/", platformName));
67+
assemblyFilePath = Path.Combine(assemblyDirectoryPath, assemblyFileName);
68+
assemblyFileExists = File.Exists(assemblyFilePath);
6269
}
6370

64-
if (!File.Exists(assemblyFilePath))
71+
72+
if (!assemblyFileExists)
6573
{
6674
throw new FileNotFoundException(
67-
string.Format(Strings.Engines_ClearScriptV8AssemblyFileNotFound, assemblyFilePath));
75+
string.Format(Strings.Engines_ClearScriptV8AssemblyFileNotFound, assemblyFileName));
6876
}
6977

7078
return Assembly.LoadFile(assemblyFilePath);
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
8+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
9+
<PropertyGroup Label="Globals">
10+
<ProjectGuid>c24e1f3c-5680-463a-8703-b9f40bcdac77</ProjectGuid>
11+
<RootNamespace>JavaScriptEngineSwitcher.V8</RootNamespace>
12+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
13+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
14+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
15+
</PropertyGroup>
16+
17+
<PropertyGroup>
18+
<SchemaVersion>2.0</SchemaVersion>
19+
</PropertyGroup>
20+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
21+
</Project>

0 commit comments

Comments
 (0)