Skip to content

Commit

Permalink
Merge pull request #41 from cwensley/console-integration
Browse files Browse the repository at this point in the history
Move PabloDraw.Console functionality over to PabloDraw directly
  • Loading branch information
cwensley authored Dec 5, 2021
2 parents d34c2d1 + 1570347 commit db26da8
Show file tree
Hide file tree
Showing 34 changed files with 688 additions and 932 deletions.
20 changes: 2 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: dotnet publish Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-windows.binlog

- name: Build PabloDraw.Console
run: dotnet publish Source/PabloDraw.Console/PabloDraw.Console.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw.console-windows.binlog
run: dotnet publish Source/PabloDraw.Console/PabloDraw.Console.cxproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw.console-windows.binlog

- uses: actions/upload-artifact@v2
with:
Expand All @@ -36,7 +36,7 @@ jobs:
- uses: actions/upload-artifact@v2
with:
name: pablodraw-windows-x64
path: artifacts/bin/PabloDraw.Console/${{ env.BuildConfiguration }}/net6.0-windows/win-x64/publish/*
path: artifacts/bin/PabloDraw.Console/x64/${{ env.BuildConfiguration }}/*

- name: Upload log files
if: ${{ failure() }}
Expand All @@ -57,19 +57,11 @@ jobs:
- name: Build PabloDraw
run: dotnet publish Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-linux.binlog

- name: Build PabloDraw.Console
run: dotnet publish Source/PabloDraw.Console/PabloDraw.Console.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw.console-linux.binlog

- uses: actions/upload-artifact@v2
with:
name: pablodraw-linux-x64
path: artifacts/bin/PabloDraw/${{ env.BuildConfiguration }}/net6.0/linux-x64/publish/*

- uses: actions/upload-artifact@v2
with:
name: pablodraw-linux-x64
path: artifacts/bin/PabloDraw.Console/${{ env.BuildConfiguration }}/net6.0/linux-x64/publish/*

- name: Upload log files
if: ${{ failure() }}
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -112,19 +104,11 @@ jobs:
- name: Build PabloDraw
run: dotnet build Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-mac.binlog

- name: Build PabloDraw.Console
run: dotnet publish Source/PabloDraw.Console/PabloDraw.Console.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw.console-mac.binlog

- uses: actions/upload-artifact@v2
with:
name: pablodraw-mac
path: artifacts/bin/PabloDraw/${{ env.BuildConfiguration }}/net6.0/PabloDraw.dmg

- uses: actions/upload-artifact@v2
with:
name: pablodraw-mac
path: artifacts/bin/PabloDraw.Console/${{ env.BuildConfiguration }}/net6.0/osx-x64/publish/PabloDraw.Console

- name: Upload log files
if: ${{ failure() }}
uses: actions/upload-artifact@v2
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ obj/
.svn
UpgradeLog.htm
.vs
compile_commands.json
.cache
34 changes: 34 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"configurations": [
{
"name": "Mac",
"includePath": [
],
"defines": [
"MACOS"
],
"intelliSenseMode": "clang-x64",
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "c++17",
"browse": {
"limitSymbolsToIncludedHeaders": false
}
},
{
"name": "Win32",
"includePath": [
],
"defines": [
"WINDOWS"
],
"intelliSenseMode": "msvc-x64",
"cStandard": "c11",
"cppStandard": "c++17",
"browse": {
"limitSymbolsToIncludedHeaders": false
}
}
],
"version": 4
}
32 changes: 30 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,43 @@
"program": "${workspaceFolder}/artifacts/bin/PabloDraw/${config:var.BuildConfiguration}/net6.0/PabloDraw.app/Contents/MacOS/PabloDraw",
},
"windows": {
"program": "${workspaceFolder}/artifacts/bin/PabloDraw/${config:var.BuildConfiguration}/net6.0-windows/win-x64/PabloDraw.dll",
"program": "${workspaceFolder}/artifacts/bin/PabloDraw/${config:var.BuildConfiguration}/net6.0-windows/win-x64/PabloDraw.exe",
},
"linux": {
"program": "${workspaceFolder}/artifacts/bin/PabloDraw/${config:var.BuildConfiguration}/net6.0/linux-x64/PabloDraw.dll",
},
"args": [],
"args": [
// "--help"
// "${workspaceFolder}/Source/README.ans", "${workspaceFolder}/artifacts/convert/README.png"
],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"console": "internalConsole"
},
{
"name": "PabloDraw.Console",
"type": "cppdbg",
"request": "launch",
"preLaunchTask": "build-pablodraw-console",
"program": "${workspaceRoot}/artifacts/bin/PabloDraw.Console/x64/Debug/PabloDraw.Console",
"MIMode": "lldb",
"cwd": ".",
"args": [
"--help"
// "${workspaceFolder}/Source/README.ans", "${workspaceFolder}/artifacts/convert/README.png"
],
},
{
"name": "PabloDraw.Console-windows",
"type": "cppvsdbg",
"request": "launch",
"preLaunchTask": "build-pablodraw-console",
"program": "${workspaceRoot}/artifacts/bin/PabloDraw.Console/x64/Debug/PabloDraw.Console.exe",
"cwd": ".",
"args": [
"--help"
// "${workspaceFolder}/Source/README.ans", "${workspaceFolder}/artifacts/convert/README.png"
],
}
]
}
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@
],
"var": {
"BuildConfiguration": "Debug"
}
},
"files.associations": {
"chrono": "cpp",
"filesystem": "cpp",
"string": "cpp"
},
"clangd.path": "clangd"
}
36 changes: 18 additions & 18 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@
},
"problemMatcher": "$msCompile"
},
{
"label": "build-pablodraw-console",
"command": "dotnet",
"type": "shell",
"args": [
"build",
"${workspaceFolder}/Source/PabloDraw.Console/PabloDraw.Console.cxproj",
// "/p:BuildTarget=Linux",
"/p:Configuration=${config:var.BuildConfiguration}",
"/p:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"group": "build",
"presentation": {
"clear": true
},
"problemMatcher": "$msCompile"
},
{
"label": "build-pablodraw",
"command": "dotnet",
Expand Down Expand Up @@ -87,24 +105,6 @@
"clear": true
},
"problemMatcher": "$msCompile"
},
{
"label": "build-pablodraw-console",
"command": "dotnet",
"type": "shell",
"args": [
"publish",
"${workspaceFolder}/Source/PabloDraw.Console/PabloDraw.Console.csproj",
// "/p:BuildTarget=Linux",
"/p:Configuration=${config:var.BuildConfiguration}",
"/p:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"group": "build",
"presentation": {
"clear": true
},
"problemMatcher": "$msCompile"
}
]
}
50 changes: 38 additions & 12 deletions Source/Pablo Desktop.sln
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29424.173
# Visual Studio Version 17
VisualStudioVersion = 17.0.31919.166
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PabloDraw", "PabloDraw\PabloDraw.csproj", "{9A72B697-8DA3-4A52-9E6B-05DEEEA23AD2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pablo", "Pablo\Pablo.csproj", "{35DBE6BB-B46D-4AE9-8156-FBFC6EC2BB69}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pablo.Interface", "Pablo.Interface\Pablo.Interface.csproj", "{3FAACC7E-D156-4599-B0D1-6177AD78E8B1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PabloDraw.Console", "PabloDraw.Console\PabloDraw.Console.csproj", "{0457895A-719B-47E9-84F3-356B2A1F8D3C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{88CCB819-8E11-429C-94D7-D5A27A671129}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
Expand All @@ -24,47 +22,75 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mac = Debug|Mac
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mac = Release|Mac
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9A72B697-8DA3-4A52-9E6B-05DEEEA23AD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9A72B697-8DA3-4A52-9E6B-05DEEEA23AD2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9A72B697-8DA3-4A52-9E6B-05DEEEA23AD2}.Debug|Mac.ActiveCfg = Debug|Any CPU
{9A72B697-8DA3-4A52-9E6B-05DEEEA23AD2}.Debug|Mac.Build.0 = Debug|Any CPU
{9A72B697-8DA3-4A52-9E6B-05DEEEA23AD2}.Debug|x64.ActiveCfg = Debug|Any CPU
{9A72B697-8DA3-4A52-9E6B-05DEEEA23AD2}.Debug|x64.Build.0 = Debug|Any CPU
{9A72B697-8DA3-4A52-9E6B-05DEEEA23AD2}.Debug|x86.ActiveCfg = Debug|Any CPU
{9A72B697-8DA3-4A52-9E6B-05DEEEA23AD2}.Debug|x86.Build.0 = Debug|Any CPU
{9A72B697-8DA3-4A52-9E6B-05DEEEA23AD2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9A72B697-8DA3-4A52-9E6B-05DEEEA23AD2}.Release|Any CPU.Build.0 = Release|Any CPU
{9A72B697-8DA3-4A52-9E6B-05DEEEA23AD2}.Release|Mac.ActiveCfg = Release|Any CPU
{9A72B697-8DA3-4A52-9E6B-05DEEEA23AD2}.Release|Mac.Build.0 = Release|Any CPU
{9A72B697-8DA3-4A52-9E6B-05DEEEA23AD2}.Release|x64.ActiveCfg = Release|Any CPU
{9A72B697-8DA3-4A52-9E6B-05DEEEA23AD2}.Release|x64.Build.0 = Release|Any CPU
{9A72B697-8DA3-4A52-9E6B-05DEEEA23AD2}.Release|x86.ActiveCfg = Release|Any CPU
{9A72B697-8DA3-4A52-9E6B-05DEEEA23AD2}.Release|x86.Build.0 = Release|Any CPU
{35DBE6BB-B46D-4AE9-8156-FBFC6EC2BB69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35DBE6BB-B46D-4AE9-8156-FBFC6EC2BB69}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35DBE6BB-B46D-4AE9-8156-FBFC6EC2BB69}.Debug|Mac.ActiveCfg = Debug|Any CPU
{35DBE6BB-B46D-4AE9-8156-FBFC6EC2BB69}.Debug|Mac.Build.0 = Debug|Any CPU
{35DBE6BB-B46D-4AE9-8156-FBFC6EC2BB69}.Debug|x64.ActiveCfg = Debug|Any CPU
{35DBE6BB-B46D-4AE9-8156-FBFC6EC2BB69}.Debug|x64.Build.0 = Debug|Any CPU
{35DBE6BB-B46D-4AE9-8156-FBFC6EC2BB69}.Debug|x86.ActiveCfg = Debug|Any CPU
{35DBE6BB-B46D-4AE9-8156-FBFC6EC2BB69}.Debug|x86.Build.0 = Debug|Any CPU
{35DBE6BB-B46D-4AE9-8156-FBFC6EC2BB69}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35DBE6BB-B46D-4AE9-8156-FBFC6EC2BB69}.Release|Any CPU.Build.0 = Release|Any CPU
{35DBE6BB-B46D-4AE9-8156-FBFC6EC2BB69}.Release|Mac.ActiveCfg = Release|Any CPU
{35DBE6BB-B46D-4AE9-8156-FBFC6EC2BB69}.Release|Mac.Build.0 = Release|Any CPU
{35DBE6BB-B46D-4AE9-8156-FBFC6EC2BB69}.Release|x64.ActiveCfg = Release|Any CPU
{35DBE6BB-B46D-4AE9-8156-FBFC6EC2BB69}.Release|x64.Build.0 = Release|Any CPU
{35DBE6BB-B46D-4AE9-8156-FBFC6EC2BB69}.Release|x86.ActiveCfg = Release|Any CPU
{35DBE6BB-B46D-4AE9-8156-FBFC6EC2BB69}.Release|x86.Build.0 = Release|Any CPU
{3FAACC7E-D156-4599-B0D1-6177AD78E8B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3FAACC7E-D156-4599-B0D1-6177AD78E8B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3FAACC7E-D156-4599-B0D1-6177AD78E8B1}.Debug|Mac.ActiveCfg = Debug|Any CPU
{3FAACC7E-D156-4599-B0D1-6177AD78E8B1}.Debug|Mac.Build.0 = Debug|Any CPU
{3FAACC7E-D156-4599-B0D1-6177AD78E8B1}.Debug|x64.ActiveCfg = Debug|Any CPU
{3FAACC7E-D156-4599-B0D1-6177AD78E8B1}.Debug|x64.Build.0 = Debug|Any CPU
{3FAACC7E-D156-4599-B0D1-6177AD78E8B1}.Debug|x86.ActiveCfg = Debug|Any CPU
{3FAACC7E-D156-4599-B0D1-6177AD78E8B1}.Debug|x86.Build.0 = Debug|Any CPU
{3FAACC7E-D156-4599-B0D1-6177AD78E8B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3FAACC7E-D156-4599-B0D1-6177AD78E8B1}.Release|Any CPU.Build.0 = Release|Any CPU
{3FAACC7E-D156-4599-B0D1-6177AD78E8B1}.Release|Mac.ActiveCfg = Release|Any CPU
{3FAACC7E-D156-4599-B0D1-6177AD78E8B1}.Release|Mac.Build.0 = Release|Any CPU
{0457895A-719B-47E9-84F3-356B2A1F8D3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0457895A-719B-47E9-84F3-356B2A1F8D3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0457895A-719B-47E9-84F3-356B2A1F8D3C}.Debug|Mac.ActiveCfg = Debug|Any CPU
{0457895A-719B-47E9-84F3-356B2A1F8D3C}.Debug|Mac.Build.0 = Debug|Any CPU
{0457895A-719B-47E9-84F3-356B2A1F8D3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0457895A-719B-47E9-84F3-356B2A1F8D3C}.Release|Any CPU.Build.0 = Release|Any CPU
{0457895A-719B-47E9-84F3-356B2A1F8D3C}.Release|Mac.ActiveCfg = Release|Any CPU
{0457895A-719B-47E9-84F3-356B2A1F8D3C}.Release|Mac.Build.0 = Release|Any CPU
{3FAACC7E-D156-4599-B0D1-6177AD78E8B1}.Release|x64.ActiveCfg = Release|Any CPU
{3FAACC7E-D156-4599-B0D1-6177AD78E8B1}.Release|x64.Build.0 = Release|Any CPU
{3FAACC7E-D156-4599-B0D1-6177AD78E8B1}.Release|x86.ActiveCfg = Release|Any CPU
{3FAACC7E-D156-4599-B0D1-6177AD78E8B1}.Release|x86.Build.0 = Release|Any CPU
{38A42F6D-A417-45B0-8EC8-A700F31CBE26}.Debug|Any CPU.ActiveCfg = Debug|x86
{38A42F6D-A417-45B0-8EC8-A700F31CBE26}.Debug|Mac.ActiveCfg = Debug|x86
{38A42F6D-A417-45B0-8EC8-A700F31CBE26}.Debug|x64.ActiveCfg = Debug|x86
{38A42F6D-A417-45B0-8EC8-A700F31CBE26}.Debug|x64.Build.0 = Debug|x86
{38A42F6D-A417-45B0-8EC8-A700F31CBE26}.Debug|x86.ActiveCfg = Debug|x86
{38A42F6D-A417-45B0-8EC8-A700F31CBE26}.Debug|x86.Build.0 = Debug|x86
{38A42F6D-A417-45B0-8EC8-A700F31CBE26}.Release|Any CPU.ActiveCfg = Release|x86
{38A42F6D-A417-45B0-8EC8-A700F31CBE26}.Release|Any CPU.Build.0 = Release|x86
{38A42F6D-A417-45B0-8EC8-A700F31CBE26}.Release|Mac.ActiveCfg = Release|x86
{38A42F6D-A417-45B0-8EC8-A700F31CBE26}.Release|x64.ActiveCfg = Release|x86
{38A42F6D-A417-45B0-8EC8-A700F31CBE26}.Release|x64.Build.0 = Release|x86
{38A42F6D-A417-45B0-8EC8-A700F31CBE26}.Release|x86.ActiveCfg = Release|x86
{38A42F6D-A417-45B0-8EC8-A700F31CBE26}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
13 changes: 8 additions & 5 deletions Source/Pablo/CommandLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Eto;

namespace Pablo
{
public class CommandLine
{
const string commandLineRegEx =
static string prefix => EtoEnvironment.Platform.IsWindows ? "((--)|-|/)" : "((--)|-)";

static string commandLineRegEx =>
@"(?<=^|\s)(
(((--)|-|/)(?<name>[^\s:=]+)((\s*:\s*)|(\s*=\s*)|(\s+(?=[^-])))
(" + prefix + @"(?<name>[^\s:=]+)((\s*:\s*)|(\s*=\s*)|(\s+(?=[^-])))
(([""""](?<value>(("""")|[^""])*)[""])|(?<value>[^\s]*))
|
([""""]((--)|-|/)(?<name>[^\s:=]+)((\s*:\s*)|(\s*=\s*)|(\s+(?=[^-])))
([""""]" + prefix + @"(?<name>[^\s:=]+)((\s*:\s*)|(\s*=\s*)|(\s+(?=[^-])))
(?<value>(("""")|[^""])*)[""]))
|
(((--)|-|/)(?<name>[^\s]+))
(" + prefix + @"(?<name>[^\s]+))
|
([""]((--)|-|/)(?<name>[^""]+)[""])
([""]" + prefix + @"(?<name>[^""]+)[""])
)";

const string topLevel = @"
Expand Down
Loading

0 comments on commit db26da8

Please sign in to comment.