Skip to content

Commit d9c4d2e

Browse files
committed
Moving solution to ChakraCore.
1 parent 2e9508e commit d9c4d2e

18 files changed

+130
-101
lines changed

ReactWindows/.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,7 @@ packages/
7676
*project.lock.json
7777

7878
#JavaScript files
79-
*.jsbundle
79+
*.jsbundle
80+
81+
#Exceptions
82+
!References/**/*

ReactWindows/Playground/Playground.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
<FileAlignment>512</FileAlignment>
1818
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1919
<PackageCertificateKeyFile>Playground_TemporaryKey.pfx</PackageCertificateKeyFile>
20+
<ReactNativeReferencesPath>..\References\$(Configuration)\$(Platform)\</ReactNativeReferencesPath>
21+
</PropertyGroup>
22+
<PropertyGroup Condition="'$(Configuration)' == 'Bundle'">
23+
<ReactNativeReferencesPath>..\References\Debug\$(Platform)\</ReactNativeReferencesPath>
2024
</PropertyGroup>
2125
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
2226
<DebugSymbols>true</DebugSymbols>
@@ -185,6 +189,12 @@
185189
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
186190
<Import Project="..\Bundle.targets" />
187191
<Target Name="BeforeBuild" DependsOnTargets="DoBundle" Condition=" '$(Configuration)' == 'Bundle' " />
192+
<Target Name="AfterBuild">
193+
<ItemGroup>
194+
<ChakraDependencies Include="$(ReactNativeReferencesPath)\ChakraCore.*" />
195+
</ItemGroup>
196+
<Copy SourceFiles="@(ChakraDependencies)" DestinationFolder="$(OutputPath)\AppX" />
197+
</Target>
188198
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
189199
Other similar extension points exist, see Microsoft.Common.targets.
190200
<Target Name="BeforeBuild">

ReactWindows/ReactNative/Hosting/Bridge/ChakraJavaScriptExecutor.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using ReactNative.Bridge;
44
using System;
55
using System.Diagnostics;
6-
#if DEBUG
6+
#if DEBUG && !CHAKRACORE
77
using Windows.System.Profile;
88
#endif
99

@@ -132,11 +132,13 @@ private void InitializeChakra()
132132
var context = _runtime.CreateContext();
133133
JavaScriptContext.Current = context;
134134

135+
#if !CHAKRACORE
135136
// Set the WinRT namespace (TODO: needed?)
136137
Native.ThrowIfError(
137138
Native.JsProjectWinRTNamespace("Windows"));
139+
#endif
138140

139-
#if DEBUG
141+
#if DEBUG && !CHAKRACORE
140142
// Start debugging.
141143
if (AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Desktop")
142144
{

ReactWindows/ReactNative/Hosting/JavaScriptContext.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ public static void SetException(JavaScriptValue exception)
354354
Native.ThrowIfError(Native.JsSetException(exception));
355355
}
356356

357+
#if !CHAKRACORE
357358
/// <summary>
358359
/// Starts debugging in the context.
359360
/// </summary>
@@ -362,6 +363,7 @@ public static void StartDebugging()
362363
{
363364
Native.ThrowIfError(Native.JsStartDebugging());
364365
}
366+
#endif
365367

366368
/// <summary>
367369
/// Starts profiling in the current context.

ReactWindows/ReactNative/Hosting/Native.cs

Lines changed: 102 additions & 90 deletions
Large diffs are not rendered by default.

ReactWindows/ReactNative/ReactNative.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<DebugType>full</DebugType>
2424
<Optimize>false</Optimize>
2525
<OutputPath>bin\Debug\</OutputPath>
26-
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
26+
<DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;CHAKRACORE</DefineConstants>
2727
<ErrorReport>prompt</ErrorReport>
2828
<WarningLevel>4</WarningLevel>
2929
</PropertyGroup>
@@ -32,15 +32,15 @@
3232
<DebugType>pdbonly</DebugType>
3333
<Optimize>true</Optimize>
3434
<OutputPath>bin\Release\</OutputPath>
35-
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
35+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;CHAKRACORE</DefineConstants>
3636
<ErrorReport>prompt</ErrorReport>
3737
<WarningLevel>4</WarningLevel>
3838
</PropertyGroup>
3939
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
4040
<PlatformTarget>x86</PlatformTarget>
4141
<DebugSymbols>true</DebugSymbols>
4242
<OutputPath>bin\x86\Debug\</OutputPath>
43-
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
43+
<DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;CHAKRACORE</DefineConstants>
4444
<NoWarn>;2008</NoWarn>
4545
<DebugType>full</DebugType>
4646
<PlatformTarget>x86</PlatformTarget>
@@ -50,7 +50,7 @@
5050
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
5151
<PlatformTarget>x86</PlatformTarget>
5252
<OutputPath>bin\x86\Release\</OutputPath>
53-
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
53+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;CHAKRACORE</DefineConstants>
5454
<Optimize>true</Optimize>
5555
<NoWarn>;2008</NoWarn>
5656
<DebugType>pdbonly</DebugType>
@@ -62,7 +62,7 @@
6262
<PlatformTarget>ARM</PlatformTarget>
6363
<DebugSymbols>true</DebugSymbols>
6464
<OutputPath>bin\ARM\Debug\</OutputPath>
65-
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
65+
<DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;CHAKRACORE</DefineConstants>
6666
<NoWarn>;2008</NoWarn>
6767
<DebugType>full</DebugType>
6868
<PlatformTarget>ARM</PlatformTarget>
@@ -72,7 +72,7 @@
7272
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
7373
<PlatformTarget>ARM</PlatformTarget>
7474
<OutputPath>bin\ARM\Release\</OutputPath>
75-
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
75+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;CHAKRACORE</DefineConstants>
7676
<Optimize>true</Optimize>
7777
<NoWarn>;2008</NoWarn>
7878
<DebugType>pdbonly</DebugType>
@@ -84,7 +84,7 @@
8484
<PlatformTarget>x64</PlatformTarget>
8585
<DebugSymbols>true</DebugSymbols>
8686
<OutputPath>bin\x64\Debug\</OutputPath>
87-
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
87+
<DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;CHAKRACORE</DefineConstants>
8888
<NoWarn>;2008</NoWarn>
8989
<DebugType>full</DebugType>
9090
<PlatformTarget>x64</PlatformTarget>
@@ -94,7 +94,7 @@
9494
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
9595
<PlatformTarget>x64</PlatformTarget>
9696
<OutputPath>bin\x64\Release\</OutputPath>
97-
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
97+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;CHAKRACORE</DefineConstants>
9898
<Optimize>true</Optimize>
9999
<NoWarn>;2008</NoWarn>
100100
<DebugType>pdbonly</DebugType>

0 commit comments

Comments
 (0)