Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a http file reference as project reference #1341

Closed
jruizaranguren opened this issue Jan 5, 2016 · 9 comments
Closed

Add a http file reference as project reference #1341

jruizaranguren opened this issue Jan 5, 2016 · 9 comments

Comments

@jruizaranguren
Copy link
Contributor

I have added a dll library downloaded as an http reference within a group. The paket.dependencies file contains:

group Files
http file:///absolute/path/to/library.dll target/path/library.dll

Then in the paket.references file I use:

group Files
    File:library.dll

This is adding a content node in the references ItemGroup in the .csproj, such as:

    <Content Include="..\..\paket-files\files\localhost\target\path\library.dll">
      <Paket>True</Paket>
      <Link>paket-files/library.dll</Link>
    </Content>
    ...
    <Reference Include="System" />
    ...

This is just a link to the source file which I can not use to create a project reference.

Is there any way to add this file as a project reference?

@forki
Copy link
Member

forki commented Jan 5, 2016

not yet. but I think it's not that hard to do.
let me see if I can hack something together

@jruizaranguren
Copy link
Contributor Author

Thanks. If you give me some clues I might try to make the enhancement.

@forki
Copy link
Member

forki commented Jan 5, 2016

it would be useful if you could generate a minimal repro that uses a sample dll (doesn't need to compile - dll might be 0 bytes)

@jruizaranguren
Copy link
Contributor Author

As a couple of tests or a folder with all required files (source file, solution file, project file)?

@forki
Copy link
Member

forki commented Jan 5, 2016

yes a folder with all required files would be nice. I would then put this into our integration test suite

@jruizaranguren
Copy link
Contributor Author

Here you have. http path must be changed!.

i001341.zip

@forki
Copy link
Member

forki commented Jan 5, 2016

please test the 2.40.7 version.
I added your sample repo as integration test and implemented a fix. but Im not completely sure if it works. so please see it as an alpha version that needs further testing.

@jruizaranguren
Copy link
Contributor Author

Starting with a greenfield folder, it succesfully creates a project reference to the dll. But there are some undesirable behaviors:

  • It copies the dll to a new local folder below the project folder: paket-files/library.dll. This is not needed because the library is already downloaded below the paket-files directory. Only the project reference should be created.
  • When the reference is deleted in paket.references, it succesfully deletes the reference, but the mentioned new local file paket-files/library.dll is not deleted.
  • When paket-files/library.dll is found below the project directory, the installation fails. So forced updates of the library will fail.
  • If we already had the library referenced as a link in a content item, this is not deleted when the new reference is added (minor issue to be documented).

forki added a commit that referenced this issue Jan 7, 2016
@forki
Copy link
Member

forki commented Jan 7, 2016

just fixed this. paket-files/library.dll is no longer copied.
regarding docs - could you please take a look at https://github.com/fsprojects/Paket/blob/master/docs/content/http-dependencies.md and send a PR with some docs improvements that you find useful? would help a lot

@forki forki closed this as completed Jan 7, 2016
forki added a commit that referenced this issue Jan 18, 2016
improve http-dependencies documentation #1341
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants