diff options
author | unknown <andarno@.redmond.corp.microsoft.com> | 2009-09-27 22:46:25 -0700 |
---|---|---|
committer | unknown <andarno@.redmond.corp.microsoft.com> | 2009-09-27 22:46:25 -0700 |
commit | d059d5cd817805ce2b6c66c9044a3cb4a1967c6a (patch) | |
tree | e91c2cb552b6c3c6ff8727858a7ee088ea600917 /src | |
parent | 927dc2db54daaa41383a1a9f492ff031caac18ae (diff) | |
download | DotNetOpenAuth-d059d5cd817805ce2b6c66c9044a3cb4a1967c6a.zip DotNetOpenAuth-d059d5cd817805ce2b6c66c9044a3cb4a1967c6a.tar.gz DotNetOpenAuth-d059d5cd817805ce2b6c66c9044a3cb4a1967c6a.tar.bz2 |
Added method for preserving copyright notices in minified .js files.
Diffstat (limited to 'src')
5 files changed, 31 insertions, 4 deletions
diff --git a/src/DotNetOpenAuth.BuildTasks/JsPack.cs b/src/DotNetOpenAuth.BuildTasks/JsPack.cs index a6a5b27..fa8c7f0 100644 --- a/src/DotNetOpenAuth.BuildTasks/JsPack.cs +++ b/src/DotNetOpenAuth.BuildTasks/JsPack.cs @@ -55,6 +55,14 @@ namespace DotNetOpenAuth.BuildTasks { Directory.CreateDirectory(Path.GetDirectoryName(this.Outputs[i].ItemSpec)); } + // Minification removes all comments, including copyright notices + // that must remain. So if there's metadata on this item with + // a copyright notice on it, stick it on the front of the file. + string copyright = this.Inputs[i].GetMetadata("Copyright"); + if (!string.IsNullOrEmpty(copyright)) { + output = "/*" + copyright + "*/" + output; + } + File.WriteAllText(this.Outputs[i].ItemSpec, output, Encoding.UTF8); } else { Log.LogMessage(MessageImportance.Low, TaskStrings.SkipPackingJsFile, this.Inputs[i].ItemSpec); diff --git a/src/DotNetOpenAuth/DotNetOpenAuth.csproj b/src/DotNetOpenAuth/DotNetOpenAuth.csproj index d9b1135..d53b5f3 100644 --- a/src/DotNetOpenAuth/DotNetOpenAuth.csproj +++ b/src/DotNetOpenAuth/DotNetOpenAuth.csproj @@ -12,6 +12,11 @@ <AssemblyName>DotNetOpenAuth</AssemblyName> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> + <StandardCopyright> +Copyright (c) 2009, Andrew Arnott. All rights reserved. +Code licensed under the Ms-PL License: +http://opensource.org/licenses/ms-pl.html +</StandardCopyright> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -589,7 +594,9 @@ <EmbeddedResource Include="OpenId\RelyingParty\login_failure.png" /> <EmbeddedResource Include="OpenId\RelyingParty\login_success %28lock%29.png" /> <EmbeddedResource Include="OpenId\RelyingParty\login_success.png" /> - <EmbeddedResource Include="OpenId\RelyingParty\OpenIdAjaxTextBox.js" /> + <EmbeddedResource Include="OpenId\RelyingParty\OpenIdAjaxTextBox.js"> + <Copyright>$(StandardCopyright)</Copyright> + </EmbeddedResource> <EmbeddedResource Include="OpenId\RelyingParty\spinner.gif" /> </ItemGroup> <ItemGroup> @@ -610,10 +617,14 @@ <EmbeddedResource Include="InfoCard\infocard_71x50.png" /> <EmbeddedResource Include="InfoCard\infocard_81x57.png" /> <EmbeddedResource Include="InfoCard\infocard_92x64.png" /> - <EmbeddedResource Include="InfoCard\SupportingScript.js" /> + <EmbeddedResource Include="InfoCard\SupportingScript.js"> + <Copyright>$(StandardCopyright)</Copyright> + </EmbeddedResource> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="OpenId\RelyingParty\OpenIdRelyingPartyControlBase.js" /> + <EmbeddedResource Include="OpenId\RelyingParty\OpenIdRelyingPartyControlBase.js"> + <Copyright>$(StandardCopyright)</Copyright> + </EmbeddedResource> </ItemGroup> <ItemGroup> <EmbeddedResource Include="InfoCard\InfoCardStrings.sr.resx" /> @@ -625,7 +636,9 @@ </EmbeddedResource> <EmbeddedResource Include="OpenId\Behaviors\BehaviorStrings.sr.resx" /> <EmbeddedResource Include="OpenId\OpenIdStrings.sr.resx" /> - <EmbeddedResource Include="OpenId\RelyingParty\OpenIdRelyingPartyAjaxControlBase.js" /> + <EmbeddedResource Include="OpenId\RelyingParty\OpenIdRelyingPartyAjaxControlBase.js"> + <Copyright>$(StandardCopyright)</Copyright> + </EmbeddedResource> <EmbeddedResource Include="Strings.sr.resx" /> <EmbeddedResource Include="Xrds\XrdsStrings.sr.resx" /> </ItemGroup> diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdAjaxTextBox.js b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdAjaxTextBox.js index 4f5a471..827ccb6 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdAjaxTextBox.js +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdAjaxTextBox.js @@ -1,6 +1,8 @@ //----------------------------------------------------------------------- // <copyright file="OpenIdAjaxTextBox.js" company="Andrew Arnott"> // Copyright (c) Andrew Arnott. All rights reserved. +// This file may be used and redistributed under the terms of the +// Microsoft Public License (Ms-PL) http://opensource.org/licenses/ms-pl.html // </copyright> //----------------------------------------------------------------------- diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.js b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.js index 2624358..54dbab2 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.js +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.js @@ -1,6 +1,8 @@ //----------------------------------------------------------------------- // <copyright file="OpenIdRelyingPartyAjaxControlBase.js" company="Andrew Arnott"> // Copyright (c) Andrew Arnott. All rights reserved. +// This file may be used and redistributed under the terms of the +// Microsoft Public License (Ms-PL) http://opensource.org/licenses/ms-pl.html // </copyright> //----------------------------------------------------------------------- diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.js b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.js index 0ee0a7f..3739e5c 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.js +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.js @@ -1,6 +1,8 @@ //----------------------------------------------------------------------- // <copyright file="OpenIdRelyingPartyControlBase.js" company="Andrew Arnott"> // Copyright (c) Andrew Arnott. All rights reserved. +// This file may be used and redistributed under the terms of the +// Microsoft Public License (Ms-PL) http://opensource.org/licenses/ms-pl.html // </copyright> //----------------------------------------------------------------------- |