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

尝试修复跨平台构建 #106

Merged
merged 2 commits into from
Jan 4, 2021
Merged
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
14 changes: 10 additions & 4 deletions src/dotnetCampus.SourceYard/Assets/Current/Core.targets
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,19 @@

<!--打包第三步,无论多框架还是单框架只执行一次-->
<Target Name="SourceYardStep3">
<PropertyGroup>

<!-- 开发者自己有指定路径,但是路径里面不存在应用 -->
<Error Text="Can not find SourceYardApplicationFilePath $(SourceYardApplicationFilePath)" Condition="'$(SourceYardApplicationFilePath)' != '' And !Exists($(SourceYardApplicationFilePath))"/>

<PropertyGroup Condition="'$(SourceYardApplicationFilePath)' == ''">
<!-- 给定默认的 SourceYard 路径名 -->
<SourceYardApplicationFilePath Condition="'$(SourceYardApplicationFilePath)' == ''">$(MSBuildThisFileDirectory)..\tools\net45\dotnetCampus.SourceYard.exe</SourceYardApplicationFilePath>
<!-- 我们使用 $(MSBuildRuntimeType) 来判断编译器是 .NET Core 的还是 .NET Framework 的。
然后选用对应的工具。-->
<!--The type of the runtime that is currently executing. Introduced in MSBuild 15. Value may be undefined (prior to MSBuild 15), Full indicating that MSBuild is running on the desktop .NET Framework, Core indicating that MSBuild is running on .NET Core (for example in dotnet build), or Mono indicating that MSBuild is running on Mono.-->
<SourceYardApplicationFilePath Condition=" '$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tools\net45\dotnetCampus.SourceYard.exe</SourceYardApplicationFilePath>
<SourceYardApplicationFilePath Condition=" '$(MSBuildRuntimeType)' == 'Core'">dotnet $(MSBuildThisFileDirectory)../tools/netcoreapp2.0/dotnetCampus.SourceYard.dll</SourceYardApplicationFilePath>
</PropertyGroup>

<Error Text="Can not find SourceYardApplicationFilePath $(SourceYardApplicationFilePath)" Condition="!Exists($(SourceYardApplicationFilePath))"/>

<Exec
Command="$(SourceYardApplicationFilePath) $(SourceMSBuildProjectFullPath) $(SourceIntermediateDirectory) $(SourcePackageOutputPath) $(SourceYardPackageVersion) --Compile $(CompileTextFile) --Resource $(ResourceTextFile) --Content $(ContentTextFile) --Page $(PageTextFile) --ApplicationDefinition $(ApplicationDefinitionTextFile) --None $(NoneTextFile) --EmbeddedResource $(EmbeddedResourceTextFile) $(SourceYardAuthors) $(SourceYardRepositoryUrl) $(SourceYardRepositoryType) $(SourceYardPackageProjectUrl) $(SourceYardCopyright) $(SourceYardDescription) $(SourceYardTitle) $(SourceYardPackageLicenseUrl) $(SourceYardPackageReleaseNotes) $(SourceYardPackageTags) $(SourceYardOwner) $(SourceYardPackageId) $(SourcePackageReferenceVersion) --SourcePackingDirectory $(SourcePackingDirectory) --TargetFrameworks &quot;$(TargetFrameworks) &quot; --TargetFramework &quot;$(TargetFramework) &quot;">
</Exec>
Expand Down