PaintLab/PixelFarm

How to deal with 3 repo?, Submodules consideration

hamarb123 opened this issue ยท 23 comments

Here are the errors (too many to put in here)
https://docs.google.com/document/d/1OYyfHqRinmgp1Fnz4UJBTY2lIj0Wvecc7TuQO-mvtH0/edit?usp=sharing
And could you please release NuGet packages for this amazing project

update 2020, all-in-one , please visit => https://github.com/LayoutFarm/HtmlRenderer.Build

The error may come from it miss Typography repo


How to build the PixelFarm

  1. This repo needs the Typography repo (https://github.com/LayoutFarm/Typography) staying together side-by-side in the same dir

    like this ...

    d:\projects\PixelFarm
    d:\projects\Typography

buiding_pixel_farm

  1. at this time please use git to clone it => because you may want to switch to the latest branch

I tried that, I looked through all of the 'missing libraries' and found the following errors when I tried to specifically build them (instead of build all):
Typography\PixelFarm.Typography\3_FontFaceImpl\AggGlyphTextureGen.cs
Line 43: PixelFarm.CpuBlit.VertexProcessing.BoundingRect.GetBoundingRect(new VertexStoreSnap(glyphVxs), ref bounds); The type or namespace name 'VertexStoreSnap' could not be found (are you missing a using directive or an assembly reference?) PixelFarm.Typography

And here is all the 'missing libraries' (removed duplicates, there are 49 errors after completely recloning it):
\PixelFarm\src\PixelFarm\PixelFarm.Typography\bin\Debug\PixelFarm.Typography.dll
\PixelFarm\src\PixelFarm\PixelFarm.Drawing.GdiPlus\bin\Debug\PixelFarm.Drawing.GdiPlus.dll
\PixelFarm\src\PixelFarm\PixelFarm.Drawing.GLES2\bin\Debug\PixelFarm.Drawing.GLES2.dll
\PixelFarm\src\PixelFarm\PixelFarm.Drawing.Skia\bin\Debug\PixelFarm.Drawing.Skia.dll
\PixelFarm\src\PixelFarm\PaintLab.Platforms.WinNeutral\bin\Debug\PaintLab.Platforms.WinNeutral.dll
\PixelFarm\src\Tests\Debug\TestSamples.dll
\PixelFarm\src\Tests\WinFormTestBed\bin\Debug\WinFormTestBed.dll

FIXED:
I got it fixed by changing that line to PixelFarm.CpuBlit.VertexProcessing.BoundingRect.GetBoundingRect(glyphVxs, ref bounds);

I've also been struggling with making a build and syncing the project dependencies.

@prepare - is there any trick to keeping PixelFarm/HtmlRenderer/Typography on git refs that are compatible?

Submodules are sort of a pain but have the benefit of keeping compatible builds in lockstep

If there's anything I can do to assist or if it would be helpful to explain how/why we use submodules in MatterControl to corral the three interconnected repositories that make up the project, let me know.

I spent the evening moving between various commits across projects until I finally found a compatible set that compiled without error and let me run the demos I've been excited to try out.

It was quite a bit of effort and really reinforces the idea that the project would benefit from a simple way to checkout working branch pointers.

There are many different ways you could tackle this and I choose the least impactful route, where I created a super project that emulates the behavior described in this post. This project has no direct content and simply wraps the three repos and uses submodules to control their last working and compatible commits. Theoretically each time you advance one or more of the child repositories (especially if they contain with breaking changes), you'd make a commit to lock in where you were across the three.

An example of this type of project can be found at https://gitlab.com/lewin76/pixelfarm. If you clone the repository and checkout master, you end up on pointers I finally used to get a working build.

Since I didn't want much history and my connection was running slow, I used shallow clones to only pull in a few recent commits but either way should have the same effect:

Shallow

git clone https://gitlab.com/lewin76/pixelfarm.git
git submodule init
git submodule update --depth 10

Full

git clone https://gitlab.com/lewin76/pixelfarm.git --recursive

I think the same with you.

I've created a new 'all-in-one' to handle, here https://github.com/PaintLab/pxdev

not finish yet :)

Fantastic, great to see you're already on it and heading down a similar path

The new repository is great! Cloned and was up and running in minutes. I think this will really help newcomers to the project

@prepare the latest version of the build repository does not work

@Ninjastorm380 ,
please try again at latest commit(LayoutFarm/HtmlRenderer.Build@09cf4d6)


This is my screenshot (a few minutes ago)

a_few_min_ago

Typography fails to build:
image

It gave me some libraries to work with, but now I need to put all of those libraries into one file.
I see a Merge project, but it keeps throwing an error about directory not found

also, if I modify the project to point to the right location, it says method not supported
@prepare

I forget to test the Xamarin.IOS,
give me a time to test it.

ok, I fix it, see LayoutFarm/HtmlRenderer.Build@e25c3a9


These are my snapshots.

android_t

Android


ios

iOS

everything builds, but BuildPixelFarmMerge throws an error about a bad path
image

Thank you,

That is a bug :)

please give me a time to fix it

@prepare ok, one last question for you: How do I get the controls to show up in the toolbox? added all the libraries to my project, but nothing shows up. Also tried to add manually, but VS said that there is no controls in any of the libraries

Yes, in the current version=> no 'easy-to-use' control.

An 'easy-to-use' control is in the plan.

for now , please see the example project,
1). output: the library renders to any surface that
supports GLES, Hwnd

2). input: user must forward user events (eg, mouse, keyboard)
to the library.

with 1) and 2) above=> create your own user control.

Feel free to ask more questions :)