-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GH2 template #20
Merged
Merged
Add GH2 template #20
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
Rhino.Templates/content/CSGrasshopper2/.template.config/dotnetcli.host.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/dotnetcli.host", | ||
"symbolInfo": { | ||
"IncludeSample": { | ||
"longName": "include-sample", | ||
"shortName": "sample" | ||
}, | ||
"RhinoVersion": { | ||
"longName": "version", | ||
"shortName": "v" | ||
}, | ||
"PlugInDisplayName": { | ||
"longName": "plugin-display-name", | ||
"shortName": "plugin-name" | ||
}, | ||
"ComponentClassName": { | ||
"longName": "component-class", | ||
"shortName": "component" | ||
}, | ||
"ComponentName": { | ||
"longName": "component-name", | ||
"shortName": "cname" | ||
}, | ||
"ComponentInfo": { | ||
"shortName": "info" | ||
}, | ||
"ComponentChapter": { | ||
"longName": "chapter", | ||
"shortName": "ch" | ||
}, | ||
"ComponentSection": { | ||
"longName": "section", | ||
"shortName": "sec" | ||
}, | ||
"UseWpf": { | ||
"longName": "include-wpf", | ||
"shortName": "wpf" | ||
}, | ||
"UseWinForms": { | ||
"longName": "include-winforms", | ||
"shortName": "wf" | ||
}, | ||
"BuildYak": { | ||
"longName": "build-yak", | ||
"shortName": "yak" | ||
}, | ||
"IncludeVSCode": { | ||
"longName": "include-vscode-launch", | ||
"shortName": "vscode" | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
Rhino.Templates/content/CSGrasshopper2/.template.config/ide.host.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/vs-2017.3.host", | ||
"unsupportedHosts": [ | ||
{ | ||
"id": "vs" | ||
} | ||
] | ||
} |
157 changes: 157 additions & 0 deletions
157
Rhino.Templates/content/CSGrasshopper2/.template.config/template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/template", | ||
"author": "McNeel", | ||
"classifications": [ | ||
"Rhino", | ||
"Grasshopper2", | ||
"GH2" | ||
], | ||
"name": "Grasshopper2 PlugIn (WIP)", | ||
"description": "Build Grasshopper2 components for Rhino 3D in C#", | ||
"identity": "Grasshopper2.Component.CS", | ||
"groupIdentity": "Grasshopper2.PlugIn", | ||
"precedence": 100, | ||
"defaultName": "MyGrasshopper2Components", | ||
"shortName": "gh2", | ||
"tags": { | ||
"language": "C#", | ||
"type": "project" | ||
}, | ||
"sourceName": "MyGrasshopper.1", | ||
"preferNameDirectory": true, | ||
"symbols": { | ||
"IncludeSample": { | ||
"type": "parameter", | ||
"description": "Include code sample.", | ||
"dataType": "bool", | ||
"defaultValue": "false" | ||
}, | ||
"RhinoVersion": { | ||
"type": "parameter", | ||
"description": "Version of Rhino", | ||
"datatype": "choice", | ||
"defaultValue": "8", | ||
"choices": [ | ||
{ | ||
"choice": "8", | ||
"description": "Version 8" | ||
} | ||
] | ||
}, | ||
"BuildYak": { | ||
"type": "parameter", | ||
"description": "Include target to build yak package(s) for your plugin", | ||
"datatype": "bool", | ||
"defaultValue": "false" | ||
}, | ||
"IncludeVSCode": { | ||
"type": "parameter", | ||
"description": "Include tasks.json and launch.json to build/debug in VS Code", | ||
"datatype": "bool", | ||
"defaultValue": "true" | ||
}, | ||
"PlugInDisplayName": { | ||
"type": "parameter", | ||
"description": "Display name of your Grasshopper2 plug-in", | ||
"datatype": "text", | ||
"replaces": "MyGrasshopper.1 Info" | ||
}, | ||
"ComponentClassName": { | ||
"type": "parameter", | ||
"description": "Name of the component class", | ||
"datatype": "text", | ||
"replaces": "MyGrasshopper__1Component", | ||
"fileRename": "MyGrasshopper__1Component" | ||
}, | ||
"ComponentName": { | ||
"type": "parameter", | ||
"description": "Display name of the component", | ||
"datatype": "text", | ||
"replaces": "MyGrasshopper.1 Component" | ||
}, | ||
"ComponentInfo": { | ||
"type": "parameter", | ||
"description": "Description of the component", | ||
"replaces": "ComponentInfo", | ||
"defaultValue": "Description of component" | ||
}, | ||
"ComponentChapter": { | ||
"type": "parameter", | ||
"description": "Chapter of the component", | ||
"replaces": "ComponentChapter", | ||
"defaultValue": "Chapter" | ||
}, | ||
"ComponentSection": { | ||
"type": "parameter", | ||
"description": "Section of the component", | ||
"replaces": "ComponentSection", | ||
"defaultValue": "Section" | ||
}, | ||
|
||
"UseWpf": { | ||
"type": "parameter", | ||
"description": "Enable to use WPF (Windows only)", | ||
"datatype": "bool", | ||
"defaultValue": "false" | ||
}, | ||
"UseWinForms": { | ||
"type": "parameter", | ||
"description": "Enable the use of Windows Forms", | ||
"datatype": "bool", | ||
"defaultValue": "false" | ||
}, | ||
"UseWindowsDesktop": { | ||
"type": "computed", | ||
"value": "UseWpf || UseWinForms" | ||
}, | ||
|
||
"HostIdentifier": { | ||
"type": "bind", | ||
"binding": "HostIdentifier" | ||
} | ||
}, | ||
"forms": { | ||
"JsonStringEncode": { | ||
"identifier": "replace", | ||
"pattern": "\\\\", | ||
"replacement": "\\\\" | ||
} | ||
}, | ||
"sources": [ | ||
{ | ||
"modifiers": [ | ||
{ | ||
"condition": "!IncludeVSCode", | ||
"exclude": [ ".vscode/*.*" ] | ||
}, | ||
{ | ||
"condition": "ComponentClassName == 'MyGrasshopper__1Component'", | ||
"rename": { | ||
"MyGrasshopper__1Component.cs": "MyGrasshopper.1Component.cs" | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"primaryOutputs": [ | ||
{ "path": "MyGrasshopper.1.csproj" }, | ||
{ "path": "MyGrasshopper__1Component.cs" } | ||
], | ||
"guids": [ | ||
"ee4e2b39-d96b-4e4c-8f9d-9b6561e61b64", | ||
"e79cd2b5-cb9c-4d08-93ec-446cc1f6d923", | ||
"cd826b9b-8dbe-4c31-aac1-6fc7ea2bcfb7" | ||
], | ||
"postActions": [ | ||
{ | ||
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", | ||
"description": "Opens the command in the editor", | ||
"manualInstructions": [], | ||
"actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6", | ||
"args": { | ||
"files": "1" | ||
}, | ||
"continueOnError": true | ||
} | ||
] | ||
} |
47 changes: 47 additions & 0 deletions
47
Rhino.Templates/content/CSGrasshopper2/.vscode/launch.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Rhino 8 - netcore", | ||
"type": "coreclr", | ||
"request": "launch", | ||
"preLaunchTask": "build", | ||
"program": "", | ||
"osx": { | ||
"program": "/Applications/Rhino 8.app/Contents/MacOS/Rhinoceros", | ||
"args": [ | ||
"-runscript=_G2" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This never seems to work for me on Mac, and I'm not sure why. |
||
] | ||
}, | ||
"windows": { | ||
"program": "C:\\Program Files\\Rhino 8\\System\\Rhino.exe", | ||
"targetArchitecture": "x86_64", | ||
"args": "/netcore /runscript=\"_G2\"" | ||
}, | ||
"env": { | ||
"RHINO_PACKAGE_DIRS": "${workspaceFolder}/bin/Debug" | ||
}, | ||
"cwd": "${workspaceFolder}", | ||
"stopAtEntry": false, | ||
"console": "internalConsole" | ||
}, | ||
{ | ||
"name": "Rhino 8 Windows - netfx", | ||
"type": "clr", | ||
"request": "launch", | ||
"preLaunchTask": "build", | ||
"windows": { | ||
"program": "C:\\Program Files\\Rhino 8\\System\\Rhino.exe", | ||
"targetArchitecture": "x86_64", | ||
"args": "/netfx /runscript=\"_G2\"" | ||
}, | ||
"env": { | ||
"RHINO_PACKAGE_DIRS": "${workspaceFolder}/bin/Debug" | ||
}, | ||
"cwd": "${workspaceFolder}", | ||
"stopAtEntry": false, | ||
"console": "internalConsole" | ||
}, | ||
], | ||
"compounds": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "build", | ||
"command": "dotnet", | ||
"type": "shell", | ||
"args": [ | ||
"build", | ||
"-clp:NoSummary", | ||
"${workspaceFolder}/MyGrasshopper.1.csproj" | ||
], | ||
"problemMatcher": "$msCompile", | ||
"presentation": { | ||
"reveal": "always", | ||
"clear": true | ||
}, | ||
"group": "build" | ||
} | ||
] | ||
} |
Binary file added
BIN
+37 KB
Rhino.Templates/content/CSGrasshopper2/Icons/MyGrasshopper__1Component.3dm
Binary file not shown.
Binary file added
BIN
+2.67 KB
Rhino.Templates/content/CSGrasshopper2/Icons/MyGrasshopper__1Component.ghicon
Binary file not shown.
Binary file added
BIN
+2.87 MB
Rhino.Templates/content/CSGrasshopper2/Icons/MyGrasshopper__1Plugin.3dm
Binary file not shown.
Binary file added
BIN
+897 Bytes
Rhino.Templates/content/CSGrasshopper2/Icons/MyGrasshopper__1Plugin.ghicon
Binary file not shown.
Binary file not shown.
89 changes: 89 additions & 0 deletions
89
Rhino.Templates/content/CSGrasshopper2/MyGrasshopper.1.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<!-- Select the framework(s) you wish to target. | ||
Rhino 8 Windows: net48, net7.0, net7.0-windows, net7.0-windows10.0.22000.0, etc | ||
Rhino 8 Mac: net7.0, net7.0-macos, net7.0-macos12.0, etc | ||
--> | ||
<!--#if (UseWpf)--> | ||
<TargetFrameworks>net7.0-windows;net48</TargetFrameworks> | ||
<!--#elif (UseWindowsDesktop)--> | ||
<TargetFrameworks>net7.0-windows;net7.0;net48</TargetFrameworks> | ||
<!--#else--> | ||
<TargetFrameworks>net7.0;net48</TargetFrameworks> | ||
<!--#endif--> | ||
<EnableDynamicLoading>true</EnableDynamicLoading> | ||
<TargetExt>.rhp</TargetExt> | ||
<!--#if (UseWinForms)--> | ||
<NoWarn>NU1701;NETSDK1086</NoWarn> | ||
<!--#else--> | ||
<NoWarn>NU1701</NoWarn> | ||
<!--#endif--> | ||
<EnableWindowsTargeting Condition="$(UseWindowsDesktop) == 'True'">true</EnableWindowsTargeting> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<!-- Specifies information for Assembly, Yak, and GH2 PlugIn Info --> | ||
<Version>1.0</Version> | ||
<Title>MyGrasshopper.1</Title> | ||
<Company>MyGrasshopper.1 Authors</Company> | ||
<Description>Description of MyGrasshopper.1</Description> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Grasshopper2" Version="2.0.9114-wip.27439" ExcludeAssets="runtime" /> | ||
</ItemGroup> | ||
|
||
<!--#if (UseWindowsDesktop)--> | ||
<!-- For Windows only builds --> | ||
<PropertyGroup Condition="$(TargetFramework.Contains('-windows')) or $(TargetFramework.StartsWith('net4'))"> | ||
<!--#if (UseWinForms)--> | ||
<UseWindowsForms>true</UseWindowsForms> | ||
<!--#endif--> | ||
<!--#if (UseWpf)--> | ||
<UseWpf>true</UseWpf> | ||
<!--#endif--> | ||
</PropertyGroup> | ||
|
||
<!--#endif--> | ||
<ItemGroup> | ||
<EmbeddedResource Include="Icons\*.ghicon" /> | ||
<EmbeddedResource Include="Icons\*.ico" /> | ||
</ItemGroup> | ||
<!--#if (UseWinForms)--> | ||
<!-- Reference WinForms for .NET 7.0 on macOS --> | ||
<ItemGroup Condition="!($(TargetFramework.Contains('-windows')) or $(TargetFramework.StartsWith('net4')))"> | ||
<FrameworkReference Include="Microsoft.WindowsDesktop.App.WindowsForms" /> | ||
</ItemGroup> | ||
|
||
<!--#endif--> | ||
<!--#if (RhinoVersion < '8')--> | ||
<Target Name="CopyPdbForMonoDebugging" AfterTargets="AfterBuild"> | ||
<!-- Enable debugging in Rhino 6/7 on Mac --> | ||
<Copy SourceFiles="$(TargetDir)$(TargetName).pdb" DestinationFiles="$(TargetDir)$(TargetName).gha.pdb" Condition="$([MSBuild]::IsOSPlatform(OSX)) and $(TargetFramework.StartsWith('net4')) and Exists('$(TargetDir)$(TargetName).pdb')" /> | ||
</Target> | ||
|
||
<!--#endif--> | ||
<!--#if (BuildYak)--> | ||
<Target Name="BuildYakPackage" AfterTargets="DispatchToInnerBuilds"> | ||
<PropertyGroup> | ||
<YakExecutable Condition="$(YakExecutable) == '' and $([MSBuild]::IsOSPlatform(windows)) and Exists('C:\Program Files\Rhino 8\System\Yak.exe')">C:\Program Files\Rhino 8\System\Yak.exe</YakExecutable> | ||
<YakExecutable Condition="$(YakExecutable) == '' and $([MSBuild]::IsOSPlatform(macos)) and Exists('/Applications/Rhino 8.app/Contents/Resources/bin/yak')">/Applications/Rhino 8.app/Contents/Resources/bin/yak</YakExecutable> | ||
|
||
<BuildYakPackage Condition="$(BuildYakPackage) == '' and $(YakExecutable) != '' and Exists($(YakExecutable))">True</BuildYakPackage> | ||
</PropertyGroup> | ||
|
||
<Warning Text="Could not find Yak executable" Condition="$(YakExecutable) == ''" /> | ||
|
||
<ItemGroup> | ||
<YakPackagesToDelete Include="$(OutputPath)\*.yak;$(OutputPath)\**\manifest.yml" /> | ||
</ItemGroup> | ||
|
||
<Delete Files="@(YakPackagesToDelete)" /> | ||
|
||
<Exec Command=""$(YakExecutable)" spec" WorkingDirectory="$(OutputPath)" Condition="$(BuildYakPackage) == 'True'" /> | ||
<Exec Command=""$(YakExecutable)" build" WorkingDirectory="$(OutputPath)" Condition="$(BuildYakPackage) == 'True'" /> | ||
</Target> | ||
|
||
<!--#endif--> | ||
</Project> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May make sense to include 9 WIP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think I should add that to all of the templates, or just the GH2 template?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I might add 9 WIP at some later date to all of the templates.