Skip to content

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

Merged
merged 8 commits into from
Mar 12, 2018
Merged

Add nuspec and build file #77

merged 8 commits into from
Mar 12, 2018

Conversation

jbagga
Copy link
Contributor

@jbagga jbagga commented Mar 5, 2018

Part of #47

@jbagga jbagga requested review from natemcmaster and Eilon March 5, 2018 20:36
<authors>Microsoft</authors>
<owners>Microsoft,aspnet</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm</licenseUrl>
Copy link
Contributor

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.

@jbagga
Copy link
Contributor Author

jbagga commented Mar 5, 2018

@Eilon Updated

@jbagga
Copy link
Contributor Author

jbagga commented Mar 8, 2018

@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:
https://github.com/aspnet/jquery-validation-unobtrusive/wiki/Release-checklist

@jbagga
Copy link
Contributor Author

jbagga commented Mar 8, 2018

I said version 5 times in that comment 😲

@jbagga
Copy link
Contributor Author

jbagga commented Mar 8, 2018

@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.

@analogrelay
Copy link

Assuming this isn't part of our normal day-to-day builds, yeah I think that sounds fine.

Copy link
Contributor

@Eilon Eilon left a 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>
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor Author

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" /> -->
Copy link
Contributor

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)" />
Copy link
Contributor

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.

Copy link
Contributor Author

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>
Copy link
Contributor

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">
Copy link
Contributor

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 =

@jbagga jbagga changed the title Add nuspec Add nuspec and build file Mar 12, 2018
@jbagga
Copy link
Contributor Author

jbagga commented Mar 12, 2018

@Eilon updated

build.cmd Outdated
@@ -0,0 +1,16 @@
<Project>
Copy link
Contributor

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)" />
Copy link
Contributor

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.

Copy link
Contributor

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.

@jbagga
Copy link
Contributor Author

jbagga commented Mar 12, 2018

@Eilon Updated

Copy link
Contributor

@Eilon Eilon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@jbagga jbagga merged commit 6c2113e into master Mar 12, 2018
@jbagga jbagga deleted the jbagga/AjaxUpdate47 branch March 12, 2018 21:10
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

Successfully merging this pull request may close these issues.

3 participants