-
Notifications
You must be signed in to change notification settings - Fork 756
/
Copy pathAEPackage.targets
85 lines (76 loc) · 4.66 KB
/
AEPackage.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DotNetNukeMSBuildTasksLib>$(BuildScriptsPath)\DotNetNuke.MSBuild.Tasks.dll</DotNetNukeMSBuildTasksLib>
<YuiLib>$(BuildScriptsPath)\Yahoo.Yui.Compressor.MsBuild.dll</YuiLib>
</PropertyGroup>
<Import Project="MSBuild.Community.Tasks.Targets" />
<UsingTask AssemblyFile="$(DotNetNukeMSBuildTasksLib)" TaskName="DotNetNuke.MSBuild.Tasks.ExtensionPackager" />
<UsingTask AssemblyFile="$(YuiLib)" TaskName="CssCompressorTask" />
<!--<UsingTask AssemblyFile="$(YuiLib)" TaskName="JavaScriptCompressorTask" />-->
<Target Name="Package" Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<XmlRead Prefix="n"
Namespace="http://schemas.microsoft.com/developer/msbuild/2003"
XPath="dotnetnuke/packages/package/@version"
XmlFileName="$(DNNFileName).dnn">
<Output TaskParameter="Value" PropertyName="Version" />
</XmlRead>
<ExtensionPackager Manifest="$(DNNFileName).dnn" WorkingFolder="$(MSBuildProjectDirectory)\">
<Output TaskParameter="PackageFiles" PropertyName="PackageFiles">
</Output>
</ExtensionPackager>
<CallTarget Targets="Minification"/>
<Copy SourceFiles="$(DNNFileName).dnn" DestinationFolder="$(MSBuildProjectDirectory)\Package" />
<ItemGroup>
<LicenseFiles Include="license.txt"/>
</ItemGroup>
<Copy SourceFiles="@(LicenseFiles)" DestinationFolder="$(MSBuildProjectDirectory)\Package" />
<ItemGroup>
<ReleaseNotesFiles Include="releaseNotes.txt"/>
</ItemGroup>
<Copy SourceFiles="@(ReleaseNotesFiles)" DestinationFolder="$(MSBuildProjectDirectory)\Package" />
<CreateItem Include="$(PackageFiles)">
<Output TaskParameter="Include" ItemName="OutputContent" />
</CreateItem>
<Copy SourceFiles="$(OutputContent)" DestinationFolder="$(MSBuildProjectDirectory)\Package\%(OutputContent.RecursiveDir)" />
<CreateItem Include="$(MSBuildProjectDirectory)\Package\**\*.*">
<Output TaskParameter="Include" ItemName="OutputContent" />
</CreateItem>
<Zip Files="@(OutputContent)" WorkingDirectory="$(MSBuildProjectDirectory)\Package" ZipFileName="$(PackageName)_$(Version)_Install.$(Extension)" />
<Copy SourceFiles="$(MSBuildProjectDirectory)\$(PackageName)_$(Version)_Install.$(Extension)" DestinationFolder="$(WebsiteInstallPath)" />
<Delete Files="$(MSBuildProjectDirectory)\$(PackageName)_$(Version)_Install.$(Extension)" />
<RemoveDir Directories ="$(MSBuildProjectDirectory)\Package" ContinueOnError="WarnAndContinue" />
</Target>
<Target Name="Minification">
<MakeDir Directories="$(MSBuildProjectDirectory)\Package"/>
<Zip Files="@(Resources)" WorkingDirectory="$(MSBuildProjectDirectory)" ZipFileName="$(MSBuildProjectDirectory)\Package\Resources.zip" />
<Unzip ZipFileName="$(MSBuildProjectDirectory)\Package\Resources.zip" TargetDirectory="$(MSBuildProjectDirectory)\Package\Resources" />
<Delete Files="$(MSBuildProjectDirectory)\Package\Resources.zip" />
<ItemGroup>
<!--<_JSFilesToMinify Include="$(MSBuildProjectDirectory)\Package\Resources\**\*.js" Exclude="$(MSBuildProjectDirectory)\Package\Resources\**\*.min.js" />-->
<_Step2FilesToZip Include="$(MSBuildProjectDirectory)\Package\Resources\**\*" />
</ItemGroup>
<!--
<Message Text="Compressing Javascript files" Importance="high" />
<JavaScriptCompressorTask Files="@(_JSFilesToMinify)" ContinueOnError="WarnAndContinue" />
-->
<ItemGroup>
<_CSSFilesToCompress Include="$(MSBuildProjectDirectory)\*\*.css;$(MSBuildProjectDirectory)\*\*\*.css;$(MSBuildProjectDirectory)\*\*\*\*.css;$(MSBuildProjectDirectory)\*\*\*\*\*.css;" Exclude="Package\**\*;**\node_modules\**;**\WebApps\**" />
</ItemGroup>
<Message Text="Compressing the following CSS files:" Importance="high" />
<Message Text="%(_CSSFilesToCompress.Identity)" Importance="high" />
<CssCompressorTask
SourceFiles="@(_CSSFilesToCompress)"
DeleteSourceFiles="false"
OutputFile="$(MSBuildProjectDirectory)\Package\Resources\%(RecursiveDir)%(Filename)%(Extension)"
CompressionType="Standard"
LoggingType="Info"
PreserveComments="false"
LineBreakPosition="-1"
Condition="@(_CSSFilesToCompress->Count())!=0"
/>
<Zip Files="@(_Step2FilesToZip)" WorkingDirectory="$(ResourceZipWorkingDirectory)"
ZipFileName="$(MSBuildProjectDirectory)\Package\Resources.zip" />
<RemoveDir Directories ="$(MSBuildProjectDirectory)\Package\Resources" ContinueOnError="WarnAndContinue" />
</Target>
</Project>