-
Notifications
You must be signed in to change notification settings - Fork 0
/
Orchard.proj
76 lines (76 loc) · 4.46 KB
/
Orchard.proj
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
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
<PropertyGroup>
<UpstreamPackagePattern>$(MSBuildProjectDirectory)\Orchard.Source.*.zip</UpstreamPackagePattern>
<UpstreamFolder>$(MSBuildProjectDirectory)\upstream</UpstreamFolder>
<OutputPackageFolder>$(MSBuildProjectDirectory)\pkg</OutputPackageFolder>
<SourceModulesFolder>$(MSBuildProjectDirectory)\pkgsrc</SourceModulesFolder>
<BinaryModulesFolder>$(MSBuildProjectDirectory)\pkgbin</BinaryModulesFolder>
<NuGet>$(MSBuildProjectDirectory)\nuget.exe</NuGet>
<GalleryArtifactFolder>$(UpstreamFolder)\artifacts\Gallery</GalleryArtifactFolder>
<GalleryFolder>$(UpstreamFolder)\build\Gallery</GalleryFolder>
<MainPackageSpecFolder>$(MSBuildProjectDirectory)</MainPackageSpecFolder>
<OverrideFolder>$(MSBuildProjectDirectory)\override</OverrideFolder>
<PackagePublishUrl>http://nuget.gw.symbolsource.org/Public/Orchard</PackagePublishUrl>
<ModuleCompilerProject>$(MSBuildProjectDirectory)\src\ConsoleApplication1\ConsoleApplication1.sln</ModuleCompilerProject>
<ModuleCompiler>$(MSBuildProjectDirectory)\src\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe</ModuleCompiler>
<CacheFolder>$(MSBuildProjectDirectory)\cache</CacheFolder>
</PropertyGroup>
<ItemGroup>
<UpstreamPackage Include="$(UpstreamPackagePattern)" />
<HostingPackageSpec Include="$(MainPackageSpecFolder)\*.Hosting.nuspec" />
<MainPackageSpec Include="$(MainPackageSpecFolder)\*.nuspec" Exclude="@(HostingPackageSpec)" />
<OverrideFile Include="$(OverrideFolder)\**\*.*" />
</ItemGroup>
<Target Name="Build">
<CallTarget Targets="Clean;Compile;Package" />
</Target>
<Target Name="Compile">
<Unzip ZipFileName="@(UpstreamPackage)" TargetDirectory="$(UpstreamFolder)" Condition="!Exists($(UpstreamFolder))" />
<MSBuild Projects="$(UpstreamFolder)\Orchard.proj" Targets="Compile" />
<MSBuild Projects="$(ModuleCompilerProject)" Targets="Build" />
</Target>
<Target Name="Package">
<CallTarget Targets="Package-Main;Stage-Modules;Package-Modules" />
<MSBuild Projects="$(UpstreamFolder)\Orchard.proj" Targets="Package-Stage;Gallery" />
<Copy SourceFiles="@(OverrideFile)" DestinationFiles="@(OverrideFile->'$(GalleryFolder)\%(RecursiveDir)%(Filename)%(Extension)')" />
<CallTarget Targets="Stage-Modules;Package-Modules;Stage-Themes" />
</Target>
<Target Name="Package-Main">
<MakeDir Directories="$(OutputPackageFolder);$(SourceModulesFolder);$(BinaryModulesFolder)" />
<Exec Command="$(NuGet) pack %(MainPackageSpec.Identity) -OutputDirectory $(OutputPackageFolder) -BasePath $(UpstreamFolder)" />
</Target>
<Target Name="Stage-Modules">
<ItemGroup>
<ModuleDescriptor Include="$(GalleryFolder)\Modules\**\Module.txt" />
<ModuleName Include="@(ModuleDescriptor->'%(RecursiveDir)'->Replace('\', ''))" />
</ItemGroup>
<Exec Command=""$(GalleryFolder)\bin\Orchard.exe" package create %(ModuleName.Identity) "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)" />
</Target>
<Target Name="Stage-Themes">
<ItemGroup>
<ThemeDescriptor Include="$(GalleryFolder)\Themes\**\Theme.txt" />
<ThemeName Include="@(ThemeDescriptor->'%(RecursiveDir)'->Replace('\', ''))" />
</ItemGroup>
<Exec Command=""$(GalleryFolder)\bin\Orchard.exe" package create %(ThemeName.Identity) "$(GalleryArtifactFolder)"" WorkingDirectory="$(GalleryFolder)" />
</Target>
<Target Name="Package-Modules">
<ItemGroup>
<ModulePackage Include="$(GalleryArtifactFolder)\Orchard.Module.*.nupkg" />
</ItemGroup>
<Message Text="%(ModulePackage.Identity)" />
<Copy SourceFiles="@(ModulePackage)" DestinationFolder="$(SourceModulesFolder)" />
<Exec Command=""$(ModuleCompiler)" "$(OutputPackageFolder)" "$(SourceModulesFolder)" "$(BinaryModulesFolder)" "$(CacheFolder)"" />
</Target>
<Target Name="Clean">
<RemoveDir Directories="$(UpstreamFolder);$(OutputPackageFolder);$(SourceModulesFolder);$(BinaryModulesFolder);$(CacheFolder)" />
<MSBuild Projects="$(ModuleCompilerProject)" Targets="Clean" />
</Target>
<Target Name="Publish">
<ItemGroup>
<Package Include="$(OutputPackageFolder)\*.nupkg" />
<Package Include="$(BinaryModulesFolder)\*.nupkg" />
</ItemGroup>
<Exec Command="$(NuGet) push %(Package.Identity) -Source $(PackagePublishUrl)" />
</Target>
</Project>