Skip to content
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 multi targeting to projects #17

Merged
merged 5 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 15 additions & 53 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
types: [ published ]

env:
DotNetVersion: "7.0.107"
DotNetVersion: "8.0.401"
BuildParameters: "/v:Minimal /consoleLoggerParameters:NoSummary /p:Configuration=Release /p:BuildVersion=${{ github.run_id }} /p:BuildBranch=${{ github.ref }}"

jobs:
Expand All @@ -18,87 +18,49 @@ jobs:
runs-on: windows-2022

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DotNetVersion }}

- name: Setup msbuild
uses: microsoft/setup-msbuild@v1
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.0,18.0)'

- name: Build VS2022
run: msbuild /restore ${{ env.BuildParameters }} /p:VSVersion=2022 Rhino.VisualStudio.Windows\Rhino.VisualStudio.Windows.csproj /bl:artifacts/log/Build.Windows.2022.binlog

- name: Upload extensions
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: extensions-windows
path: artifacts/Release/*.vsix

- name: Upload log files
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: log
path: artifacts/log/**/*

build-mac:

runs-on: macos-11

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DotNetVersion }}

- name: Install macos workload
run: sudo dotnet workload install macos --from-rollback-file dotnet-workloads.json

- name: Setup Xamarin and XCode
uses: maxim-lobanov/setup-xamarin@v1
with:
mono-version: latest
xamarin-mac-version: latest
xcode-version: latest

# - name: Build VS2019
# run: msbuild /restore ${{ env.BuildParameters }} /t:PackageAddin /p:VSVersion=2019 src/Eto.DevExtension.VisualStudio.Mac/Eto.DevExtension.VisualStudio.Mac.csproj /bl:artifacts/log/Build.Mac.2019.binlog

- name: Build VS2022
run: dotnet build ${{ env.BuildParameters }} /p:VSVersion=2022 Rhino.VisualStudio.Mac/Rhino.VisualStudio.Mac.csproj /bl:artifacts/log/Build.Mac.2022.binlog

- name: Upload extensions
uses: actions/upload-artifact@v2
- name: Upload templates
uses: actions/upload-artifact@v4
with:
name: extensions-mac
path: artifacts/Release/*.mpack
name: templates
path: artifacts/bin/Rhino.Templates/Release/*.nupkg

- name: Upload log files
if: ${{ failure() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: log
path: |
artifacts/log/**/*

path: artifacts/log/**/*

publish:
needs: [ build-windows-2022, build-mac ]
needs: [ build-windows-2022 ]
runs-on: ubuntu-latest
if: (github.event_name == 'release' && github.event.action == 'published' && startsWith(github.ref, 'refs/tags/'))
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4

- name: Display structure of downloaded files
run: ls -R
Expand All @@ -110,4 +72,4 @@ jobs:
fail_on_unmatched_files: true
files: |
extensions-windows/*.vsix
extensions-mac/*.mpack
templates/*.nupkg
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"omnisharp.defaultLaunchSolution": "Rhino.VisualStudio.Mac.sln",
"var": {
"configuration" : "Debug",
"buildProperties" : "/v:Minimal /p:GenerateFullPaths=True /consoleLoggerParameters:NoSummary"
},
"dotnet.defaultSolution": "Rhino.VisualStudio.Mac.sln",
}
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"build",
"/p:Configuration=${input:configuration}",
"/p:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary",
"-clp:NoSummary",
"${workspaceFolder}/Rhino.Templates/Rhino.Templates.csproj"
],
"problemMatcher": "$msCompile",
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<BaseOutputPath>$(ArtifactsDir)bin\$(MSBuildProjectName)\</BaseOutputPath>
<BaseIntermediateOutputPath>$(ArtifactsDir)obj\$(OS)\$(MSBuildProjectName)\</BaseIntermediateOutputPath>

<Version>8.0.0</Version> <!-- PSST. Hey Curtis. Update all other files with this number too -->
<Version>8.10.0</Version> <!-- PSST. Hey Curtis. Update all other files with this number too -->
<PackageVersion>$(Version)</PackageVersion>
</PropertyGroup>
</Project>
48 changes: 10 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,31 @@
# RhinoCommon Visual Studio Extensions

Includes RhinoCommon and Grasshopper template wizards for Visual Studio on Windows and Mac.

Manual Install Instructions (Mac)
---------------------------------

1. As of this writing, update to **Visual Studio for Mac 2022 v17.3 or later**.
2. Download [the latest .mpack release](https://github.com/mcneel/RhinoVisualStudioExtensions/releases).
3. Launch **Visual Studio for Mac**.
4. Navigate to **Visual Studio** > **Extensions...**
5. Click on the **Installed** tab
6. **Uninstall** all previous versions of the **RhinoCommon Plugin Support**. If none are installed, you can ignore the next two steps (skip to step 9).
7. **Quit** and **Restart** Visual Studio for Mac.
8. Navigate to **Visual Studio** > **Extensions...** again.
9. Click **Install from file...** button in the lower-left corner.
10. Navigate to the mpack file you downloaded in step 1, then click **Open**.
11. Click **Install**. The plugin should install.
12. **Quit** and **Restart** Visual Studio for Mac.
13. Navigate to **Visual Studio** > **Extensions..** > **Installed** tab. Verify that **RhinoCommon Plugin Support** is listed. If it's there, you have successfully installed the extension and you are **DONE**.

Manual Install Instructions (Windows)
-------------------------------------
Includes RhinoCommon, Grasshopper, Zoo, and Rhino C++ templates and wizards for Visual Studio on Windows and Mac.

## Manual Install Instructions (Visual Studio)

1. Download [the latest .vsix release](https://github.com/mcneel/RhinoVisualStudioExtensions/releases).
2. Close any instances of Visual Studio.
3. Double click the .vsix in File Explorer.
4. Run through the wizard to install the extension.
5. Start Visual Studio and create a new RhinoCommon or Grasshopper project.

Using dotnet new
----------------
## Using dotnet new

1. Install the templates from nuget. This will show the list of all templates after a successful install.

`dotnet new -i Rhino.Templates`
`dotnet new install Rhino.Templates`

2. Create a new folder for your project:

```
```bash
mkdir MyNewRhinoPlugin
cd MyNewRhinoPlugin
```

3. Show options for the templates:
3. Show options for the templates:

```
```bash
dotnet new rhino --help
dotnet new grasshopper --help
```
Expand All @@ -57,15 +38,6 @@ Using dotnet new

`dotnet build`

## Additional Resources

Debugging Rhino
---------------

1. Click the **Run** button in the upper left-hand corner of Visual Studio

For Developers (of this Extension)
--------------

## Mac
Building this project requires the **Addin Maker Extension**. You can install this from within Visual Studio by navigating to **Visual Studio** > **Extensions...** > **Gallery** > **Extension Development** > **AddinMaker**. Click the **Install** button. **Quit** and **relaunch** Visual Studio for Mac.

See <https://developer.rhino3d.com/guides/rhinocommon/> for guides on how to start with Rhino Plug-In development.
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@
"type": "parameter",
"description": "Version of Rhino",
"datatype": "choice",
"defaultValue": "7",
"defaultValue": "8",
"choices": [
{
"choice": "7",
"description": "Version 7"
},
{
"choice": "8",
"description": "Version 8 (WIP)"
"description": "Version 8"
}
]
},
Expand Down
8 changes: 6 additions & 2 deletions Rhino.Templates/content/CPPRhino/MyRhino.1.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,18 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset Condition="$(RhinoVersion) == '6'">v142</PlatformToolset>
<PlatformToolset Condition="$(RhinoVersion) == '7'">v142</PlatformToolset>
<PlatformToolset Condition="$(RhinoVersion) == '8' || $(RhinoVersion) == ''">v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset Condition="$(RhinoVersion) == '6'">v142</PlatformToolset>
<PlatformToolset Condition="$(RhinoVersion) == '7'">v142</PlatformToolset>
<PlatformToolset Condition="$(RhinoVersion) == '8' || $(RhinoVersion) == ''">v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
"type": "parameter",
"description": "Version of Rhino",
"datatype": "choice",
"defaultValue": "7",
"defaultValue": "8",
"choices": [
{
"choice": "7",
"description": "Version 7"
},
{
"choice": "8",
"description": "Version 8 (WIP)"
"description": "Version 8"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@
"UseWinForms": {
"longName": "include-winforms",
"shortName": "wf"
},
"BuildYak": {
"longName": "build-yak",
"shortName": "yak"
},
"IncludeVSCode": {
"longName": "include-vscode-launch",
"shortName": "vscode"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"type": "parameter",
"description": "Version of Rhino",
"datatype": "choice",
"defaultValue": "7",
"defaultValue": "8",
"choices": [
{
"choice": "6",
Expand All @@ -39,18 +39,21 @@
},
{
"choice": "8",
"description": "Version 8 (WIP)"
"description": "Version 8"
}
]
},
"RhinoLocation": {
"BuildYak": {
"type": "parameter",
"description": "Location of Rhino.exe, usually C:\\Program Files\\Rhino 7\\System\\Rhino.exe",
"replaces": "MyExecutablePath",
"forms": {
"global": [ "JsonStringEncode" ]
},
"defaultValue": "C:\\Program Files\\Rhino 7\\System\\Rhino.exe"
"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"
},
"AddonDisplayName": {
"type": "parameter",
Expand Down Expand Up @@ -98,21 +101,21 @@

"UseWpf": {
"type": "parameter",
"description": "Enable to use WPF designer in VS (Windows only)",
"description": "Enable to use WPF (Windows only)",
"datatype": "bool",
"defaultValue": "false"
},
"UseWinForms": {
"type": "parameter",
"description": "Enable to use Windows Forms designer in VS (Windows only)",
"description": "Enable the use of Windows Forms",
"datatype": "bool",
"defaultValue": "false"
"defaultValue": "true"
},
"UseWindowsDesktop": {
"type": "computed",
"value": "UseWpf || UseWinForms"
},

"HostIdentifier": {
"type": "bind",
"binding": "HostIdentifier"
Expand All @@ -126,16 +129,20 @@
}
},
"sources": [
{
"modifiers": [
{
"condition": "ComponentClassName == 'MyGrasshopper__1Component'",
"rename": {
"MyGrasshopper__1Component.cs": "MyGrasshopper.1Component.cs"
}
}
]
}
{
"modifiers": [
{
"condition": "!IncludeVSCode",
"exclude": [ ".vscode/*.*" ]
},
{
"condition": "ComponentClassName == 'MyGrasshopper__1Component'",
"rename": {
"MyGrasshopper__1Component.cs": "MyGrasshopper.1Component.cs"
}
}
]
}
],
"primaryOutputs": [
{ "path": "MyGrasshopper.1.csproj" },
Expand Down
Loading