Skip to content
This repository was archived by the owner on Dec 18, 2017. It is now read-only.

Figure out what the default author should be in NUPKGs we generate #208

Closed
Eilon opened this issue May 19, 2014 · 11 comments
Closed

Figure out what the default author should be in NUPKGs we generate #208

Eilon opened this issue May 19, 2014 · 11 comments
Assignees
Milestone

Comments

@Eilon
Copy link
Member

Eilon commented May 19, 2014

On line 143 of this file:

https://github.com/aspnet/KRuntime/blob/dev/src/Microsoft.Framework.Project/BuildManager.cs#L143

The default author is "K". I presume the default should just be blank, or perhaps we pick up from an env var or something else.

But when we make this change we also need to make sure that for our own packages we generate "Microsoft" as the author - perhaps by modifying project.json files or env vars or something.

@tugberkugurlu
Copy link
Contributor

How about getting this value from the git settings? For example the git username?

@aaronpowell
Copy link
Member

Sounds like a fair assumption but there'd need to be fallbacks for when there's no git repo found.

Are the AssemblyInfo attributes (AssemblyCompany, AssemblyTitle, etc) not included in K?

@aaronpowell
Copy link
Member

Actually, how about having another property in the project.json file, like packages.json has - http://browsenpm.org/package.json#contributors

You could even expand it out to grab the readme, source repo, etc from there, and since there's already some synchronisation between kproj and package.json I don't see why VS couldn't have it exposed too.

@davidfowl
Copy link
Member

ENV variables I think are the way to go here. We just need good defaults that don't invovle shelling out to git 😉. @aaronpowell Those attributes all exist but I think we want to be as DRY as possible and keep assembly info down to a minimum. The project.json is the source of truth for assembly metadata and package metadata. You can always override that with assembly attributes but we want that to be the exception.

@davidfowl
Copy link
Member

We can already specify authors, the question is about defaults

@aaronpowell
Copy link
Member

Oh right, I didn't know it could be specified (I haven't looked at the JSON schema for project.json).

Maybe make it a mandatory node in the JSON? In packages.json for Node.js there's a bunch of mandatory fields, author is one of them IIRC.

@ChengTian
Copy link
Contributor

I am going to use the following strategy to determine the default author:
If env var USERNAME has a non-empty value, use the value. Otherwise, if env var USER has a non-empty value, use the value. If we can find neither USERNAME nor USER, we leave the author field blank.

USERNAME is a built-in env var in Windows and it contains current user's login name. USER is the counterpart in Linux.

@Eilon @davidfowl please let me know your thoughts.

@Eilon
Copy link
Member Author

Eilon commented May 30, 2014

I'm not sure you ever want to use a user's login name as the package author. I bet for every single person I know it would be the wrong value... even you 😄

I kind of feel this should be a more specific key for "package author". I bet quite often the "author" will be a company/organization and not a person.

@ChengTian
Copy link
Contributor

We can use a new env var like K_PACKAGE_AUTHOR, but we have to ask users to create this env var. If a user has to specify such a value, why not ask them to specify it directly in project.json? You may want to mention the scenario where a developer has multiple k-based projects, but I am not sure whether the trivial convenience is worthwhile, considering it adds one more item in our manual/readme.

@Eilon
Copy link
Member Author

Eilon commented May 30, 2014

Was having a separate chat with @davidfowl earlier about how to specify general defaults for all kinds of project/NuGet settings, such as license, copyright, etc. So this might be a more general discussion regarding all kinds of project settings that a developer would want to share among their projects.

@ChengTian
Copy link
Contributor

I see, if a big set of information is shared, it brings a lot of convenience.
I think the naming of all kinds of defaults should be consistent if they are all env vars. @davidfowl , do you have the name convention in your mind? Or can I use K_PACKAGE_AUTHOR env var as the source of default author?

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

No branches or pull requests

5 participants