Coder Social home page Coder Social logo

alvpickmans / dynamo-dev-starter-kit Goto Github PK

View Code? Open in Web Editor NEW
37.0 8.0 14.0 5.56 MB

Visual Studio Extension (VSIX) providing some basic template set up for developing Dynamo ZeroTouch and Explicit Nodes packages

License: MIT License

C# 100.00%
dynamods csharp

dynamo-dev-starter-kit's Introduction

Dynamo Development Starter Kit

The set up of a project aiming the Dynamo platform can be hard and frustrating if not use to it. This project is a Visual Studio Extension (VSIX) containing templates for the set up of Dynamo package projects, providing boilerplates so you can just start developing your stuff.

Getting Started

These instructions will get you started on how to install the VSIX and start developing your own Dynamo packages. Bear in mind these templates are just one of many ways of setting up Visual Studio to seamlessly create a base project scaffolding.

Prerequisites

Installation

Having the project downloaded and Visual Studio totally closed, execute the .vsix file within the /dist folder. This pops up a window that will install the extension along with templates. You can also install the latest stable version by downloading the .zip bundle from the latest release section.

Installing

Usage

Note: Bear in mind that the templates distributed on this extension are by no means mandatory and just represent my personal way of structuring projects. These templates can be modified when building the extension from source

Usage

  • Within Visual Studio, create a new project. Under Visual C#, you should have three new templates:
    • Dynamo Template - ZeroTouch
    • Dynamo Template - Explicit Nodes
    • Dynamo Template - ViewExtension
  • Fill in the parameters of your projects. The panel on the rigth displays a preview of the pkg.json file that will get generated.
  • Once accepted, it will generate a project scaffolding on the selected location.
  • Required Dynamo Libraries are already define. In order to restore them, press right-click on the solution's tab and select Restore Nuget Packages. This will download them from NuGet and you'll be ready to go! Otherwise, these references will be restored the first time you build the solution. Restoring NuGet
  • Finally when compiling, a package folder will be created at {YourSolutionName}/dist/{YourProjectName}. If configuration mode is on Debug, this package folder will be copied to the Dynamo packages folder, following the below snippet for the AfterBuild target or similar:
<PropertyGroup>
    <PackageName>Sample Project</PackageName>
    <VersionFolder>2.0</VersionFolder> 
    <PackageFolder>$(SolutionDir)dist\$(PackageName)\</PackageFolder>
    <BinFolder>$(PackageFolder)bin\</BinFolder>
    <ExtraFolder>$(PackageFolder)extra\</ExtraFolder>
    <DyfFolder>$(PackageFolder)dyf\</DyfFolder>
  </PropertyGroup>
  <Target Name="AfterBuild">
    <ItemGroup>
      <Dlls Include="$(OutDir)*.dll" />
      <Pdbs Include="$(OutDir)*.pdb" />
      <Xmls Include="$(OutDir)*.xml" />
      <Xmls Include="$(ProjectDir)manifests\*.xml" />
      <PackageJson Include="$(ProjectDir)manifests\pkg.json" />
    </ItemGroup>
    <Copy SourceFiles="@(Dlls)" DestinationFolder="$(BinFolder)" />
    <Copy SourceFiles="@(Pdbs)" DestinationFolder="$(BinFolder)" />
    <Copy SourceFiles="@(Xmls)" DestinationFolder="$(BinFolder)" />
    <Copy SourceFiles="@(PackageJson)" DestinationFolder="$(PackageFolder)" />
    <MakeDir Directories="$(ExtraFolder)" Condition="!Exists($(ExtraFolder))" />
    <MakeDir Directories="$(DyfFolder)" Condition="!Exists($(DyfFolder))"  />
    <CallTarget Condition="'$(Configuration)' == 'Debug'" Targets="PackageDeploy" />
  </Target>
  <Target Name="PackageDeploy">
    <ItemGroup>
      <SourcePackage Include="$(PackageFolder)**\*" />
    </ItemGroup>
    <PropertyGroup>
      <DynamoCore>$(AppData)\Dynamo\Dynamo Core\$(VersionFolder)\packages</DynamoCore>
      <DynamoRevit>$(AppData)\Dynamo\Dynamo Revit\$(VersionFolder)\packages</DynamoRevit>
    </PropertyGroup>
    <!--Copying to Package Folder-->
    <Copy SourceFiles="@(SourcePackage)" Condition="Exists($(DynamoCore))" DestinationFolder="$(DynamoCore)\$(PackageName)\%(RecursiveDir)" />
    <Copy SourceFiles="@(SourcePackage)" Condition="Exists($(DynamoRevit))" DestinationFolder="$(DynamoRevit)\$(PackageName)\%(RecursiveDir)" />
  </Target>

Building from Source

In order to build the project from source, Visual Studio SDK must be installed. The solution has 4 projects:

  • DynamoDev.StarterKitExtension: Handling the VSIX extension and contains the Package Definition window.
  • DynamoDev.ZeroTouch: Contains the template to deploy a ZeroTouch package (not requiring custom UI).
  • DynamoDev.ExplicitNodes: Contains the template to deploy a Dynamo package with nodes requiring UI customization.
  • DynamoDev.ViewExtension: Contains the template to deploy a Dynamo ViewExtension.

On debugging, another instance of Visual Studio will open and the extension can be used. On Release configuration mode, after being built the corresponding files will be copied to the /dist folder.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

dynamo-dev-starter-kit's People

Contributors

alvpickmans avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dynamo-dev-starter-kit's Issues

Add `Clean` target to csproj

When cleaning a solution/project, the associated dist and package folder doesn't get cleaned. If a build has copied unnecessary files, these won't get removed until manually deleted.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.