Genbox / VelcroPhysics

High performance 2D collision detection system with realistic physics responses.
MIT License
662 stars 114 forks source link

Change to Protobuild project #35

Closed ghost closed 3 years ago

ghost commented 7 years ago

Hello :hand: What do you think about change the project to use Protobuild to generate the project files?

Protobuild offers some facilities and better organization for the project and is really easy to use. :call_me_hand:

Genbox commented 7 years ago

I'll take a look at it in the weekend and see what it has to offer.

Genbox commented 7 years ago

Looks interesting - I'm not entirely sure how to build the definition file as I have many projects depending on each other etc.

I would be happy if someone with experience in Protobuild could sketch up a solution and contribute it.

dsaf commented 6 years ago

Maybe the project owner @hach-que can help?

hach-que commented 6 years ago

Sure, what do you need?

Referencing another Protobuild definition or a GAC reference

Just add it to the references section like this:

<?xml version="1.0" encoding="utf-8"?>
<Project Name="ProjectA" Path="ProjectA" Type="Library">
  <Properties />
  <References>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="ProjectB" />
  </References>

Referencing DLLs in your repo, native DLLs or custom .csproj files

First you need to declare an external project definition (see http://protobuild.readthedocs.io/en/latest/external_projects.html for information on how these are structured and what you can do with them). Then you'd reference the external project just as you would any other Protobuild definition:

<?xml version="1.0" encoding="utf-8"?>
<Project Name="ProjectA" Path="ProjectA" Type="Library">
  <Properties />
  <References>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="ExternalProject" />
  </References>

Referencing NuGet packages:

First add the package to your module by running:

Protobuild.exe --add NameOfNuGetPackage@SpecificVersion

then reference the NuGet package:

<?xml version="1.0" encoding="utf-8"?>
<Project Name="ProjectA" Path="ProjectA" Type="Library">
  <Properties />
  <References>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="SomeNuGetPackage" />
  </References>

Referencing a Git repository

If you want to reference another Git repository that's using Protobuild (like MonoGame), you first add the Git repository as a package e.g.:

Protobuild.exe --add https-git://github.com/MonoGame/MonoGame@develop

then reference the specific projects in the package you want to pull in:

<?xml version="1.0" encoding="utf-8"?>
<Project Name="ProjectA" Path="ProjectA" Type="Library">
  <Properties />
  <References>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="MonoGame.Framework" />
  </References>