Skip to content

Commit

Permalink
support for .Net Core 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JBildstein committed Nov 20, 2019
1 parent ce3b657 commit 5dedfca
Show file tree
Hide file tree
Showing 215 changed files with 698 additions and 609 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -263,5 +263,8 @@ __pycache__/
# macOS
.DS_Store

# NuGet publish folder
Publish

# Angular publish folder from examples
dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Shared\SpiderEye.Example.Simple.Shared.proj" />

<ItemGroup>
<ProjectReference Include="..\..\..\Source\SpiderEye.Linux\SpiderEye.Linux.csproj" />
</ItemGroup>
</Project>
7 changes: 7 additions & 0 deletions Examples/Simple/App.Mac/SpiderEye.Example.Simple.Mac.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Shared\SpiderEye.Example.Simple.Shared.proj" />

<ItemGroup>
<ProjectReference Include="..\..\..\Source\SpiderEye.Mac\SpiderEye.Mac.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Import Project="..\Shared\SpiderEye.Example.Simple.Shared.proj" />

<PropertyGroup>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\Source\SpiderEye.Windows\SpiderEye.Windows.csproj" />
</ItemGroup>
</Project>
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ class Program
[STAThread]
public static void Main(string[] args)
{
// Note: Program.cs is shared between all projects for convenience.
// You could just as well have a separate startup logic for each platform.

// this creates a new app configuration with default values
var config = new WindowConfiguration();

// this relates to the path defined in the .csproj file
// this relates to the path defined in the shared .proj file
config.ContentFolder = "App";

// runs the application and opens a window with the given page loaded
Expand Down
18 changes: 18 additions & 0 deletions Examples/Simple/Shared/SpiderEye.Example.Simple.Shared.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\Shared\Program.cs" Link="Program.cs" />
</ItemGroup>

<ItemGroup>
<!-- The App folder is where all our html, css, js, etc. files are -->
<EmbeddedResource Include="..\Shared\App\**" Link="App\%(Filename)%(Extension)">
<!-- this retains the original filename of the embedded files (required to located them later) -->
<LogicalName>App\%(RecursiveDir)%(Filename)%(Extension)</LogicalName>
</EmbeddedResource>
</ItemGroup>
</Project>
30 changes: 30 additions & 0 deletions Examples/Simple/Shared/publish.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@ECHO OFF
SETLOCAL

CD ..
CALL :PublishProject Windows win-x64
IF %ERRORLEVEL% NEQ 0 (
ECHO Publish failed
EXIT /B 1
)

CALL :PublishProject Linux linux-x64
IF %ERRORLEVEL% NEQ 0 (
ECHO Publish failed
EXIT /B 1
)

CALL :PublishProject Mac osx-x64
IF %ERRORLEVEL% NEQ 0 (
ECHO Publish failed
EXIT /B 1
)

ECHO Done!

EXIT /B 0

:PublishProject
ECHO Publishing for %1...
CALL dotnet publish App.%1\SpiderEye.Example.Simple.%1.csproj -c Release -f netcoreapp3.0 -r %2 -o Publish/%1 > NUL
EXIT /B
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
7 changes: 7 additions & 0 deletions Examples/Spa/App.Linux/SpiderEye.Example.Spa.Linux.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Shared\SpiderEye.Example.Spa.Shared.proj" />

<ItemGroup>
<ProjectReference Include="..\..\..\Source\SpiderEye.Linux\SpiderEye.Linux.csproj" />
</ItemGroup>
</Project>
File renamed without changes.
7 changes: 7 additions & 0 deletions Examples/Spa/App.Mac/SpiderEye.Example.Spa.Mac.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Shared\SpiderEye.Example.Spa.Shared.proj" />

<ItemGroup>
<ProjectReference Include="..\..\..\Source\SpiderEye.Mac\SpiderEye.Mac.csproj" />
</ItemGroup>
</Project>
File renamed without changes.
12 changes: 12 additions & 0 deletions Examples/Spa/App.Windows/SpiderEye.Example.Spa.Windows.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Import Project="..\Shared\SpiderEye.Example.Spa.Shared.proj" />

<PropertyGroup>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>Icons\icon.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\Source\SpiderEye.Windows\SpiderEye.Windows.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export class AppComponent implements OnInit {
openMessageBox() {
this.messageBoxResult = null;

var box = new MessageBox();
box.title = "Hello World";
box.message = "Hello World from the Webview";
const box = new MessageBox();
box.title = 'Hello World';
box.message = 'Hello World from the Webview';
box.buttons = MessageBoxButtons.OkCancel;

box.show(result => this.messageBoxResult = result);
Expand All @@ -42,30 +42,30 @@ export class AppComponent implements OnInit {
openSaveFileDialog() {
this.saveFileResult = null;

var dialog = new SaveFileDialog();
dialog.title = "Hello World";
const dialog = new SaveFileDialog();
dialog.title = 'Hello World';

dialog.show(result => this.saveFileResult = result);
}

openOpenFileDialog() {
this.openFileResult = null;

var dialog = new OpenFileDialog();
dialog.title = "Hello World";
const dialog = new OpenFileDialog();
dialog.title = 'Hello World';

dialog.show(result => this.openFileResult = result);
}

openWindow() {
var browserWindow = new BrowserWindow({
title: "Hello World",
backgroundColor: "#FFFFFF",
const browserWindow = new BrowserWindow({
title: 'Hello World',
backgroundColor: '#FFFFFF',
canResize: true,
width: 900,
height: 600,
useBrowserTitle: true,
url: "/index.html"
url: '/index.html'
});

browserWindow.show();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions Examples/Spa/Client/DummyMarker.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace SpiderEye.Example.Spa.Client
{
/// <summary>
/// This is just a marker to easily get a reference to this library.
/// Like so: typeof(DummyMarker).Assembly
/// </summary>
public sealed class DummyMarker
{
}
}
19 changes: 19 additions & 0 deletions Examples/Spa/Client/SpiderEye.Example.Spa.Client.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TypeScriptCompileBlocked>True</TypeScriptCompileBlocked>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<Compile Remove="node_modules\**" />
<None Remove="node_modules\**" />
</ItemGroup>

<ItemGroup>
<!-- The dist folder is where compiled Angular files are -->
<EmbeddedResource Include="Angular\dist\**">
<!-- this retains the original filename of the embedded files (required to located them later) -->
<LogicalName>%(RelativeDir)%(Filename)%(Extension)</LogicalName>
</EmbeddedResource>
</ItemGroup>
</Project>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Diagnostics;
using SpiderEye.Example.Spa.Client;
using SpiderEye.UI;

namespace SpiderEye.Example.Spa
Expand All @@ -9,11 +10,16 @@ class Program
[STAThread]
public static void Main(string[] args)
{
// Note: Program.cs is shared between all projects for convenience.
// You could just as well have a separate startup logic for each platform.

// this creates a new configuration with default values
var config = new WindowConfiguration();
var icon = AppIcon.FromFile("icon", "Icons");

// this relates to the path defined in the .csproj file
// we have a separate assembly for the client side files
config.ContentAssembly = typeof(DummyMarker).Assembly;
// this relates to the path defined in the client .csproj file
config.ContentFolder = "Angular\\dist";
config.Icon = icon;

Expand Down
20 changes: 20 additions & 0 deletions Examples/Spa/Shared/SpiderEye.Example.Spa.Shared.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<None Update="Icons\**\*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<Compile Include="..\Shared\Program.cs" Link="Program.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Client\SpiderEye.Example.Spa.Client.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@ECHO OFF
SETLOCAL

CD ..\Client
ECHO Linting files...
CALL npm run lint > NUL
IF %ERRORLEVEL% NEQ 0 (
Expand All @@ -14,22 +16,20 @@ IF %ERRORLEVEL% NEQ 0 (
EXIT /B 1
)

ECHO Publishing for Windows...
CALL dotnet publish -c Release -f net462 -r win -o ./bin/Publish/Windows > NUL
CD ..
CALL :PublishProject Windows win-x64
IF %ERRORLEVEL% NEQ 0 (
ECHO Publish failed
EXIT /B 1
)

ECHO Publishing for Linux...
CALL dotnet publish -c Release -f netcoreapp2.2 -r linux-x64 -o ./bin/Publish/Linux > NUL
CALL :PublishProject Linux linux-x64
IF %ERRORLEVEL% NEQ 0 (
ECHO Publish failed
EXIT /B 1
)

ECHO Publishing for Mac...
CALL dotnet publish -c Release -f netcoreapp2.2 -r osx.10.13-x64 -o ./bin/Publish/Mac > NUL
CALL :PublishProject Mac osx-x64
IF %ERRORLEVEL% NEQ 0 (
ECHO Publish failed
EXIT /B 1
Expand All @@ -38,3 +38,8 @@ IF %ERRORLEVEL% NEQ 0 (
ECHO Done!

EXIT /B 0

:PublishProject
ECHO Publishing for %1...
CALL dotnet publish App.%1\SpiderEye.Example.Spa.%1.csproj -c Release -f netcoreapp3.0 -r %2 -o Publish/%1 > NUL
EXIT /B
17 changes: 0 additions & 17 deletions Examples/SpiderEye.Example.Simple/SpiderEye.Example.Simple.csproj

This file was deleted.

26 changes: 0 additions & 26 deletions Examples/SpiderEye.Example.Simple/publish.bat

This file was deleted.

30 changes: 0 additions & 30 deletions Examples/SpiderEye.Example.Spa/SpiderEye.Example.Spa.csproj

This file was deleted.

Loading

0 comments on commit 5dedfca

Please sign in to comment.