How to add FsLexYacc to a project via PackageReference - f#

I do not see how to install fslex on my mac os. According to https://fsprojects.github.io/FsLexYacc/fslex.html, I will need to add a package reference somewhere in a file:
But which file should the package reference added to? I suppose there is a kind of project description xml file that all F# developers use. Where can I find documentation about such a file?

You want to add
<PackageReference Include="FsLexYacc" Version="9.0.2" />
to your project's .fsproj file. The FsLexYacc README assumes, incorrectly, that when it tells you to add a package reference "to your project" that you know that you should put it in your .fsproj file. Every F# project will should have exactly one .fsproj file in it.
.fsproj files are essentially the same as their C# equivalent .csproj files, for which you can find documentation here.
Note that most .NET developers avoid tinkering directly with project files when they can avoid it. For example, I would personally opt to install this package from NuGet.

Related

I get a Can't load package error although the BPL is there

This issue is driving me crazy. I'm trying to compile and install The QR Designer from QuickReports 6. I have an issue just with the one package. When I right the package in the IDE > Install the IDE gives me:
Can't load package C:\xe10_3\QRDesign\Win32\Debug\dclqrd_DXE10_3.bpl.
The specified module could not be found.
But the exact file is there.
I've also tried installing it via the menu under Components > Install Packages and then choosing the BPL from there, with the same issue.
I've tried to use Process Monitor as on this post here to find the issue:
Delphi Can't load package the specified module cannot be found
I couldn't fix the issue, but what I did pick up from Process Monitor was that some process was looking for the package here:
Computer\HKEY_CURRENT_USER\Software\Embarcadero\BDS\21.0\Package Cache\dclqrd_DXE10_3.bpl
That key didn't exists. I tried manually creating the key, but that didn't do a thing.
Any ideas?
UPDATE
Here is the list of packages:
As you can see, dclqrd_DXE10_3 is dependant on two others. Which I already built and installed. I removed its references and re-added them again now, to make sure the references are sound. I guess its like Remy said, the Specified module not found is probably not referring to dclqrd_DXE10_3 although I don't know what other module it could be referring to.
To install a package successfully in IDE, follow the steps:
Open the dpk/dproj/groupproj file in IDE
Build the package(s) for Windows 32-bit platform.
IDE itself is a 32-bit applicaton, so it should match.
Normally, it will build all dependent/required packages
Check if all chain of BPL & DCP files are generated in package Output directory.
It defaults to $(BDSCOMMONDIR)\Bpl & Dcp folders, but can be changed individually for each Package in Settings.
PBL packages are like DLL files. In order to load them, it requires all dependent BPLs.
If you have custom package output paths:
Check if your DCP output path is included in Tools\Options\Language\Delphi\Library Library Path for Windows 32-bit platform
Check if no duplicates of outdated compiled packages in default $(BDSCOMMONDIR)\Bpl & Dcp directories
Add the paths to library source pas files in Tools\Options\Language\Delphi\Library Browsing path or Library path
In some specific cases, if the package requires some extra dll-s like DB Client libraries, check if these dlls are 32-bit and are loadable, like included in %path% environement variable.
Note, some libraries offers package installer tools, that automagically do all mentioned things for you.
Also, there are universal package installer tools for quick working environement setup in one click.
I don't know why this fixed my issue, but it did.
The output directories for the bpl and dcp was set to be $(Platform)\$(Config)
The project files for the different packages exists in the same folder so the above config was supposed to be the debug folder or the release folder. Why only this package was thrown off I still don't know, but since changing the above packages to have a fixed path suddenly I could now install dclqrd_DXE10_3.bpl.
Thank you all for helping.

How to include files in dart package

I've a package which ships with some lib's(*.so and *.dll), when i try accessing them from my a project, it always returns no such file or directory.
I think whenever a plugin is being used, the working directory is pointing at the directory of project.
One way to fix this is to ask the user to download the lib's into there directory. But that defeats the purpose of a package.
Is there anyway to make dart find the lib in the package directory instead of the current project.

fsproj files in dotnet-core projects

When creating new projects with .net-core (dotnet new -l F#), the projects are created with a project.json file and no fsproj file. However, it is my understanding that an fsproj file is needed in order to get intellisense.
Are there any tools for generating an fsproj file from a project.json file?
I am interested in a solution that works both in Linux and Visual Studio as I use both equally for fsharp.
If you open project.json in Visual Studio 2015 with update 3, it will create an xproj file for the project.
I'm not aware of a way of doing this in linux.
However, as far as I know you don't need an fsproj file to get intellisense.
I found projekt useful for creating and manipulating .fsproj files. However, it will not automatically convert your project.json for you.

What project options to use for open source Delphi packages?

I've written some Delphi code I would like to share on GitHub. All code is contained in runtime and designtime packages as required. There are many "Project Options" to set for each project. (Output directories, search paths, compilation options, etc.) I've managed to find some default options that work well for my situation but reading other Q&As here it's clear there are multiple ways of working.
What project options should be used to allow the open source packages to easily be incorporated into individual projects?
I've recently started using NodeJS. The NPM package manager makes it super easy to use third-party packages in a project. Packages are installed with one simple command on the command line. Packages will automatically install any required dependencies.
PS: Feel free to edit this question if you would like to add extra things to consider.
Let's say you have this structure
MyComponent
Packages
DelphiXE7
Package2.dpr
source
bin
Delphi XE7
then set
Search Path
..\..\..\source
Unit output directory
..\..\..\bin\Delphi XE7\$(Platform)\$(Config)
After compilation for all supported platforms and both Release and Debug you will have this structure in the bin directory
MyComponent
Packages
DelphiXE7
Package2.dpr
source
bin
Delphi XE7
Android
Release
Debug
Win32
Release
Debug
Win64
Release
Debug
For installation you have to setup some path inside the IDE.
Environment
MYCOMPONENT => [root path to the files]
Library
Repeat that for all supported platforms
Library Path
$(MYCOMPONENT)\bin\Delphi XE7\$(Platform)\Release
Search Path
$(MYCOMPONENT)\source
Debug-DCU-Path
$(MYCOMPONENT)\bin\Delphi XE7\$(Platform)\Debug
If there are some language related units there is also a place to add (see Library - translated)
This ensures, that you have full debug feature (with Use Debug-DCU option set) and on release you have no debug code in your application.
Just a sidenote on libraries you should not want to install because you only use them in some projects.
Simply use the Optionset combined with a environment variable.
Here my SuperObject.optionset ($(USRLIB) points to a directory, where I collect all common used source code. And $(USRLIB)\ext is the place for all of the external libraries).
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DCC_UnitSearchPath>$(USRLIB)\ext\superobject;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
</PropertyGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType>OptionSet</Borland.ProjectType>
<BorlandProject>
<Delphi.Personality/>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
</Project>
To use the superobject library I simply add the optionset to the project (right mouse click on build configuration) and everything is fine.

Umbraco: How do I include the generated files after install?

I have installed Umbraco via nuget to empty project. I then ran the project so the installation started.
After installation ran there was lots of generated files so I have included them in project so that I can use source control.
I then ran project again and got the error:
Could not load file or assembly 'Newtonsoft.Json'
There is the dll file for this in bin folder and also a reference.
I think this might be because the "packages" folder created by nuget installation is not included in project. I do not know how to include this.
Does anyone know what I should do?
It turns out problem was in the Newtonsoft.Json file in nuget package. I downloaded latest dll from codeplex and it fixed the problem.

Resources