Paket icon indicating copy to clipboard operation
Paket copied to clipboard

Allow to depend on simple F# or C# code files

Open forki opened this issue 12 years ago • 39 comments

In F# land we often want to share one or two F# files between multiple repositories. It would be cool to have support for that.

Not sure if nuget is the best way for that.

forki avatar Aug 31 '14 14:08 forki

Some people call these minimods. They use the normal nuget infrastructure but install source files and add them to the repo.

agross avatar Aug 31 '14 14:08 agross

I would prefer to see a more lightweight mechanism - if it's just a couple of files on e.g. github, why not just reference them directly in the paket configuration file?

isaacabraham avatar Aug 31 '14 14:08 isaacabraham

We would somehow still want to reference specific versions or version ranges. On Aug 31, 2014 4:31 PM, "Isaac Abraham" [email protected] wrote:

I would prefer to see a more lightweight mechanism - if it's just a couple of files on e.g. github, why not just reference them directly in the paket configuration file?

— Reply to this email directly or view it on GitHub https://github.com/fsprojects/Paket/issues/9#issuecomment-53989638.

forki avatar Aug 31 '14 14:08 forki

Actually, bundler has something like that. You can specify a git source for a gem and even tell it to track master or a specific git commit.

agross avatar Aug 31 '14 14:08 agross

Yes. That's what we should implement. Any links? On Aug 31, 2014 4:43 PM, "Alexander Groß" [email protected] wrote:

Actually, bundler has something like that. You can specify a git source for a gem and even tell it to track master or a specific git commit.

— Reply to this email directly or view it on GitHub https://github.com/fsprojects/Paket/issues/9#issuecomment-53989995.

forki avatar Aug 31 '14 14:08 forki

Bundler docs ;-)

It also support paths: gem 'foo', :path => '/somewhere'

Git looks very similar.

agross avatar Aug 31 '14 14:08 agross

http://bundler.io/git.html

agross avatar Aug 31 '14 14:08 agross

Only thing that I'm not clear is that bundler still looks for a .gemspec file in the repo. I would also like to see the ability to simply reference particular files (or folders) against a particular git commit etc.

isaacabraham avatar Aug 31 '14 15:08 isaacabraham

Do we need a git implementation for this? Or is http download enough?

forki avatar Aug 31 '14 15:08 forki

Bundler talks about avoiding http re: man in middle. But I'm of the opinion to start simple, just use http to start with - can always move to something else if needed?

isaacabraham avatar Aug 31 '14 15:08 isaacabraham

Bundler requires git in path and just calls the executable.

agross avatar Aug 31 '14 15:08 agross

@agross would you need to provide auth then?

isaacabraham avatar Aug 31 '14 15:08 isaacabraham

@isaacabraham I never used bundler with authenticated git repos. I think the git defaults would work if you have the keypairs for SSH access available. It seem's there's a solution for authenticated HTTP repos as well: https://gist.github.com/masonforest/4048732 Other than that, you can still embed username and password in the HTTP URL (if you use Gitlab, for example).

agross avatar Aug 31 '14 16:08 agross

git in path is OK for me. We do the same in FAKE. On Aug 31, 2014 6:16 PM, "Alexander Groß" [email protected] wrote:

@isaacabraham https://github.com/isaacabraham I never used bundler with authenticated git repos. I think the git defaults would work if you have the keypairs for SSH access available. It seem's there's a solution for authenticated HTTP repos as well: https://gist.github.com/masonforest/4048732 Other than that, you can still embed username and password in the HTTP URL (if you use Gitlab, for example).

— Reply to this email directly or view it on GitHub https://github.com/fsprojects/Paket/issues/9#issuecomment-53992775.

forki avatar Aug 31 '14 16:08 forki

I second this proposal and would love to see this feature. As for the source, I think git (and using it with git in path as prereq) is fair enough. AFAIK bundler, bower and composer do all the same. One nicety to note here actually is the support of semver-style git tags (as bower does, see docs).

ilkerde avatar Sep 04 '14 20:09 ilkerde

who wants to work on this?

forki avatar Sep 10 '14 18:09 forki

I’d be happy to have a crack at this but might not be able to start for a couple of days. Given that I’m not as intimately familiar with the entire Paket codebase, maybe a good way would be for me to just do something decoupled like the code that can retrieve the source files from git e.g.

(repo:string, filePath:string) -> seq<async>

or something like that?

From: Steffen Forkmann [mailto:[email protected]] Sent: 10 September 2014 19:05 To: fsprojects/Paket Cc: Isaac Abraham Subject: Re: [Paket] Allow to depend on simple F# or C# code files (#9)

who wants to work on this?

— Reply to this email directly or view it on GitHub https://github.com/fsprojects/Paket/issues/9#issuecomment-55156243 . https://github.com/notifications/beacon/1781813__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyNTk5MTQ4MiwiZGF0YSI6eyJpZCI6NDExNTgyMzJ9fQ==--3616df338c2757faabf76510964edc114375b224.gif

isaacabraham avatar Sep 10 '14 18:09 isaacabraham

sounds good.

As already discussed you can assume that git is in the path if you need it. Also take a look at https://github.com/fsharp/FAKE/tree/master/src/app/FakeLib/Git and copy functions over if you need.

forki avatar Sep 10 '14 18:09 forki

I'd have a look at NuGet source code packages; here's a good writeup.

A .nuspec to the project emitting the code and a NuGet pack to the build allows one to carry semantic info along with files. Then they can be first class and e.g. local edits can be detected (see #65 - I mention source file substitutions in there too ).

Having said all that, I'd love to abuse the scheme envisaged above too. But I'd feel very dirty if I did :(

bartelink avatar Sep 10 '14 18:09 bartelink

Very cool, but please create a separate issue so that we can keep track of this. On Sep 10, 2014 8:52 PM, "bartelink" [email protected] wrote:

I'd have a look at NuGet source code packages; here's a good writeup http://nikcodes.com/2013/10/23/packaging-source-code-with-nuget/.

A .nuspec to the project emitting the code and a NuGet pack to the build allows one to carry semantic info along with files. Then they can be first class and e.g. local edits can be detected (see #65 https://github.com/fsprojects/Paket/issues/65 - I mention source file substitutions in there too https://github.com/fsprojects/Paket/issues/65#issuecomment-55133240 ).

Having said all that, I'd love to abuse the currently described version. But I'd feel very dirty if I did :(

— Reply to this email directly or view it on GitHub https://github.com/fsprojects/Paket/issues/9#issuecomment-55164271.

forki avatar Sep 10 '14 18:09 forki