Skip to content

Commit

Permalink
Merge pull request #17 from mcneel/curtis/rhino8-updates
Browse files Browse the repository at this point in the history
Add multi targeting to projects
  • Loading branch information
cwensley authored Sep 20, 2024
2 parents 8434c53 + 1334dd0 commit 2c7f7cf
Show file tree
Hide file tree
Showing 66 changed files with 1,770 additions and 624 deletions.
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.
7 changes: 7 additions & 0 deletions Rhino.Templates/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Rhino 3D Templates

RhinoCommon, Grasshopper and C++ SDK templates for [Rhino 3D](https://rhino3d.com).

To install the templates in this package, run `dotnet new install Rhino.Templates` from the command line.

See [developer.rhino3d.com](https://developer.rhino3d.com) to get started with Rhino 3D development.
2 changes: 2 additions & 0 deletions Rhino.Templates/Rhino.Templates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<PackageProjectUrl>https://developer.rhino3d.com/guides/</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/mcneel/RhinoVisualStudioExtensions.git</RepositoryUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>

<TargetFramework>netstandard2.0</TargetFramework>
<ContentTargetFolders>content</ContentTargetFolders>
Expand All @@ -36,6 +37,7 @@

<ItemGroup>
<None Include="rhinocommon.png" Pack="true" PackagePath=""/>
<None Include="README.md" Pack="true" PackagePath=""/>
<None Include="content\Directory.*" />
<None Include="content\*\.template.config" />

Expand Down
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
2 changes: 1 addition & 1 deletion Rhino.Templates/content/CSCommand/MyCommand.1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public MyCommand__1()
Instance = this;
}

///<summary>The only instance of the MyCommand command.</summary>
///<summary>The only instance of this command.</summary>
public static MyCommand__1 Instance { get; private set; }

public override string EnglishName => "MyCommand.1";
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"
}
}
}
Loading

0 comments on commit 2c7f7cf

Please sign in to comment.