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

Compressor fixes and improvements #72

Merged
merged 5 commits into from
May 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .nuget/NuGet.exe
Binary file not shown.
8 changes: 5 additions & 3 deletions .nuget/NuGet.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>

<!-- Property that enables building a package from a project -->
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
<BuildPackage Condition=" '$(BuildPackage)' == '' ">true</BuildPackage>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tried to run nuget manually and it doesn't like .csproj with .teamcity extension.
I enabled nuget build here. So it probably should be disabled for teamcity.


<!-- Determines if package restore consent is required to restore packages -->
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
Expand Down Expand Up @@ -49,10 +49,12 @@

<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
<BuildTool Condition=" $(BuildTool) == '' ">false</BuildTool>
<BuildToolSwitch Condition=" $(BuildTool) == 'true' ">-Tool</BuildToolSwitch>

<!-- Commands -->
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir "$(SolutionDir) " </RestoreCommand>
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties Configuration=$(Configuration) $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties Configuration=$(Configuration) $(NonInteractiveSwitch) $(BuildToolSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>

<!-- We need to ensure packages are restored prior to assembly resolve -->
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
Expand Down Expand Up @@ -118,7 +120,7 @@

Log.LogMessage("Downloading latest version of NuGet.exe...");
WebClient webClient = new WebClient();
webClient.DownloadFile("https://nuget.org/nuget.exe", OutputFilename);
webClient.DownloadFile("https://dist.nuget.org/win-x86-commandline/latest/nuget.exe", OutputFilename);

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions RequireJsNet.Compressor/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("2.1.37.0")]
[assembly: AssemblyFileVersion("2.1.37.0")]
7 changes: 5 additions & 2 deletions RequireJsNet.Compressor/RequireJsNet.Compressor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<BuildTool>true</BuildTool>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down Expand Up @@ -85,14 +86,16 @@
<Compile Include="AutoDependency\Transformations\TransformationCollection.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="YuiCompressor.NET.license.txt">
<None Include="YuiCompressor.NET.license.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</None>
</ItemGroup>
<ItemGroup>
<None Include="json1.json" />
<None Include="packages.config" />
<None Include="README.md" />
<None Include="RequireJsNet.Compressor.nuspec" />
<None Include="RequireJsNet.Compressor.targets" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RequireJsNet\RequireJsNet.csproj">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<version>2.0.0</version>
<id>$id$</id>
<version>$version$</version>
<authors>Cezar Cretu</authors>
<owners>VeriTech</owners>
<id>RequireJsNet.Compressor</id>
<title>RequireJS.NET Compressor</title>
<copyright>VeriTech Solutions SRL 2014</copyright>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
Expand All @@ -14,20 +14,15 @@
<projectUrl>https://github.com/vtfuture/RequireJSDotNet</projectUrl>
<licenseUrl>https://github.com/vtfuture/RequireJSDotNet/blob/master/MIT-LICENSE.txt</licenseUrl>
<iconUrl>http://requirejsnet.veritech.io/img/require-32x32-comp.png</iconUrl>
<developmentDependency>true</developmentDependency>
<frameworkAssemblies>
<frameworkAssembly assemblyName="Microsoft.Web.Infrastructure" targetFramework=".NETFramework4.0" />
</frameworkAssemblies>
<dependencies>
<dependency id="Newtonsoft.Json" version="7.0.0" />
<dependency id="YUICompressor.NET" version="2.7.0.0" />
<dependency id="Jint" version="2.5.0" />
<dependency id="RequireJsNet" />
</dependencies>
</metadata>
<files>
<file src="..\RequireJsNet.Compressor\bin\Debug\RequireJsNet.Compressor.dll" target="lib\net40\" />
<file src="..\RequireJsNet.Compressor\bin\Debug\RequireJsNet.Compressor.pdb" target="lib\net40\" />
<file src="..\RequireJsNet.Compressor\bin\Debug\YuiCompressor.NET.license.txt" target="lib\net40\" />
<file src="..\**\*.cs" target="src" />
<file src="bin\$configuration$\*.dll" target="tools" />
<file src="bin\$configuration$\*.pdb" target="tools" />
<file src="YuiCompressor.NET.license.txt" target="tools" />
<file src="RequireJsNet.Compressor.targets" target="build" />
</files>
</package>
</package>
47 changes: 47 additions & 0 deletions RequireJsNet.Compressor/RequireJsNet.Compressor.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<AvailableItemName Include="RequireJsNetConfig">
<Visible>false</Visible>
</AvailableItemName>
</ItemGroup>

<PropertyGroup>
<!-- User can define this properties in the proj file if necessary -->
<RequireJsNetLoggingType Condition="$(RequireJsNetLoggingType) == ''">Info</RequireJsNetLoggingType>
<RequireJsNetAutoCompressor Condition="$(RequireJsNetAutoCompressor) == ''">true</RequireJsNetAutoCompressor>
<RequireJsNetEncodingType Condition="$(RequireJsNetEncodingType) == ''">UTF8</RequireJsNetEncodingType>
<RequireJsNetProjectPath Condition="$(RequireJsNetProjectPath) == ''">$(MSBuildProjectDirectory)</RequireJsNetProjectPath>
<RequireJsNetEntryPointOverride Condition="$(RequireJsNetEntryPointOverride) == ''">$(MSBuildProjectDirectory)\Scripts\</RequireJsNetEntryPointOverride>
<!--<BuildDependsOn>
RequireJsNetMinify;
RequireJsNetMinifyForDeploy;
$(BuildDependsOn);
</BuildDependsOn>-->
</PropertyGroup>

<UsingTask TaskName="RequireCompressorTask" AssemblyFile="$(MSBuildThisFileDirectory)\..\tools\RequireJsNet.Compressor.dll" />

<ItemGroup>
<RequireJsNetConfig Include="$(MSBuildProjectDirectory)\RequireJS.json" />
</ItemGroup>

<Target Name="RequireJsNetMinify" AfterTargets="AfterBuild">
<RequireCompressorTask
LoggingType="$(RequireJsNetLoggingType)"
RequireConfigs="@(RequireJsNetConfig)"
AutoCompressor="$(RequireJsNetAutoCompressor)"
EncodingType="$(RequireJsNetEncodingType)"
ProjectPath="$(RequireJsNetProjectPath)"
EntryPointOverride="$(RequireJsNetEntryPointOverride)" />
</Target>

<Target Name="RequireJsNetMinifyForDeploy" AfterTargets="CopyAllFilesToSingleFolderForMsdeploy">
<RequireCompressorTask
LoggingType="$(RequireJsNetLoggingType)"
RequireConfigs="@(RequireJsNetConfig)"
AutoCompressor="$(RequireJsNetAutoCompressor)"
EncodingType="$(RequireJsNetEncodingType)"
ProjectPath="$(RequireJsNetProjectPath)"
EntryPointOverride="$(RequireJsNetEntryPointOverride)" />
</Target>
</Project>
6 changes: 3 additions & 3 deletions RequireJsNet.Compressor/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EcmaScript.Net" version="1.0.1.0" targetFramework="net40" />
<package id="Jint" version="2.5.0" targetFramework="net40" />
<package id="YUICompressor.NET" version="2.7.0.0" targetFramework="net40" />
<package id="EcmaScript.Net" version="1.0.1.0" targetFramework="net40" developmentDependency="true" />
<package id="Jint" version="2.5.0" targetFramework="net40" developmentDependency="true" />
<package id="YUICompressor.NET" version="2.7.0.0" targetFramework="net40" developmentDependency="true" />
</packages>
1 change: 0 additions & 1 deletion RequireJsNet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{42DBB5
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuspec", ".nuspec", "{C5F4AF3C-C654-4210-9A23-F74693A574EC}"
ProjectSection(SolutionItems) = preProject
.nuspec\RequireJsNet.Compressor.nuspec = .nuspec\RequireJsNet.Compressor.nuspec
.nuspec\RequireJsNet.nuspec = .nuspec\RequireJsNet.nuspec
.nuspec\RequireJsNet.ResxToJs.nuspec = .nuspec\RequireJsNet.ResxToJs.nuspec
.nuspec\RequireJsNet.Scripts.nuspec = .nuspec\RequireJsNet.Scripts.nuspec
Expand Down