mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 19:54:53 +00:00
Merge branch 'JsBinding_WIP' into JsBinding/Wip2
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="cef.redist" version="3.1650.1562-pre0" />
|
||||
<package id="cef.redist" version="3.1750.1738" />
|
||||
</packages>
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace CefSharp
|
||||
|
||||
CefMainArgs cefMainArgs((HINSTANCE)hInstance.ToPointer());
|
||||
|
||||
return CefExecuteProcess(cefMainArgs, (CefApp*)_cefApp.get());
|
||||
return CefExecuteProcess(cefMainArgs, (CefApp*)_cefApp.get(), NULL);
|
||||
}
|
||||
|
||||
void CefAppWrapper::Bind(JavascriptRootObject^ rootObject, Func<IBrowserProcess^>^ createBrowserProxyDelegate)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\cef.sdk.3.1650.1562-pre2\build\cef.sdk.props" Condition="Exists('..\packages\cef.sdk.3.1650.1562-pre2\build\cef.sdk.props')" />
|
||||
<Import Project="..\packages\cef.sdk.3.1750.1738\build\cef.sdk.props" Condition="Exists('..\packages\cef.sdk.3.1750.1738\build\cef.sdk.props')" />
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
@@ -65,7 +65,9 @@
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<NuGetPackageImportStamp>47d3feda</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<LinkKeyFile>..\CefSharp.snk</LinkKeyFile>
|
||||
@@ -196,6 +198,6 @@
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\cef.sdk.3.1650.1562-pre2\build\cef.sdk.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.sdk.3.1650.1562-pre2\build\cef.sdk.props'))" />
|
||||
<Error Condition="!Exists('..\packages\cef.sdk.3.1750.1738\build\cef.sdk.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.sdk.3.1750.1738\build\cef.sdk.props'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="cef.sdk" version="3.1650.1562-pre2" targetFramework="Native" />
|
||||
</packages>
|
||||
<package id="cef.sdk" version="3.1750.1738" targetFramework="Native" />
|
||||
</packages>
|
||||
@@ -248,18 +248,6 @@ namespace CefSharp
|
||||
void set(Nullable<bool>^ value) { _browserSettings->tab_to_links = CefStateFromDisabledSetting(value); }
|
||||
}
|
||||
|
||||
property String^ UserStyleSheetLocation
|
||||
{
|
||||
String^ get() { return StringUtils::ToClr(_browserSettings->user_style_sheet_location); }
|
||||
void set(String^ value) { StringUtils::AssignNativeFromClr(_browserSettings->user_style_sheet_location, value); }
|
||||
}
|
||||
|
||||
property Nullable<bool>^ AuthorAndUserStylesDisabled
|
||||
{
|
||||
Nullable<bool>^ get() { return CefStateToDisabledSetting(_browserSettings->author_and_user_styles); }
|
||||
void set(Nullable<bool>^ value) { _browserSettings->author_and_user_styles = CefStateFromDisabledSetting(value); }
|
||||
}
|
||||
|
||||
property Nullable<bool>^ LocalStorageDisabled
|
||||
{
|
||||
Nullable<bool>^ get() { return CefStateToDisabledSetting(_browserSettings->local_storage); }
|
||||
|
||||
+3
-3
@@ -148,7 +148,7 @@ namespace CefSharp
|
||||
CefMainArgs main_args;
|
||||
CefRefPtr<CefSharpApp> app(new CefSharpApp(cefSettings));
|
||||
|
||||
int exitCode = CefExecuteProcess(main_args, app.get());
|
||||
int exitCode = CefExecuteProcess(main_args, app.get(), NULL);
|
||||
|
||||
if (exitCode >= 0)
|
||||
{
|
||||
@@ -157,7 +157,7 @@ namespace CefSharp
|
||||
return false;
|
||||
}
|
||||
|
||||
success = CefInitialize(main_args, *(cefSettings->_cefSettings), app.get());
|
||||
success = CefInitialize(main_args, *(cefSettings->_cefSettings), app.get(), NULL);
|
||||
app->CompleteSchemeRegistrations();
|
||||
_initialized = success;
|
||||
|
||||
@@ -318,7 +318,7 @@ namespace CefSharp
|
||||
}
|
||||
|
||||
/// <summary> Flush the backing store (if any) to disk and execute the specified |handler| on the IO thread when done. Returns </summary>
|
||||
/// <param name="handler">A user-provided ICompletion handler implementation.</param>
|
||||
/// <param name="handler">A user-provided ICompletionHandler implementation.</param>
|
||||
/// <return>Returns false if cookies cannot be accessed.</return>
|
||||
static bool FlushStore(ICompletionHandler^ handler)
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace CefSharp
|
||||
public:
|
||||
CefSettings() : _cefSettings(new ::CefSettings())
|
||||
{
|
||||
MultiThreadedMessageLoop = true;
|
||||
_cefSettings->multi_threaded_message_loop = true;
|
||||
BrowserSubprocessPath = "CefSharp.BrowserSubprocess.exe";
|
||||
cefCustomSchemes = gcnew List<CefCustomScheme^>();
|
||||
cefCommandLineArgs = gcnew Dictionary<String^, String^>();
|
||||
@@ -86,12 +86,7 @@ namespace CefSharp
|
||||
|
||||
virtual property bool MultiThreadedMessageLoop
|
||||
{
|
||||
bool get() { return _cefSettings->multi_threaded_message_loop; }
|
||||
|
||||
// CefSharp doesn't support single threaded message loop (and there's little point in supporting it), so we make this
|
||||
// property read-only externally.
|
||||
private:
|
||||
void set(bool value) sealed { _cefSettings->multi_threaded_message_loop = value; }
|
||||
bool get() { return _cefSettings->multi_threaded_message_loop == 1; }
|
||||
}
|
||||
|
||||
virtual property String^ BrowserSubprocessPath
|
||||
@@ -108,7 +103,7 @@ namespace CefSharp
|
||||
|
||||
virtual property bool IgnoreCertificateErrors
|
||||
{
|
||||
bool get() { return _cefSettings->ignore_certificate_errors; }
|
||||
bool get() { return _cefSettings->ignore_certificate_errors == 1; }
|
||||
void set(bool value) { _cefSettings->ignore_certificate_errors = value; }
|
||||
}
|
||||
|
||||
@@ -138,7 +133,7 @@ namespace CefSharp
|
||||
|
||||
virtual property bool PackLoadingDisabled
|
||||
{
|
||||
bool get() { return _cefSettings->pack_loading_disabled; }
|
||||
bool get() { return _cefSettings->pack_loading_disabled == 1; }
|
||||
void set(bool value) { _cefSettings->pack_loading_disabled = value; }
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\cef.sdk.3.1650.1562-pre2\build\cef.sdk.props" Condition="Exists('..\packages\cef.sdk.3.1650.1562-pre2\build\cef.sdk.props')" />
|
||||
<Import Project="..\packages\cef.sdk.3.1750.1738\build\cef.sdk.props" Condition="Exists('..\packages\cef.sdk.3.1750.1738\build\cef.sdk.props')" />
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
@@ -278,6 +278,6 @@
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\cef.sdk.3.1650.1562-pre2\build\cef.sdk.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.sdk.3.1650.1562-pre2\build\cef.sdk.props'))" />
|
||||
<Error Condition="!Exists('..\packages\cef.sdk.3.1750.1738\build\cef.sdk.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.sdk.3.1750.1738\build\cef.sdk.props'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -141,7 +141,7 @@ namespace CefSharp
|
||||
|
||||
// TODO: windows_key_code could possibly be the wrong choice here (the OnKeyEvent signature has changed since CEF1). The
|
||||
// other option would be native_key_code.
|
||||
return handler->OnKeyEvent(_browserControl, KeyTypeToManaged(event.type), event.windows_key_code, event.modifiers, event.is_system_key);
|
||||
return handler->OnKeyEvent(_browserControl, KeyTypeToManaged(event.type), event.windows_key_code, event.modifiers, event.is_system_key == 1);
|
||||
}
|
||||
|
||||
bool ClientAdapter::OnPreKeyEvent(CefRefPtr<CefBrowser> browser, const CefKeyEvent& event, CefEventHandle os_event, bool* is_keyboard_shortcut)
|
||||
@@ -153,7 +153,7 @@ namespace CefSharp
|
||||
return false;
|
||||
}
|
||||
|
||||
return handler->OnPreKeyEvent(_browserControl, (KeyType)event.type, event.windows_key_code, event.native_key_code, event.modifiers, event.is_system_key, *is_keyboard_shortcut);
|
||||
return handler->OnPreKeyEvent(_browserControl, (KeyType)event.type, event.windows_key_code, event.native_key_code, event.modifiers, event.is_system_key == 1, *is_keyboard_shortcut);
|
||||
}
|
||||
|
||||
void ClientAdapter::OnLoadStart(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame)
|
||||
@@ -266,8 +266,6 @@ namespace CefSharp
|
||||
}
|
||||
else if (requestResponse->Action == ResponseAction::Respond)
|
||||
{
|
||||
CefRefPtr<StreamAdapter> adapter = new StreamAdapter(requestResponse->ResponseStream);
|
||||
|
||||
throw gcnew NotImplementedException("Respond is not yet supported.");
|
||||
|
||||
//resourceStream = CefStreamReader::CreateForHandler(static_cast<CefRefPtr<CefReadHandler>>(adapter));
|
||||
|
||||
@@ -20,8 +20,8 @@ namespace CefSharp
|
||||
cookie->Value = StringUtils::ToClr(cefCookie.value);
|
||||
cookie->Domain = StringUtils::ToClr(cefCookie.domain);
|
||||
cookie->Path = StringUtils::ToClr(cefCookie.path);
|
||||
cookie->Secure = cefCookie.secure;
|
||||
cookie->HttpOnly = cefCookie.httponly;
|
||||
cookie->Secure = cefCookie.secure == 1;
|
||||
cookie->HttpOnly = cefCookie.httponly == 1;
|
||||
|
||||
if (cefCookie.has_expires)
|
||||
{
|
||||
|
||||
@@ -128,6 +128,31 @@ namespace CefSharp
|
||||
return cefBrowser->GetMainFrame();
|
||||
};
|
||||
|
||||
void ShowDevTools()
|
||||
{
|
||||
auto cefHost = TryGetCefHost();
|
||||
|
||||
if (cefHost != nullptr)
|
||||
{
|
||||
CefWindowInfo windowInfo;
|
||||
CefBrowserSettings settings;
|
||||
|
||||
windowInfo.SetAsPopup(cefHost->GetWindowHandle(), "DevTools");
|
||||
|
||||
cefHost->ShowDevTools(windowInfo, this, settings);
|
||||
}
|
||||
}
|
||||
|
||||
void CloseDevTools()
|
||||
{
|
||||
auto cefHost = TryGetCefHost();
|
||||
|
||||
if (cefHost != nullptr)
|
||||
{
|
||||
cefHost->CloseDevTools();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void SetBuffer(BitmapInfo^ bitmapInfo, int newWidth, int newHeight, const void* buffer)
|
||||
@@ -198,7 +223,7 @@ namespace CefSharp
|
||||
CopyMemory(*backBufferHandle, (void*)buffer, numberOfBytes);
|
||||
};
|
||||
|
||||
IMPLEMENT_REFCOUNTING(RenderClientAdapterInternal)
|
||||
IMPLEMENT_REFCOUNTING(RenderClientAdapter)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,23 +46,6 @@ namespace CefSharp
|
||||
};
|
||||
|
||||
public:
|
||||
property String^ DevToolsUrl
|
||||
{
|
||||
String^ get()
|
||||
{
|
||||
auto cefHost = _renderClientAdapter->TryGetCefHost();
|
||||
|
||||
if (cefHost != nullptr)
|
||||
{
|
||||
return StringUtils::ToClr(cefHost->GetDevToolsURL(true));
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ManagedCefBrowserAdapter(IWebBrowserInternal^ webBrowserInternal)
|
||||
{
|
||||
_renderClientAdapter = new RenderClientAdapter(webBrowserInternal, gcnew Action<int>(this, &ManagedCefBrowserAdapter::OnAfterBrowserCreated));
|
||||
@@ -468,6 +451,16 @@ namespace CefSharp
|
||||
}
|
||||
}
|
||||
|
||||
void ShowDevTools()
|
||||
{
|
||||
_renderClientAdapter->ShowDevTools();
|
||||
}
|
||||
|
||||
void CloseDevTools()
|
||||
{
|
||||
_renderClientAdapter->CloseDevTools();
|
||||
}
|
||||
|
||||
void CreateBrowser(BrowserSettings^ browserSettings, IntPtr^ sourceHandle, String^ address)
|
||||
{
|
||||
HWND hwnd = static_cast<HWND>(sourceHandle->ToPointer());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="cef.sdk" version="3.1650.1562-pre2" targetFramework="Native" />
|
||||
<package id="cef.sdk" version="3.1750.1738" targetFramework="Native" />
|
||||
</packages>
|
||||
@@ -16,6 +16,7 @@ namespace CefSharp.Example
|
||||
settings.RemoteDebuggingPort = 8088;
|
||||
//settings.CefCommandLineArgs.Add("renderer-process-limit", "1");
|
||||
//settings.CefCommandLineArgs.Add("renderer-startup-dialog", "renderer-startup-dialog");
|
||||
settings.LogSeverity = LogSeverity.Verbose;
|
||||
|
||||
if (debuggingSubProcess)
|
||||
{
|
||||
|
||||
@@ -105,17 +105,17 @@
|
||||
<p>
|
||||
Perhaps very obvious, but still worth mentioning. Since CefSharp is based on
|
||||
<a href="http://code.google.com/p/chromiumembedded/">CEF</a>, which is in turn based on
|
||||
<a href="http://www.chromium.org/Home">Chromium</a> (version 29 for the time being), CefSharp provides
|
||||
<a href="http://www.chromium.org/Home">Chromium</a> (version 33 for the time being), CefSharp provides
|
||||
one of the best HTML5 rendering experiences available -
|
||||
<a href="http://html5test.com/compare/browser/chrome-25/mybrowser/chrome-29/chrome-33/ie-11.html">
|
||||
468-470+ points out of 555
|
||||
<a href="http://html5test.com/compare/browser/chrome-25/mybrowser/chrome-33/chrome-35/ie-11.html">
|
||||
470+ points out of 555
|
||||
</a> on <a href="http://www.html5test.com">html5test.com</a>. Note:
|
||||
<a href="http://en.wiktionary.org/wiki/your_mileage_may_vary" title="Your mileage may vary">YMMV</a>
|
||||
depending on .DLLs you add and features you enable.
|
||||
</p>
|
||||
<h3>Support for both x86 and x64</h3>
|
||||
<p>
|
||||
Chromium 29 supports both x86 and x64, and so do we as of CefSharp 3.29.0. For the time being, it does not
|
||||
Chromium 33 supports both x86 and x64, and so do we as of CefSharp 33.0.0 For the time being, it does not
|
||||
"auto-detect" the platform being used (since this is quite complex), so you have to choose either one for
|
||||
your project. This practically means that you will have to compile & package separate
|
||||
binaries/installers of your app for x86 and x64 respectively if you want/need to support both of them.
|
||||
|
||||
@@ -1,22 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<UnmanagedPlatform>x64</UnmanagedPlatform>
|
||||
<UnmanagedPlatform Condition="'$(Platform)'=='x86'">Win32</UnmanagedPlatform>
|
||||
</PropertyGroup>
|
||||
<!-- TODO: Extract this to an includable .props file, which we can then bundle with the CefSharp.Wpf NuGet package. -->
|
||||
<Target Name="AfterBuild">
|
||||
<ItemGroup>
|
||||
<CefBinaries Include="$(SolutionDir)packages\cef.redist.3.1650.1562-pre0\CEF\$(Platform)\*.*" />
|
||||
<ResourceFiles Include="$(SolutionDir)packages\cef.redist.3.1650.1562-pre0\CEF\*.*" />
|
||||
<LocaleFiles Include="$(SolutionDir)packages\cef.redist.3.1650.1562-pre0\CEF\locales\*.*" />
|
||||
<!-- We only need the .exe and .pdb but I don't know how to express that easily with MSBuild... -->
|
||||
<SubProcessFiles Include="$(SolutionDir)\CefSharp.BrowserSubprocess\bin\$(Platform)\$(Configuration)\CefSharp.BrowserSubprocess.*" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(CefBinaries)" DestinationFolder="$(TargetDir)" />
|
||||
<Copy SourceFiles="@(ResourceFiles)" DestinationFolder="$(TargetDir)" />
|
||||
<Copy SourceFiles="@(LocaleFiles)" DestinationFolder="$(TargetDir)locales" />
|
||||
<Copy SourceFiles="@(SubProcessFiles)" DestinationFolder="$(TargetDir)" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -135,4 +135,11 @@
|
||||
-->
|
||||
<Import Project="$(SolutionDir)\CefSharp.props" />
|
||||
<Import Project="$(SolutionDir)\CefSharp.Native.props" />
|
||||
<Import Project="..\packages\cef.redist.3.1750.1738\build\cef.redist.targets" Condition="Exists('..\packages\cef.redist.3.1750.1738\build\cef.redist.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\cef.redist.3.1750.1738\build\cef.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.3.1750.1738\build\cef.redist.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -2,6 +2,7 @@
|
||||
<packages>
|
||||
<package id="AutoFixture" version="3.18.7" targetFramework="net40" />
|
||||
<package id="AutoFixture.Xunit" version="3.18.7" targetFramework="net40" />
|
||||
<package id="cef.redist" version="3.1750.1738" targetFramework="net40" />
|
||||
<package id="xunit" version="1.9.2" targetFramework="net40" />
|
||||
<package id="xunit.extensions" version="1.8.0.1549" targetFramework="net40" />
|
||||
</packages>
|
||||
+2
-2
@@ -249,17 +249,17 @@
|
||||
//
|
||||
// showDevToolsMenuItem
|
||||
//
|
||||
this.showDevToolsMenuItem.Enabled = false;
|
||||
this.showDevToolsMenuItem.Name = "showDevToolsMenuItem";
|
||||
this.showDevToolsMenuItem.Size = new System.Drawing.Size(158, 22);
|
||||
this.showDevToolsMenuItem.Text = "Show Dev Tools";
|
||||
this.showDevToolsMenuItem.Click += new System.EventHandler(this.ShowDevToolsMenuItemClick);
|
||||
//
|
||||
// closeDevToolsMenuItem
|
||||
//
|
||||
this.closeDevToolsMenuItem.Enabled = false;
|
||||
this.closeDevToolsMenuItem.Name = "closeDevToolsMenuItem";
|
||||
this.closeDevToolsMenuItem.Size = new System.Drawing.Size(158, 22);
|
||||
this.closeDevToolsMenuItem.Text = "Close Dev Tools";
|
||||
this.closeDevToolsMenuItem.Click += new System.EventHandler(this.CloseDevToolsMenuItemClick);
|
||||
//
|
||||
// toolStripMenuItem3
|
||||
//
|
||||
|
||||
@@ -250,5 +250,15 @@ namespace CefSharp.WinForms.Example
|
||||
},
|
||||
TaskScheduler.FromCurrentSynchronizationContext());
|
||||
}
|
||||
|
||||
private void ShowDevToolsMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
browser.ShowDevTools();
|
||||
}
|
||||
|
||||
private void CloseDevToolsMenuItemClick(object sender, EventArgs e)
|
||||
{
|
||||
browser.CloseDevTools();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="Resources\nav_left_green.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -124,4 +125,11 @@
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\CefSharp.props" />
|
||||
<Import Project="$(SolutionDir)\CefSharp.Native.props" />
|
||||
<Import Project="..\packages\cef.redist.3.1750.1738\build\cef.redist.targets" Condition="Exists('..\packages\cef.redist.3.1750.1738\build\cef.redist.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\cef.redist.3.1750.1738\build\cef.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.3.1750.1738\build\cef.redist.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -4,11 +4,6 @@ using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("CefSharp.WinForms.Example")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: AssemblyCompany(AssemblyInfo.AssemblyCompany)]
|
||||
[assembly: AssemblyProduct(AssemblyInfo.AssemblyProduct)]
|
||||
[assembly: AssemblyCopyright(AssemblyInfo.AssemblyCopyright)]
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="cef.redist" version="3.1750.1738" targetFramework="net40" />
|
||||
</packages>
|
||||
@@ -18,7 +18,7 @@ namespace CefSharp.WinForms
|
||||
public string Title { get; set; }
|
||||
public bool IsLoading { get; private set; }
|
||||
public string TooltipText { get; private set; }
|
||||
public string Address { get; set; }
|
||||
public string Address { get; private set; }
|
||||
|
||||
public IDialogHandler DialogHandler { get; set; }
|
||||
public IJsDialogHandler JsDialogHandler { get; set; }
|
||||
@@ -249,21 +249,14 @@ namespace CefSharp.WinForms
|
||||
managedCefBrowserAdapter.StopFinding(clearSelection);
|
||||
}
|
||||
|
||||
void IWebBrowserInternal.ShowDevTools()
|
||||
public void ShowDevTools()
|
||||
{
|
||||
// TODO: Do something about this one.
|
||||
var devToolsUrl = managedCefBrowserAdapter.DevToolsUrl;
|
||||
throw new NotImplementedException("Implement when Cef upgraded to 1750.");
|
||||
managedCefBrowserAdapter.ShowDevTools();
|
||||
}
|
||||
|
||||
void IWebBrowserInternal.CloseDevTools()
|
||||
public void CloseDevTools()
|
||||
{
|
||||
throw new NotImplementedException("Implement when Cef upgraded to 1750.");
|
||||
}
|
||||
|
||||
public string DevToolsUrl
|
||||
{
|
||||
get { return managedCefBrowserAdapter.DevToolsUrl; }
|
||||
managedCefBrowserAdapter.CloseDevTools();
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
|
||||
@@ -129,6 +129,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CefSharp.BrowserSubprocess\CefSharp.BrowserSubprocess.csproj">
|
||||
@@ -156,22 +157,13 @@
|
||||
<Folder Include="Assets\Images\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<UnmanagedPlatform>x64</UnmanagedPlatform>
|
||||
<UnmanagedPlatform Condition="'$(Platform)'=='x86'">Win32</UnmanagedPlatform>
|
||||
</PropertyGroup>
|
||||
<!-- TODO: Extract this to an includable .props file, which we can then bundle with the CefSharp.Wpf NuGet package. -->
|
||||
<Target Name="AfterBuild">
|
||||
<ItemGroup>
|
||||
<CefBinaries Include="$(SolutionDir)CEF\$(UnmanagedPlatform)\*.*" />
|
||||
<LocaleFiles Include="$(SolutionDir)CEF\locales\*.*" />
|
||||
<!-- We only need the .exe and .pdb but I don't know how to express that easily with MSBuild... -->
|
||||
<SubProcessFiles Include="$(SolutionDir)\CefSharp.BrowserSubprocess\bin\$(Platform)\$(Configuration)\CefSharp.BrowserSubprocess.*" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(CefBinaries)" DestinationFolder="$(TargetDir)" />
|
||||
<Copy SourceFiles="@(LocaleFiles)" DestinationFolder="$(TargetDir)locales" />
|
||||
<Copy SourceFiles="@(SubProcessFiles)" DestinationFolder="$(TargetDir)" />
|
||||
</Target>
|
||||
<Import Project="$(SolutionDir)\CefSharp.props" />
|
||||
<Import Project="$(SolutionDir)\CefSharp.Native.props" />
|
||||
<Import Project="..\packages\cef.redist.3.1750.1738\build\cef.redist.targets" Condition="Exists('..\packages\cef.redist.3.1750.1738\build\cef.redist.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\cef.redist.3.1750.1738\build\cef.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.3.1750.1738\build\cef.redist.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -1,10 +1,13 @@
|
||||
using System.Reflection;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using CefSharp;
|
||||
|
||||
[assembly: AssemblyTitle("CefSharp.Wpf.Example")]
|
||||
[assembly: AssemblyCompany("The CefSharp Authors")]
|
||||
[assembly: AssemblyProduct("CefSharp")]
|
||||
[assembly: AssemblyCopyright("Copyright © The CefSharp Authors 2010-2014")]
|
||||
|
||||
[assembly: AssemblyVersion("3.29.0.0")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: AssemblyCompany(AssemblyInfo.AssemblyCompany)]
|
||||
[assembly: AssemblyProduct(AssemblyInfo.AssemblyProduct)]
|
||||
[assembly: AssemblyCopyright(AssemblyInfo.AssemblyCopyright)]
|
||||
[assembly: ComVisible(AssemblyInfo.ComVisible)]
|
||||
[assembly: AssemblyVersion(AssemblyInfo.AssemblyVersion)]
|
||||
[assembly: AssemblyFileVersion(AssemblyInfo.AssemblyFileVersion)]
|
||||
[assembly: CLSCompliant(AssemblyInfo.ClsCompliant)]
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="cef.redist" version="3.1750.1738" targetFramework="net40" />
|
||||
</packages>
|
||||
@@ -148,21 +148,7 @@ namespace CefSharp.Wpf
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Cef.IsInitialized &&
|
||||
!Cef.Initialize())
|
||||
{
|
||||
throw new InvalidOperationException("Cef::Initialize() failed");
|
||||
}
|
||||
|
||||
// TODO: Consider making the delay here configurable.
|
||||
tooltipTimer = new DispatcherTimer(
|
||||
TimeSpan.FromSeconds(0.5),
|
||||
DispatcherPriority.Render,
|
||||
OnTooltipTimerTick,
|
||||
Dispatcher
|
||||
);
|
||||
|
||||
managedCefBrowserAdapter.LoadUrl(newValue);
|
||||
Load(newValue);
|
||||
}
|
||||
|
||||
#endregion Address dependency property
|
||||
@@ -944,7 +930,21 @@ namespace CefSharp.Wpf
|
||||
|
||||
public void Load(string url)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
if (!Cef.IsInitialized &&
|
||||
!Cef.Initialize())
|
||||
{
|
||||
throw new InvalidOperationException("Cef::Initialize() failed");
|
||||
}
|
||||
|
||||
// TODO: Consider making the delay here configurable.
|
||||
tooltipTimer = new DispatcherTimer(
|
||||
TimeSpan.FromSeconds(0.5),
|
||||
DispatcherPriority.Render,
|
||||
OnTooltipTimerTick,
|
||||
Dispatcher
|
||||
);
|
||||
|
||||
managedCefBrowserAdapter.LoadUrl(url);
|
||||
}
|
||||
|
||||
public void LoadHtml(string html, string url)
|
||||
@@ -1051,21 +1051,14 @@ namespace CefSharp.Wpf
|
||||
});
|
||||
}
|
||||
|
||||
void IWebBrowserInternal.ShowDevTools()
|
||||
public void ShowDevTools()
|
||||
{
|
||||
// TODO: Do something about this one.
|
||||
var devToolsUrl = managedCefBrowserAdapter.DevToolsUrl;
|
||||
throw new NotImplementedException("Implement when Cef upgraded to 1750.");
|
||||
managedCefBrowserAdapter.ShowDevTools();
|
||||
}
|
||||
|
||||
void IWebBrowserInternal.CloseDevTools()
|
||||
public void CloseDevTools()
|
||||
{
|
||||
throw new NotImplementedException("Implement when Cef upgraded to 1750.");
|
||||
}
|
||||
|
||||
public string DevToolsUrl
|
||||
{
|
||||
get { return managedCefBrowserAdapter.DevToolsUrl; }
|
||||
managedCefBrowserAdapter.CloseDevTools();
|
||||
}
|
||||
|
||||
void IWebBrowserInternal.OnFrameLoadStart(string url, bool isMainFrame)
|
||||
|
||||
+13
-9
@@ -141,13 +141,12 @@ namespace CefSharp
|
||||
bool CanReload { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The address (URL) which the browser control is currently displaying. Can be set to a simplified URL
|
||||
/// (e.g. www.google.com) or a full URL (e.g. http://www.google.com). Will automatically be updated as the user
|
||||
/// navigates to another page (e.g. by clicking on a link).
|
||||
/// The address (URL) which the browser control is currently displaying.
|
||||
/// Will automatically be updated as the user navigates to another page (e.g. by clicking on a link).
|
||||
/// </summary>
|
||||
/// <remarks>In the WPF control, this property is implemented as a Dependency Property and fully supports data
|
||||
/// binding.</remarks>
|
||||
string Address { get; set; }
|
||||
string Address { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The title of the web page being currently displayed.
|
||||
@@ -169,11 +168,6 @@ namespace CefSharp
|
||||
/// binding.</remarks>
|
||||
double ZoomLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Url which can be loaded in a browser control to view the dev tools
|
||||
/// </summary>
|
||||
string DevToolsUrl { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Search for text within the current page.
|
||||
/// </summary>
|
||||
@@ -248,5 +242,15 @@ namespace CefSharp
|
||||
/// Opens a Print Dialog which if used (can be user cancelled) will print the browser contents.
|
||||
/// </summary>
|
||||
void Print();
|
||||
|
||||
/// <summary>
|
||||
/// Open developer tools in its own window.
|
||||
/// </summary>
|
||||
void ShowDevTools();
|
||||
|
||||
/// <summary>
|
||||
/// Explicitly close the developer tools window if one exists for this browser instance.
|
||||
/// </summary>
|
||||
void CloseDevTools();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,8 +13,6 @@ namespace CefSharp.Internals
|
||||
void SetNavState(bool canGoBack, bool canGoForward, bool canReload);
|
||||
void SetTitle(string title);
|
||||
void SetTooltipText(string tooltipText);
|
||||
void ShowDevTools();
|
||||
void CloseDevTools();
|
||||
|
||||
void OnFrameLoadStart(string url, bool isMainFrame);
|
||||
void OnFrameLoadEnd(string url, bool isMainFrame, int httpStatusCode);
|
||||
|
||||
@@ -33,8 +33,8 @@ namespace CefSharp
|
||||
public const bool ComVisible = false;
|
||||
public const string AssemblyCompany = "The CefSharp Authors";
|
||||
public const string AssemblyProduct = "CefSharp";
|
||||
public const string AssemblyVersion = "31.0.0.0";
|
||||
public const string AssemblyFileVersion = "31.0.0.0";
|
||||
public const string AssemblyVersion = "33.0.0.0";
|
||||
public const string AssemblyFileVersion = "33.0.0.0";
|
||||
public const string AssemblyCopyright = "Copyright © The CefSharp Authors 2010-2014";
|
||||
public const string CefSharpCoreProject = "CefSharp.Core, PublicKey=" + PublicKey;
|
||||
public const string CefSharpBrowserSubprocessProject = "CefSharp.BrowserSubprocess, PublicKey=" + PublicKey;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<tags>chrome browser</tags>
|
||||
<copyright>Copyright © 2010-2014 The CefSharp Authors</copyright>
|
||||
<dependencies>
|
||||
<dependency id="cef.redist" version="[3.1650.1562-pre3,3.1651)" />
|
||||
<dependency id="cef.redist" version="[3.1750.1738, 3.1751)" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>CefSharp.WinForms</id>
|
||||
<version>$version$</version>
|
||||
<authors>The CefSharp Authors</authors>
|
||||
<owners>The CefSharp Authors</owners>
|
||||
<projectUrl>https://github.com/cefsharp/cefsharp</projectUrl>
|
||||
<licenseUrl>https://raw.github.com/cefsharp/CefSharp/master/LICENSE</licenseUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>The CefSharp Chromium-based browser component (WinForms control).</description>
|
||||
<tags>winforms chrome browser</tags>
|
||||
<copyright>Copyright © 2010-2014 The CefSharp Authors</copyright>
|
||||
<dependencies>
|
||||
<dependency id="CefSharp.Common" version="[$version$]" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<!-- Cannot put these inside lib\net40 etc, since there are both x86 and x64 versions which we must distinguish between. We
|
||||
solve this using a .props file instead. -->
|
||||
<file src="..\CefSharp.WinForms\bin\x86\Release\CefSharp.WinForms.dll" target="CefSharp\x86" />
|
||||
<file src="..\CefSharp.WinForms\bin\x64\Release\CefSharp.WinForms.dll" target="CefSharp\x64" />
|
||||
|
||||
<file src="CefSharp.WinForms.props" target="build" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -1,6 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Reference Include="$(MSBuildThisFileDirectory)..\lib\net40\CefSharp.WinForms.dll" />
|
||||
<Reference Condition="'$(Platform)' == 'x86'"
|
||||
Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.WinForms.dll" />
|
||||
|
||||
<Reference Condition="'$(Platform)' == 'x64'"
|
||||
Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\CefSharp.WinForms.dll" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
+4
-19
@@ -1,19 +1,4 @@
|
||||
if "%APPVEYOR_BUILD_NUMBER%"=="" (
|
||||
set APPVEYOR_BUILD_NUMBER=10000
|
||||
)
|
||||
|
||||
set version=31.0.0-JSWIP-PRE-%APPVEYOR_BUILD_NUMBER%
|
||||
REM set platform=x86
|
||||
|
||||
if "%platform%"=="x64" (
|
||||
set DotPlatform=.x64
|
||||
set CPlatform=x64
|
||||
) else (
|
||||
set Platform=x86
|
||||
set DotPlatform=.x86
|
||||
set CPlatform=Win32
|
||||
)
|
||||
|
||||
NuGet pack CefSharp.Common.nuspec -NoPackageAnalysis -Version %version% -Properties DotPlatform=%DotPlatform%;Platform=%Platform%;CPlatform=%CPlatform%
|
||||
NuGet pack CefSharp.WpfOrWinForms.nuspec -NoPackageAnalysis -Version %version% -Properties ControlType=Wpf;DotPlatform=%DotPlatform%;Platform=%Platform%
|
||||
NuGet pack CefSharp.WpfOrWinForms.nuspec -NoPackageAnalysis -Version %version% -Properties ControlType=WinForms;DotPlatform=%DotPlatform%;Platform=%Platform%
|
||||
set version=33.0.0-pre2
|
||||
NuGet pack CefSharp.Common.nuspec -NoPackageAnalysis -Version %version%
|
||||
NuGet pack CefSharp.Wpf.nuspec -NoPackageAnalysis -Version %version%
|
||||
NuGet pack CefSharp.WinForms.nuspec -NoPackageAnalysis -Version %version%
|
||||
|
||||
@@ -0,0 +1,246 @@
|
||||
param(
|
||||
[ValidateSet("vs2013", "vs2012", "nupkg", "nupkg-only")]
|
||||
[Parameter(Position = 0)]
|
||||
[string] $Target = "nupkg",
|
||||
[Parameter(Position = 1)]
|
||||
[string] $Version = "33.0.0-pre2"
|
||||
)
|
||||
|
||||
$WorkingDir = split-path -parent $MyInvocation.MyCommand.Definition
|
||||
|
||||
$CefSln = Join-Path $WorkingDir 'CefSharp3.sln'
|
||||
|
||||
# https://github.com/jbake/Powershell_scripts/blob/master/Invoke-BatchFile.ps1
|
||||
function Invoke-BatchFile
|
||||
{
|
||||
param(
|
||||
[Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true)]
|
||||
[string]$Path,
|
||||
[Parameter(Position = 1, Mandatory = $true, ValueFromPipeline = $true)]
|
||||
[string]$Parameters
|
||||
)
|
||||
|
||||
$tempFile = [IO.Path]::GetTempFileName()
|
||||
|
||||
cmd.exe /c " `"$Path`" $Parameters && set > `"$tempFile`" "
|
||||
|
||||
Get-Content $tempFile | Foreach-Object {
|
||||
if ($_ -match "^(.*?)=(.*)$")
|
||||
{
|
||||
Set-Content "env:\$($matches[1])" $matches[2]
|
||||
}
|
||||
}
|
||||
|
||||
Remove-Item $tempFile
|
||||
}
|
||||
|
||||
function Write-Diagnostic
|
||||
{
|
||||
param(
|
||||
[Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true)]
|
||||
[string] $Message
|
||||
)
|
||||
|
||||
Write-Host
|
||||
Write-Host $Message -ForegroundColor Green
|
||||
Write-Host
|
||||
}
|
||||
|
||||
function Die
|
||||
{
|
||||
param(
|
||||
[Parameter(Position = 0, ValueFromPipeline = $true)]
|
||||
[string] $Message
|
||||
)
|
||||
|
||||
Write-Host
|
||||
Write-Error $Message
|
||||
exit 1
|
||||
}
|
||||
|
||||
function Warn
|
||||
{
|
||||
param(
|
||||
[Parameter(Position = 0, ValueFromPipeline = $true)]
|
||||
[string] $Message
|
||||
)
|
||||
|
||||
Write-Host
|
||||
Write-Host $Message -ForegroundColor Yellow
|
||||
Write-Host
|
||||
}
|
||||
|
||||
function TernaryReturn
|
||||
{
|
||||
param(
|
||||
[Parameter(Position = 0, ValueFromPipeline = $true)]
|
||||
[bool] $Yes,
|
||||
[Parameter(Position = 1, ValueFromPipeline = $true)]
|
||||
$Value,
|
||||
[Parameter(Position = 2, ValueFromPipeline = $true)]
|
||||
$Value2
|
||||
)
|
||||
|
||||
if($Yes) {
|
||||
return $Value
|
||||
}
|
||||
|
||||
$Value2
|
||||
}
|
||||
|
||||
function Msvs
|
||||
{
|
||||
param(
|
||||
[ValidateSet('v110', 'v120')]
|
||||
[Parameter(Position = 0, ValueFromPipeline = $true)]
|
||||
[string] $Toolchain,
|
||||
|
||||
[Parameter(Position = 1, ValueFromPipeline = $true)]
|
||||
[ValidateSet('Debug', 'Release')]
|
||||
[string] $Configuration,
|
||||
|
||||
[Parameter(Position = 2, ValueFromPipeline = $true)]
|
||||
[ValidateSet('x86', 'x64')]
|
||||
[string] $Platform
|
||||
)
|
||||
|
||||
Write-Diagnostic "Targeting $Toolchain using configuration $Configuration on platform $Platform"
|
||||
|
||||
$VisualStudioVersion = $null
|
||||
$VXXCommonTools = $null
|
||||
|
||||
switch -Exact ($Toolchain) {
|
||||
'v110' {
|
||||
$VisualStudioVersion = '11.0'
|
||||
$VXXCommonTools = Join-Path $env:VS110COMNTOOLS '..\..\vc'
|
||||
}
|
||||
'v120' {
|
||||
$VisualStudioVersion = '12.0'
|
||||
$VXXCommonTools = Join-Path $env:VS120COMNTOOLS '..\..\vc'
|
||||
}
|
||||
}
|
||||
|
||||
if ($VXXCommonTools -eq $null -or (-not (Test-Path($VXXCommonTools)))) {
|
||||
Die 'Error unable to find any visual studio environment'
|
||||
}
|
||||
|
||||
$VCVarsAll = Join-Path $VXXCommonTools vcvarsall.bat
|
||||
if (-not (Test-Path $VCVarsAll)) {
|
||||
Die "Unable to find $VCVarsAll"
|
||||
}
|
||||
|
||||
# Only configure build environment once
|
||||
if($env:CEFSHARP_BUILD_IS_BOOTSTRAPPED -eq $null) {
|
||||
Invoke-BatchFile $VCVarsAll $Platform
|
||||
$env:CEFSHARP_BUILD_IS_BOOTSTRAPPED = $true
|
||||
}
|
||||
|
||||
$Arch = TernaryReturn ($Platform -eq 'x64') 'x64' 'win32'
|
||||
|
||||
$Arguments = @(
|
||||
"$CefSln",
|
||||
"/t:rebuild",
|
||||
"/p:VisualStudioVersion=$VisualStudioVersion",
|
||||
"/p:Configuration=$Configuration",
|
||||
"/p:Platform=$Arch"
|
||||
)
|
||||
|
||||
$StartInfo = New-Object System.Diagnostics.ProcessStartInfo
|
||||
$StartInfo.FileName = "msbuild.exe"
|
||||
$StartInfo.Arguments = $Arguments
|
||||
|
||||
$StartInfo.EnvironmentVariables.Clear()
|
||||
|
||||
Get-ChildItem -Path env:* | ForEach-Object {
|
||||
$StartInfo.EnvironmentVariables.Add($_.Name, $_.Value)
|
||||
}
|
||||
|
||||
$StartInfo.UseShellExecute = $false
|
||||
$StartInfo.CreateNoWindow = $false
|
||||
|
||||
$Process = New-Object System.Diagnostics.Process
|
||||
$Process.StartInfo = $startInfo
|
||||
$Process.Start()
|
||||
$Process.WaitForExit()
|
||||
|
||||
if($Process.ExitCode -ne 0) {
|
||||
Die "Build failed"
|
||||
}
|
||||
}
|
||||
|
||||
function VSX
|
||||
{
|
||||
param(
|
||||
[ValidateSet('v110', 'v120')]
|
||||
[Parameter(Position = 0, ValueFromPipeline = $true)]
|
||||
[string] $Toolchain
|
||||
)
|
||||
|
||||
if($Toolchain -eq 'v120' -and $env:VS120COMNTOOLS -eq $null) {
|
||||
Warn "Toolchain $Toolchain is not installed on your development machine, skipping build."
|
||||
Return
|
||||
}
|
||||
|
||||
if($Toolchain -eq 'v110' -and $env:VS110COMNTOOLS -eq $null) {
|
||||
Warn "Toolchain $Toolchain is not installed on your development machine, skipping build."
|
||||
Return
|
||||
}
|
||||
|
||||
Write-Diagnostic "Starting to build targeting toolchain $Toolchain"
|
||||
|
||||
Msvs "$Toolchain" 'Release' 'x86'
|
||||
Msvs "$Toolchain" 'Release' 'x64'
|
||||
|
||||
Write-Diagnostic "Finished build targeting toolchain $Toolchain"
|
||||
}
|
||||
|
||||
function NugetPackageRestore
|
||||
{
|
||||
$nuget = Join-Path $env:LOCALAPPDATA .\nuget\NuGet.exe
|
||||
if(-not (Test-Path $nuget)) {
|
||||
Die "Please install nuget. More information available at: http://docs.nuget.org/docs/start-here/installing-nuget"
|
||||
}
|
||||
|
||||
Write-Diagnostic "Restore Nuget Packages"
|
||||
|
||||
# Restore packages
|
||||
. $nuget restore $CefSln
|
||||
}
|
||||
|
||||
function Nupkg
|
||||
{
|
||||
$nuget = Join-Path $env:LOCALAPPDATA .\nuget\NuGet.exe
|
||||
if(-not (Test-Path $nuget)) {
|
||||
Die "Please install nuget. More information available at: http://docs.nuget.org/docs/start-here/installing-nuget"
|
||||
}
|
||||
|
||||
Write-Diagnostic "Building nuget package"
|
||||
|
||||
# Build packages
|
||||
. $nuget pack nuget\CefSharp.Common.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget
|
||||
. $nuget pack nuget\CefSharp.Wpf.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget
|
||||
. $nuget pack nuget\CefSharp.WinForms.nuspec -NoPackageAnalysis -Version $Version -OutputDirectory nuget
|
||||
}
|
||||
|
||||
NugetPackageRestore
|
||||
|
||||
switch -Exact ($Target) {
|
||||
"nupkg"
|
||||
{
|
||||
VSX v120
|
||||
#VSX v110
|
||||
Nupkg
|
||||
}
|
||||
"nupkg-only"
|
||||
{
|
||||
Nupkg
|
||||
}
|
||||
"vs2013"
|
||||
{
|
||||
VSX v120
|
||||
}
|
||||
"vs2012"
|
||||
{
|
||||
VSX v110
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user