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

create a nuget package for a single Docopt.cs file #8

Closed
prabirshrestha opened this issue Jun 2, 2014 · 11 comments
Closed

create a nuget package for a single Docopt.cs file #8

prabirshrestha opened this issue Jun 2, 2014 · 11 comments

Comments

@prabirshrestha
Copy link

Something similar to this mono.options. http://www.nuget.org/packages/Mono.Options/
This will allow to easily embed docopt.net.

@voieducode
Copy link
Member

Interesting. What is the advantage of a single cs file over an assembly?

@prabirshrestha
Copy link
Author

It allows me to make the class internal/private to my project. No need ilmerge. Users consuming my library don't care about the details. Allows me to expose only necessary api. Like int App.Execute(args[]) or App.GetHelpText(). Basically allowing me to hide the details.

Try installing SimpleJson. Install-Package SimpleJson to see an example.

Replace the nampespace with namespace $rootnamespace$ and rename the file to Docopt.cs.pp

https://github.com/facebook-csharp-sdk/simple-json/blob/master/jakefile.js#L269-L273

Also would love to have an options like this.

// NOTE: uncomment the following line to make SimpleJson class internal.
//#define SIMPLE_JSON_INTERNAL

https://github.com/facebook-csharp-sdk/simple-json/blob/master/src/SimpleJson/SimpleJson.cs#L22-L23

@voieducode
Copy link
Member

Ok thanks for the explanation, I am going to have a look.—
Sent from Mailbox

On Tue, Jun 3, 2014 at 1:47 AM, Prabir Shrestha [email protected]
wrote:

It allows me to make the class internal/private to my project. No need ilmerge. Users consuming my library don't care about the details. Allows me to expose only necessary api. Like int App.Execute(args[]) or App.GetHelpText(). Basically allowing me to hide the details.
Try installing SimpleJson. Install-Package SimpleJson to see an example.
Replace the nampespace with namespace $rootnamespace$ and rename the file to Docopt.cs.pp
https://github.com/facebook-csharp-sdk/simple-json/blob/master/jakefile.js#L269-L273
Also would love to have an options like this.

// NOTE: uncomment the following line to make SimpleJson class internal.
//#define SIMPLE_JSON_INTERNAL

https://github.com/facebook-csharp-sdk/simple-json/blob/master/src/SimpleJson/SimpleJson.cs#L22-L23

Reply to this email directly or view it on GitHub:
#8 (comment)

@ChrisMissal
Copy link

👍 This approach is nice for small libraries and frameworks in which you'd like to keep the footprint small.

@dhilgarth
Copy link
Contributor

One thing to consider:
When you are using ReSharper and "Clean Up" the code of the complete project, you also clean up this file, making future updates and removals problematic - at least IIRC

@voieducode
Copy link
Member

The way I am planning to implement this is to have a special build step that is going to merge all the cs file into a giant DocOpt.cs and package separately. I don't see myself having to manage this manually.

@dhilgarth
Copy link
Contributor

I was talking about the consuming projects of this file.

@prabirshrestha
Copy link
Author

@voieducode Even I was thinking of a post build step to merge all the files into a single .cs file.

@voieducode
Copy link
Member

@dhilgarth cross communication, this was meant as a general comment on the approach I was thinking of.

Re: resharper, as per http://hadihariri.com/2011/06/27/preventing-items-from-being-analyzed-in-resharper/, just name the .cs file something like Docopt.generated.cs and it will be automatically skipped by resharper.

@voieducode
Copy link
Member

Found a promising powershell solution that decompiles the docoptnet.dll into a single csharp source file using https://github.com/icsharpcode/ILSpy/tree/master/ICSharpCode.Decompiler

@voieducode
Copy link
Member

I will close this issue now as there does not seem to be no more traction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants