forked from pchalamet/cassandra-sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcassandra-sharp.targets
88 lines (70 loc) · 3.75 KB
/
cassandra-sharp.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
86
87
88
<Project ToolsVersion="4.0" DefaultTargets="Compile" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="ThirdParties\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
<PropertyGroup>
<Version>0.0.0.0</Version>
<VersionStatus></VersionStatus>
</PropertyGroup>
<PropertyGroup>
<OutDir>OutDir</OutDir>
</PropertyGroup>
<PropertyGroup>
<ZipDir>$(OutDir)\Zip</ZipDir>
</PropertyGroup>
<PropertyGroup>
<NuGet>ThirdParties\NuGet\NuGet.exe</NuGet>
<NuGetPackageDir>$(OutDir)\NuGetPackage</NuGetPackageDir>
</PropertyGroup>
<PropertyGroup>
<Thrift>ThirdParties\Thrift\thrift-0.9.0.exe</Thrift>
<ThriftInput>Apache.Cassandra\cassandra.thrift</ThriftInput>
<ThriftOutput>Apache.Cassandra</ThriftOutput>
</PropertyGroup>
<PropertyGroup>
<CassandraSharpProjectName>cassandra-sharp</CassandraSharpProjectName>
<CassandraSharpAssembly>CassandraSharp\bin\$(Configuration)\CassandraSharp</CassandraSharpAssembly>
<CQLPlusAssembly>cqlplus\bin\$(Configuration)\cqlplus</CQLPlusAssembly>
<Log4NetAssembly>ThirdParties\log4net\log4net.dll</Log4NetAssembly>
<ChangesFile>CHANGES.txt</ChangesFile>
</PropertyGroup>
<Target Name="Clean">
<Exec Command="rmdir /q /s $(OutDir)" />
<MakeDir Directories="$(OutDir)" />
<MakeDir Directories="$(ZipDir)" />
<MakeDir Directories="$(NuGetPackageDir)" />
</Target>
<Target Name="GenerateAssemblyInfo">
<AssemblyInfo CodeLanguage="CS" AssemblyVersion="$(Version)" AssemblyFileVersion="$(Version)" AssemblyInformationalVersion="$(Version)$(VersionStatus)" OutputFile="$(CassandraSharpProjectName)-version.cs" />
</Target>
<Target Name="GenerateThrift">
<Exec Command="$(Thrift) -o $(ThriftOutput) --gen csharp $(ThriftInput)" />
</Target>
<Target Name="Compile" DependsOnTargets="GenerateAssemblyInfo;GenerateThrift">
<MSBuild Projects="$(CassandraSharpProjectName).sln" />
</Target>
<Target Name="BuildZipPackage" DependsOnTargets="Clean;Compile">
<ItemGroup>
<ZipFilesCopy Include="$(CassandraSharpAssembly).dll" />
<ZipFilesCopy Include="$(CassandraSharpAssembly).pdb" />
<ZipFilesCopy Include="$(CQLPlusAssembly).exe" />
<ZipFilesCopy Include="$(CQLPlusAssembly).pdb" />
<ZipFilesCopy Include="$(ChangesFile)" />
</ItemGroup>
<Copy SourceFiles="@(ZipFilesCopy)" DestinationFolder="$(ZipDir)" />
<ItemGroup>
<ZipFiles Include="$(ZipDir)\**\*.*" />
</ItemGroup>
<Zip ZipFileName="$(OutDir)\$(CassandraSharpProjectName)-bin-$(Version)$(VersionStatus).zip" Files="@(ZipFiles)" WorkingDirectory="$(ZipDir)" ZipLevel="9" />
</Target>
<Target Name="BuildNuGetPackage" DependsOnTargets="Compile">
<Copy SourceFiles="$(CassandraSharpAssembly).dll" DestinationFolder="$(NuGetPackageDir)\lib\net40" />
<Copy SourceFiles="$(CassandraSharpAssembly).pdb" DestinationFolder="$(NuGetPackageDir)\lib\net40" />
<Copy SourceFiles="$(CQLPlusAssembly).exe" DestinationFolder="$(NuGetPackageDir)\lib\net40" />
<Copy SourceFiles="$(CQLPlusAssembly).pdb" DestinationFolder="$(NuGetPackageDir)\lib\net40" />
<Copy SourceFiles="$(CassandraSharpProjectName).nuspec" DestinationFolder="$(NuGetPackageDir)" />
<Copy SourceFiles="$(ChangesFile)" DestinationFolder="$(NuGetPackageDir)" />
<XmlPoke XmlInputPath="$(NuGetPackageDir)\$(CassandraSharpProjectName).nuspec" Query="/package/metadata/version" Value="$(Version)$(VersionStatus)" />
<Exec Command="$(NuGet) pack $(NuGetPackageDir)\$(CassandraSharpProjectName).nuspec -OutputDirectory $(OutDir)" />
</Target>
<Target Name="GenerateVersion" DependsOnTargets="BuildZipPackage;BuildNuGetPackage">
</Target>
</Project>