|
1 | 1 | <?xml version="1.0" encoding="utf-8"?>
|
2 | 2 | <Project Skd="Microsoft.NET.Sdk">
|
3 | 3 | <PropertyGroup>
|
4 |
| - <MSBuildCommunityTasksPath>$(MSBuildProjectDirectory)\..\packages\MSBuildTasks.1.4.0.88\tools</MSBuildCommunityTasksPath> |
5 |
| - <TargetDir>$(MSBuildProjectDirectory)\bin</TargetDir> |
| 4 | + <MSBuildCommunityTasksPath>$(USERPROFILE)\.nuget\packages\msbuildtasks\1.5.0.235\tools</MSBuildCommunityTasksPath> |
6 | 5 | </PropertyGroup>
|
7 | 6 |
|
8 | 7 | <Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets" Condition="Exists('$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets')" />
|
| 8 | + <Import Project="common.targets" /> |
9 | 9 | <Import Project="package.apikey.targets" />
|
10 | 10 |
|
11 | 11 | <ItemGroup>
|
12 |
| - <!--<ZipFile Include="$(MSBuildProjectDirectory)\..\NeoLuaD\bin\Release\Neo.Lua.*" /> |
13 |
| - <ZipFile Include="$(MSBuildProjectDirectory)\..\NeoLuaD\bin\Release\de\*" /> |
| 12 | + <ZipFileCmd Include="$(MSBuildProjectDirectory)\..\NeoCmd\bin\Release\net47\NeoCmd.exe" /> |
| 13 | + <ZipFileCmd Include="$(MSBuildProjectDirectory)\..\NeoCmd\bin\Release\net47\NeoCmd.exe.config" /> |
| 14 | + <ZipFileCmd Include="$(MSBuildProjectDirectory)\..\NeoCmd\bin\Release\net47\Neo.Lua.dll" /> |
| 15 | + <ZipFileCmd Include="$(MSBuildProjectDirectory)\..\NeoCmd\bin\Release\net47\Neo.Lua.Dbg.dll" /> |
| 16 | + <ZipFileCmd Include="$(MSBuildProjectDirectory)\..\NeoCmd\bin\Release\net47\Microsoft.Dynamic.dll" /> |
| 17 | + <ZipFileCmd Include="$(MSBuildProjectDirectory)\..\NeoCmd\bin\Release\net47\Microsoft.Scripting.dll" /> |
| 18 | + <ZipFileCmd Include="$(MSBuildProjectDirectory)\..\NeoCmd\bin\Release\net47\Microsoft.Scripting.Metadata.dll" /> |
| 19 | + <ZipFileCmd Include="$(MSBuildProjectDirectory)\..\NeoCmd\bin\Release\net47\de\*" /> |
| 20 | + <ZipFileCmd Include="$(MSBuildProjectDirectory)\..\NeoCmd\Samples\*.lua" /> |
| 21 | + </ItemGroup> |
14 | 22 |
|
15 |
| - <ZipFileDbg Include="$(MSBuildProjectDirectory)\..\NeoLua.Dbg\bin\Release\Microsoft.Dynamic.dll" /> |
16 |
| - <ZipFileDbg Include="$(MSBuildProjectDirectory)\..\NeoLua.Dbg\bin\Release\Microsoft.Scripting.dll" /> |
17 |
| - <ZipFileDbg Include="$(MSBuildProjectDirectory)\..\NeoLua.Dbg\bin\Release\Microsoft.Scripting.Metadata.dll" /> |
18 |
| - <ZipFileDbg Include="$(MSBuildProjectDirectory)\..\NeoLua.Dbg\bin\Release\Neo.Lua.Dbg.*" /> |
| 23 | + <ItemGroup> |
| 24 | + <Project Include="..\NeoLua\NeoLua.csproj"> |
| 25 | + <Package>true</Package> |
| 26 | + </Project> |
| 27 | + <Project Include="..\NeoLua.Dbg\NeoLua.Dbg.csproj"> |
| 28 | + <Package>true</Package> |
| 29 | + </Project> |
| 30 | + <Project Include="..\NeoLua.MSBuild\NeoLua.MSBuild.csproj"> |
| 31 | + <Package>true</Package> |
| 32 | + </Project> |
| 33 | + <Project Include="..\NeoCmd\NeoCmd.csproj"> |
| 34 | + <Package>false</Package> |
| 35 | + </Project> |
| 36 | + </ItemGroup> |
19 | 37 |
|
20 |
| - <ZipFileMSB Include="$(MSBuildProjectDirectory)\..\NeoLua.MSBuild\bin\Release\de\*" /> |
21 |
| - <ZipFileMSB Include="$(MSBuildProjectDirectory)\..\NeoLua.MSBuild\bin\Release\Neo.Lua.dll" /> |
22 |
| - <ZipFileMSB Include="$(MSBuildProjectDirectory)\..\NeoLua.MSBuild\bin\Release\Neo.Lua.Desktop.dll" /> |
23 |
| - <ZipFileMSB Include="$(MSBuildProjectDirectory)\..\NeoLua.MSBuild\bin\Release\Neo.Lua.MSBuild.dll" /> |
| 38 | + <Target Name="PrepareOutput"> |
| 39 | + <MakeDir Directories="$(TargetDir)\$(Version)" /> |
| 40 | + </Target> |
24 | 41 |
|
25 |
| - <ZipFileCmd Include="$(MSBuildProjectDirectory)\..\NeoCmd\bin\Release\NeoCmd.exe" /> |
26 |
| - <ZipFileCmd Include="$(MSBuildProjectDirectory)\..\NeoCmd\bin\Release\Neo.Lua.dll" /> |
27 |
| - <ZipFileCmd Include="$(MSBuildProjectDirectory)\..\NeoCmd\bin\Release\Neo.Lua.Desktop.dll" /> |
28 |
| - <ZipFileCmd Include="$(MSBuildProjectDirectory)\..\NeoCmd\bin\Release\Neo.Lua.Dbg.dll" /> |
29 |
| - <ZipFileCmd Include="$(MSBuildProjectDirectory)\..\NeoCmd\bin\Release\Microsoft.Dynamic.dll" /> |
30 |
| - <ZipFileCmd Include="$(MSBuildProjectDirectory)\..\NeoCmd\bin\Release\Microsoft.Scripting.dll" /> |
31 |
| - <ZipFileCmd Include="$(MSBuildProjectDirectory)\..\NeoCmd\bin\Release\Microsoft.Scripting.Metadata.dll" /> |
32 |
| - <ZipFileCmd Include="$(MSBuildProjectDirectory)\..\NeoCmd\bin\Release\de\*" /> |
33 |
| - <ZipFileCmd Include="$(MSBuildProjectDirectory)\..\NeoCmd\Samples\*.lua" />--> |
34 |
| - </ItemGroup> |
35 |
| - |
36 |
| - <Target Name="PrepareVersion"> |
37 |
| - <ReadLinesFromFile File="$(MSBuildProjectDirectory)\..\NeoLua\Properties\AssemblyInfoGlobal.cs"> |
38 |
| - <Output TaskParameter="Lines" ItemName="AssemblyInfoGlobalContent" /> |
39 |
| - </ReadLinesFromFile> |
40 |
| - <PropertyGroup> |
41 |
| - <AssemblyInfoGlobalLines>@(AssemblyInfoGlobalContent)</AssemblyInfoGlobalLines> |
42 |
| - </PropertyGroup> |
43 |
| - <PropertyGroup> |
44 |
| - <Pattern2>\;\[assembly: AssemblyConfiguration\(.(\w*)</Pattern2> |
45 |
| - <AssemblyConfig>$([System.Text.RegularExpressions.Regex]::Match($(AssemblyInfoGlobalLines), $(Pattern2)))</AssemblyConfig> |
46 |
| - <VersionAdd>$(AssemblyConfig.Remove(0, 35))</VersionAdd> |
47 |
| - </PropertyGroup> |
48 |
| - <PropertyGroup> |
49 |
| - <Pattern1>\[assembly: AssemblyFileVersion\(.(\d+)\.(\d+)\.(\d+)</Pattern1> |
50 |
| - <AssemblyVersionLine>$([System.Text.RegularExpressions.Regex]::Match($(AssemblyInfoGlobalLines), $(Pattern1)))</AssemblyVersionLine> |
51 |
| - <Version Condition="'$(VersionAdd)' != ''">$(AssemblyVersionLine.Remove(0, 32))-$(VersionAdd)</Version> |
52 |
| - <Version Condition="'$(VersionAdd)' == ''">$(AssemblyVersionLine.Remove(0, 32))</Version> |
53 |
| - </PropertyGroup> |
54 |
| - <Message Text="Version: $(Version)" /> |
| 42 | + <Target Name="CompileProjects"> |
| 43 | + <MSBuild Targets="Restore;Build;Pack" Projects="@(Project)" Properties="Platform=AnyCPU;Configuration=Release" Condition="%(Project.Package) == true" /> |
| 44 | + <MSBuild Targets="Restore;Build" Projects="@(Project)" Properties="Platform=AnyCPU;Configuration=Release" Condition="%(Project.Package) == false" /> |
55 | 45 | </Target>
|
56 | 46 |
|
57 |
| - <Target Name="CleanCore"> |
| 47 | + <Target Name="ZipFiles"> |
| 48 | + <Zip Files="@(ZipFileCmd)" WorkingDirectory="$(MSBuildProjectDirectory)\..\NeoCmd\bin\Release\net47" ZipFileName="$(PackageOutputPath)\NeoLuaCmd-$(PackageVersion).zip" /> |
| 49 | + </Target> |
58 | 50 |
|
| 51 | + <Target Name="PushCore" Condition="'$(Configuration)'=='Release'"> |
| 52 | + <Exec Command="c:\Tools\NuGet.exe push $(PackageOutputPath)\NeoLua.$(PackageVersion).nupkg -source https://api.nuget.org/v3/index.json -ApiKey $(NugetApiKey)" /> |
| 53 | + <Exec Command="c:\Tools\NuGet.exe push $(PackageOutputPath)\NeoLuaDebug.$(PackageVersion).nupkg -source https://api.nuget.org/v3/index.json -ApiKey $(NugetApiKey)" /> |
59 | 54 | </Target>
|
60 |
| - <Target Name="BuildCore" DependsOnTargets="PrepareVersion" Condition=" '$(Configuration)' == 'Release' "> |
61 |
| - <!-- Create Directory --> |
62 |
| - <MakeDir Directories="$(TargetDir)\$(Version)" /> |
63 | 55 |
|
64 |
| - <!-- Zip |
65 |
| - <Zip Files="@(ZipFile)" WorkingDirectory="$(MSBuildProjectDirectory)\..\NeoLuaD\bin\Release" ZipFileName="$(TargetDir)\$(Version)\NeoLua-$(Version).zip" /> |
66 |
| - <Zip Files="@(ZipFileMSB)" WorkingDirectory="$(MSBuildProjectDirectory)\..\NeoLua.MSBuild\bin\Release" ZipFileName="$(TargetDir)\$(Version)\NeoLuaMSBuild-$(Version).zip" /> |
67 |
| - <Zip Files="@(ZipFileDbg)" WorkingDirectory="$(MSBuildProjectDirectory)\..\NeoLua.Dbg\bin\Release" ZipFileName="$(TargetDir)\$(Version)\NeoLuaDbg-$(Version).zip" /> |
68 |
| - <Zip Files="@(ZipFileCmd)" WorkingDirectory="$(MSBuildProjectDirectory)\..\NeoCmd\bin\Release" ZipFileName="$(TargetDir)\$(Version)\NeoLuaCmd-$(Version).zip" /> --> |
| 56 | + <Target Name="Push" DependsOnTargets="PrepareOutput;CompileProjects;ZipFiles;PushCore"> |
| 57 | + </Target> |
69 | 58 |
|
70 | 59 | <!-- Create NuGet Package
|
71 | 60 | <Exec Command="c:\Tools\NuGet.exe pack NeoLua.nuspec -OutputDirectory $(TargetDir)\$(Version) -Version $(Version)" />
|
72 | 61 | <Exec Command="c:\Tools\NuGet.exe pack NeoLuaDebug.nuspec -OutputDirectory $(TargetDir)\$(Version) -Version $(Version)" />
|
73 | 62 | <Exec Command="c:\Tools\NuGet.exe push $(TargetDir)\$(Version)\NeoLua.$(Version).nupkg -source https://api.nuget.org/v3/index.json -ApiKey $(NugetApiKey)" />
|
74 | 63 | <Exec Command="c:\Tools\NuGet.exe push $(TargetDir)\$(Version)\NeoLuaDebug.$(Version).nupkg -source https://api.nuget.org/v3/index.json -ApiKey $(NugetApiKey)" /> -->
|
75 |
| - </Target> |
76 | 64 | </Project>
|
77 |
| -<!--<Target Name="ZipLua" Condition=" '$(Configuration)' == 'Release' "> |
78 |
| - <CreateItem Include="$(TargetDir)\Neo.Lua.MSBuild.dll;$(TargetDir)\Neo.Lua.dll;$(TargetDir)\de\*"> |
79 |
| - <Output ItemName="ZipFile" TaskParameter="Include" /> |
80 |
| - </CreateItem> |
81 |
| - <Zip Files="@(ZipFile)" WorkingDirectory="$(TargetDir)" ZipFileName="$(TargetDir)\NeoLuaMSBuild-$(Version).zip" /> |
82 |
| - </Target> |
83 |
| - <Target Name="NuGet" Condition=" '$(Configuration)' == 'Release' "> |
84 |
| - <Exec Command="c:\Projects\Bin\NuGet.exe pack NeoLuaMSBuild.nuspec -OutputDirectory $(TargetDir) -Version $(Version)" /> |
85 |
| - --> |
86 |
| -<!--<Exec Command="c:\Projects\Bin\NuGet.exe push $(TargetDir)NeoLuaMSBuild.$(Version).nupkg" />--> |
87 |
| -<!-- |
88 |
| - </Target>--> |
0 commit comments