-
Notifications
You must be signed in to change notification settings - Fork 111
Add nuspec and build file #77
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
Conversation
<authors>Microsoft</authors> | ||
<owners>Microsoft,aspnet</owners> | ||
<requireLicenseAcceptance>true</requireLicenseAcceptance> | ||
<licenseUrl>http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm</licenseUrl> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same set of comments from aspnet/jquery-ajax-unobtrusive#31 apply here.
@Eilon Updated |
@Eilon added a build script that picks up version from the file "version", updates the package.json with the version in that file, minifies the script using that new version and then packs a NuGet nupkg from the nuspec file with the same version Added a release checklist: |
I said version 5 times in that comment 😲 |
@anurse I don't have much experience with node/npm, so do you think updating the package.json version (for a new release) and then running "npm publish" when ready is enough? I used this as a guide https://docs.npmjs.com/getting-started/publishing-npm-packages#how-to-update-a-package I ask because for SignalR you guys have more stuff (like a build and artifacts directory that you clean for each build) like "npm pack" and "npm run build" https://github.com/aspnet/SignalR/blob/dev/build/repo.targets#L52. I think that is not required here (probably overkill) but just wanted to see if what I have is enough. |
Assuming this isn't part of our normal day-to-day builds, yeah I think that sounds fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the new pattern! Just a few comments.
build
Outdated
@@ -0,0 +1,18 @@ | |||
<Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file supposed to have a file extension? I should think so, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not need one. Can make it "build.cmd" instead if that's better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To run it we will need to do "msbuild .\build" or "msbuild .\build.cmd" (if we add the .cmd extension)
build
Outdated
<ItemGroup> | ||
<VersionFile Include="version"/> | ||
</ItemGroup> | ||
<!-- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" /> --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the commented-out lines needed?
build
Outdated
<ReadLinesFromFile File="@(VersionFile)"> | ||
<Output TaskParameter="Lines" PropertyName="PackageVersion"/> | ||
</ReadLinesFromFile> | ||
<Exec Command="npm version --no-git-tag-version --allow-same-version $(PackageVersion)" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking - does this change the package.json
file on disk? If so, I'm concerned that someone will check in the updated version by mistake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the "version" file is updated it picks up that version or stays the same.
build
Outdated
<!-- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" /> --> | ||
<PropertyGroup> | ||
<!-- <PackageVersion>$(PackageVersion)</PackageVersion> --> | ||
<NuspecPath>"Microsoft.jQuery.Unobtrusive.Validation.nuspec"</NuspecPath> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are quotes needed within this tag?
build
Outdated
<!-- <PackageVersion>$(PackageVersion)</PackageVersion> --> | ||
<NuspecPath>"Microsoft.jQuery.Unobtrusive.Validation.nuspec"</NuspecPath> | ||
</PropertyGroup> | ||
<Target Name ="Build"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting: Remove space between Name
and =
@Eilon updated |
build.cmd
Outdated
@@ -0,0 +1,16 @@ | |||
<Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a CMD file, so I wouldn't call it that. I think build.msbuild
or even Microsoft.jQuery.Unobtrusive.Validation.msbuild
is fine, then have a build.cmd that runs it.
build.cmd
Outdated
<ReadLinesFromFile File="@(VersionFile)"> | ||
<Output TaskParameter="Lines" PropertyName="PackageVersion"/> | ||
</ReadLinesFromFile> | ||
<Exec Command="npm version --no-git-tag-version --allow-same-version $(PackageVersion)" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jbagga said:
If the "version" file is updated it picks up that version or stays the same.
So it won't update any files on disk, even if the version has been updated? I just want to make sure that the build process doesn't modify files that are checked in, because then someone might check in the overwritten file, which would be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chatted with @jbagga and yes it does update the file on disk, and that's OK, because that's how npm works.
@Eilon Updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Part of #47