未验证 提交 aa16e806 编写于 作者: W walterlv 提交者: GitHub

Merge pull request #116 from dotnet-campus/t/lindexi/FixCompile

修复在 Ubunut 构建
MIT License MIT License
Copyright (c) 2018-2020 dotnet campus Copyright (c) 2018-2022 dotnet campus
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
<PropertyGroup> <PropertyGroup>
<!-- 用于给多框架存放各个框架的信息的文件的文件夹,各个框架将会在写入到各自的文件里面 --> <!-- 用于给多框架存放各个框架的信息的文件的文件夹,各个框架将会在写入到各自的文件里面 -->
<!-- 选择 BaseIntermediateOutputPath 是因为开发者可以配置不同的框架采用不同的 obj 文件夹,但是对于不同的框架,大部分都是使用相同的 BaseIntermediateOutputPath 文件夹 --> <!-- 选择 BaseIntermediateOutputPath 是因为开发者可以配置不同的框架采用不同的 obj 文件夹,但是对于不同的框架,大部分都是使用相同的 BaseIntermediateOutputPath 文件夹 -->
<_SourceYardMultiTargetingPackageInfoFolder>$(BaseIntermediateOutputPath)$(Configuration)\SourceYardMultiTargetingPackageInfoFolder\</_SourceYardMultiTargetingPackageInfoFolder> <_SourceYardMultiTargetingPackageInfoFolder>$([System.IO.Path]::Combine($(BaseIntermediateOutputPath),$(Configuration),"SourceYardMultiTargetingPackageInfoFolder"))</_SourceYardMultiTargetingPackageInfoFolder>
<!-- <!--
输出形式如: 输出形式如:
- obj\Debug\SourceYardMultiTargetingPackageInfoFolder\net45.txt - obj\Debug\SourceYardMultiTargetingPackageInfoFolder\net45.txt
...@@ -41,39 +42,39 @@ ...@@ -41,39 +42,39 @@
<Target Name="SourceYardStep1"> <Target Name="SourceYardStep1">
<PropertyGroup> <PropertyGroup>
<!-- 用于将各个框架的信息写入的文件 --> <!-- 用于将各个框架的信息写入的文件 -->
<_SourceYardMultiTargetingPackageInfoFile>$(_SourceYardMultiTargetingPackageInfoFolder)$(TargetFramework).txt</_SourceYardMultiTargetingPackageInfoFile> <_SourceYardMultiTargetingPackageInfoFile>$([System.IO.Path]::Combine($(_SourceYardMultiTargetingPackageInfoFolder),"$(TargetFramework).txt"))</_SourceYardMultiTargetingPackageInfoFile>
<!-- 这里不能使用 $(PackingDirectory) 属性,原因是此属性在未打包时是空 --> <!-- 这里不能使用 $(PackingDirectory) 属性,原因是此属性在未打包时是空 -->
<!-- 对于多框架来说,这里的 IntermediateOutputPath 路径格式如 obj\Debug\net45\ --> <!-- 对于多框架来说,这里的 IntermediateOutputPath 路径格式如 obj\Debug\net45\ -->
<SourcePackingDirectory>$(IntermediateOutputPath)SourcePacking\</SourcePackingDirectory> <SourcePackingDirectory>$([System.IO.Path]::Combine($(BaseIntermediateOutputPath),$(IntermediateOutputPath),"SourcePacking"))</SourcePackingDirectory>
<CompileTextFile>$(SourcePackingDirectory)CompileFile.txt</CompileTextFile> <CompileTextFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"CompileFile.txt"))</CompileTextFile>
<ResourceTextFile>$(SourcePackingDirectory)ResourceFile.txt</ResourceTextFile> <ResourceTextFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"ResourceFile.txt"))</ResourceTextFile>
<ContentTextFile>$(SourcePackingDirectory)ContentFile.txt</ContentTextFile> <ContentTextFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"ContentFile.txt"))</ContentTextFile>
<NoneTextFile>$(SourcePackingDirectory)NoneFile.txt</NoneTextFile> <NoneTextFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"NoneFile.txt"))</NoneTextFile>
<EmbeddedResourceTextFile>$(SourcePackingDirectory)EmbeddedResourceFile.txt</EmbeddedResourceTextFile> <EmbeddedResourceTextFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"EmbeddedResourceFile.txt"))</EmbeddedResourceTextFile>
<PageTextFile>$(SourcePackingDirectory)PageFile.txt</PageTextFile> <PageTextFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"PageFile.txt"))</PageTextFile>
<ApplicationDefinitionTextFile>$(SourcePackingDirectory)ApplicationDefinitionFile.txt</ApplicationDefinitionTextFile> <ApplicationDefinitionTextFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"ApplicationDefinitionFile.txt"))</ApplicationDefinitionTextFile>
<DescriptionFile>$(SourcePackingDirectory)DescriptionFile.txt</DescriptionFile> <DescriptionFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"DescriptionFile.txt"))</DescriptionFile>
<CopyrightFile>$(SourcePackingDirectory)CopyrightFile.txt</CopyrightFile> <CopyrightFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"CopyrightFile.txt"))</CopyrightFile>
<PackageReleaseNotesFile>$(SourcePackingDirectory)PackageReleaseNotesFile.txt</PackageReleaseNotesFile> <PackageReleaseNotesFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"PackageReleaseNotesFile.txt"))</PackageReleaseNotesFile>
<PackageReferenceVersionFile>$(SourcePackingDirectory)PackageReferenceVersionFile.txt</PackageReferenceVersionFile> <PackageReferenceVersionFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"PackageReferenceVersionFile.txt"))</PackageReferenceVersionFile>
<FrameworkReferenceVersionFile>$(SourcePackingDirectory)FrameworkReferenceVersionFile.txt</FrameworkReferenceVersionFile> <FrameworkReferenceVersionFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"FrameworkReferenceVersionFile.txt"))</FrameworkReferenceVersionFile>
<SourceProjectPackageFile>$(SourcePackingDirectory)SourceProjectPackageFile.txt</SourceProjectPackageFile> <SourceProjectPackageFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"SourceProjectPackageFile.txt"))</SourceProjectPackageFile>
<SourceYardPackageReferenceFile>$(SourcePackingDirectory)SourceYardPackageReferenceFile.txt</SourceYardPackageReferenceFile> <SourceYardPackageReferenceFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"SourceYardPackageReferenceFile.txt"))</SourceYardPackageReferenceFile>
<!-- 表示不要包含的引用依赖列表 --> <!-- 表示不要包含的引用依赖列表 -->
<SourceYardExcludePackageReferenceFile>$(SourcePackingDirectory)SourceYardExcludePackageReferenceFile.txt</SourceYardExcludePackageReferenceFile> <SourceYardExcludePackageReferenceFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"SourceYardExcludePackageReferenceFile.txt"))</SourceYardExcludePackageReferenceFile>
<!-- 表示不要包含的文件列表 --> <!-- 表示不要包含的文件列表 -->
<SourceYardExcludeFileItemFile>$(SourcePackingDirectory)SourceYardExcludeFileItemFile.txt</SourceYardExcludeFileItemFile> <SourceYardExcludeFileItemFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"SourceYardExcludeFileItemFile.txt"))</SourceYardExcludeFileItemFile>
<SourceYardCompilePackageFile>$(SourcePackingDirectory)SourceYardCompilePackageFile.txt</SourceYardCompilePackageFile> <SourceYardCompilePackageFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"SourceYardCompilePackageFile.txt"))</SourceYardCompilePackageFile>
<SourceYardResourcePackageFile>$(SourcePackingDirectory)SourceYardResourcePackageFile.txt</SourceYardResourcePackageFile> <SourceYardResourcePackageFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"SourceYardResourcePackageFile.txt"))</SourceYardResourcePackageFile>
<SourceYardContentPackageFile>$(SourcePackingDirectory)SourceYardContentPackageFile.txt</SourceYardContentPackageFile> <SourceYardContentPackageFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"SourceYardContentPackageFile.txt"))</SourceYardContentPackageFile>
<SourceYardNonePackageFile>$(SourcePackingDirectory)SourceYardNonePackageFile.txt</SourceYardNonePackageFile> <SourceYardNonePackageFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"SourceYardNonePackageFile.txt"))</SourceYardNonePackageFile>
<SourceYardEmbeddedResourcePackageFile>$(SourcePackingDirectory)SourceYardEmbeddedResourcePackageFile.txt</SourceYardEmbeddedResourcePackageFile> <SourceYardEmbeddedResourcePackageFile>$([System.IO.Path]::Combine($(SourcePackingDirectory),"SourceYardEmbeddedResourcePackageFile.txt"))</SourceYardEmbeddedResourcePackageFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
...@@ -103,24 +104,24 @@ ...@@ -103,24 +104,24 @@
<SourceYardRepositoryUrl Condition="$(RepositoryUrl) != ''">RepositoryUrl "$(RepositoryUrl)"</SourceYardRepositoryUrl> <SourceYardRepositoryUrl Condition="$(RepositoryUrl) != ''">RepositoryUrl "$(RepositoryUrl)"</SourceYardRepositoryUrl>
<SourceYardRepositoryType Condition="$(RepositoryType) != ''">RepositoryType "$(RepositoryType)"</SourceYardRepositoryType> <SourceYardRepositoryType Condition="$(RepositoryType) != ''">RepositoryType "$(RepositoryType)"</SourceYardRepositoryType>
<SourceYardPackageProjectUrl Condition="$(PackageProjectUrl) != ''">PackageProjectUrl "$(PackageProjectUrl)"</SourceYardPackageProjectUrl>--> <SourceYardPackageProjectUrl Condition="$(PackageProjectUrl) != ''">PackageProjectUrl "$(PackageProjectUrl)"</SourceYardPackageProjectUrl>-->
<SourceYardPackageLicenseUrl Condition="$(PackageLicenseUrl) != ''">--PackageLicenseUrl "$(PackageLicenseUrl) "</SourceYardPackageLicenseUrl> <SourceYardPackageLicenseUrl Condition="$(PackageLicenseUrl) != ''">--PackageLicenseUrl "$(PackageLicenseUrl)"</SourceYardPackageLicenseUrl>
<SourceYardCopyright Condition="$(Copyright) != ''">--CopyrightFile "$(CopyrightFile)"</SourceYardCopyright> <SourceYardCopyright Condition="$(Copyright) != ''">--CopyrightFile "$(CopyrightFile)"</SourceYardCopyright>
<SourceYardPackageVersion Condition="$(PackageVersion) != ''">-v $(PackageVersion)</SourceYardPackageVersion> <SourceYardPackageVersion Condition="$(PackageVersion) != ''">-v $(PackageVersion)</SourceYardPackageVersion>
<SourceYardDescription Condition="$(Description) != ''">--DescriptionFile "$(DescriptionFile) "</SourceYardDescription> <SourceYardDescription Condition="$(Description) != ''">--DescriptionFile "$(DescriptionFile)"</SourceYardDescription>
<SourceYardTitle Condition="$(Title) != ''">--Title "$(Title)"</SourceYardTitle> <SourceYardTitle Condition="$(Title) != ''">--Title "$(Title)"</SourceYardTitle>
<SourceYardOwner Condition="$(Owner) != ''">--Owner "$(Owner)"</SourceYardOwner> <SourceYardOwner Condition="$(Owner) != ''">--Owner "$(Owner)"</SourceYardOwner>
<SourceYardPackageTags Condition="$(PackageTags) != ''">--PackageTags "$(PackageTags) "</SourceYardPackageTags> <SourceYardPackageTags Condition="$(PackageTags) != ''">--PackageTags "$(PackageTags)"</SourceYardPackageTags>
<SourceYardPackageReleaseNotes Condition="$(PackageReleaseNotes) != ''"> --PackageReleaseNotesFile $(PackageReleaseNotesFile)</SourceYardPackageReleaseNotes> <SourceYardPackageReleaseNotes Condition="$(PackageReleaseNotes) != ''"> --PackageReleaseNotesFile $(PackageReleaseNotesFile)</SourceYardPackageReleaseNotes>
<SourceYardPackageId Condition="'$(PackageId)' != ''">--PackageId "$(PackageId) "</SourceYardPackageId> <SourceYardPackageId Condition="'$(PackageId)' != ''">--PackageId "$(PackageId)"</SourceYardPackageId>
<SourceMSBuildProjectFullPath>-p "$(MSBuildProjectFullPath) "</SourceMSBuildProjectFullPath> <SourceMSBuildProjectFullPath>-p "$(MSBuildProjectFullPath)"</SourceMSBuildProjectFullPath>
<SourcePackageOutputPath Condition="'$(PackageOutputPath)' != ''">-n "$(PackageOutputPath) "</SourcePackageOutputPath> <SourcePackageOutputPath Condition="'$(PackageOutputPath)' != ''">-n "$(PackageOutputPath) "</SourcePackageOutputPath>
<SourcePackageOutputPath Condition="'$(PackageOutputPath)' == '' and $(OutputPath) != ''">-n "$(OutputPath) "</SourcePackageOutputPath> <SourcePackageOutputPath Condition="'$(SourcePackageOutputPath)' == '' and $(OutputPath) != ''">-n "$(OutputPath) "</SourcePackageOutputPath>
</PropertyGroup> </PropertyGroup>
...@@ -199,7 +200,7 @@ ...@@ -199,7 +200,7 @@
</PropertyGroup> </PropertyGroup>
<Exec <Exec
Command="$(SourceYardApplicationFilePath) $(SourceMSBuildProjectFullPath) $(SourcePackageOutputPath) $(SourceYardPackageVersion) $(SourceYardAuthors) $(SourceYardRepositoryUrl) $(SourceYardRepositoryType) $(SourceYardPackageProjectUrl) $(SourceYardCopyright) $(SourceYardDescription) $(SourceYardTitle) $(SourceYardPackageLicenseUrl) $(SourceYardPackageReleaseNotes) $(SourceYardPackageTags) $(SourceYardOwner) $(SourceYardPackageId) --TargetFrameworks &quot;$(TargetFrameworks) &quot; --TargetFramework &quot;$(TargetFramework) &quot; --MultiTargetingPackageInfoFolder &quot;$(_SourceYardMultiTargetingPackageInfoFolder) &quot;"> Command="$(SourceYardApplicationFilePath) $(SourceMSBuildProjectFullPath) $(SourcePackageOutputPath) $(SourceYardPackageVersion) $(SourceYardAuthors) $(SourceYardRepositoryUrl) $(SourceYardRepositoryType) $(SourceYardPackageProjectUrl) $(SourceYardCopyright) $(SourceYardDescription) $(SourceYardTitle) $(SourceYardPackageLicenseUrl) $(SourceYardPackageReleaseNotes) $(SourceYardPackageTags) $(SourceYardOwner) $(SourceYardPackageId) --TargetFrameworks &quot;$(TargetFrameworks) &quot; --TargetFramework &quot;$(TargetFramework) &quot; --MultiTargetingPackageInfoFolder &quot;$(_SourceYardMultiTargetingPackageInfoFolder)&quot;">
</Exec> </Exec>
<Message Text="Finish SourceYardStep3"></Message> <Message Text="Finish SourceYardStep3"></Message>
...@@ -211,7 +212,7 @@ ...@@ -211,7 +212,7 @@
<Target Name="_SourceYardClean"> <Target Name="_SourceYardClean">
<PropertyGroup> <PropertyGroup>
<_SourcePackingDirectory>$(IntermediateOutputPath)SourcePacking\</_SourcePackingDirectory> <_SourcePackingDirectory>$([System.IO.Path]::Combine($(IntermediateOutputPath),"SourcePacking"))</_SourcePackingDirectory>
</PropertyGroup> </PropertyGroup>
<RemoveDir Directories="$(_SourcePackingDirectory)" /> <RemoveDir Directories="$(_SourcePackingDirectory)" />
</Target> </Target>
......
...@@ -7,7 +7,7 @@ namespace dotnetCampus.SourceYard.Cli ...@@ -7,7 +7,7 @@ namespace dotnetCampus.SourceYard.Cli
/// <summary> /// <summary>
/// 项目文件所在的路径 /// 项目文件所在的路径
/// </summary> /// </summary>
[Option('p', "project", Description = "The full path of the project file.")] [Option('p', "Project", Description = "The full path of the project file.")]
public string ProjectFile { get; set; } = null!; public string ProjectFile { get; set; } = null!;
///// <summary> ///// <summary>
...@@ -19,13 +19,13 @@ namespace dotnetCampus.SourceYard.Cli ...@@ -19,13 +19,13 @@ namespace dotnetCampus.SourceYard.Cli
/// <summary> /// <summary>
/// 打包输出的文件夹 /// 打包输出的文件夹
/// </summary> /// </summary>
[Option('n', "package-output-path", Description = "The package output full path of the project.")] [Option('n', "PackageOutputPath", Description = "The package output full path of the project.")]
public string PackageOutputPath { get; set; } = null!; public string PackageOutputPath { get; set; } = null!;
/// <summary> /// <summary>
/// 当前项目的打包版本 /// 当前项目的打包版本
/// </summary> /// </summary>
[Option('v', "package-version", [Option('v', "PackageVersion",
// 默认不需要加上打包版本 // 默认不需要加上打包版本
Description = "The package version value.")] Description = "The package version value.")]
public string PackageVersion { get; set; } = "1.0.0"; public string PackageVersion { get; set; } = "1.0.0";
......
...@@ -93,6 +93,10 @@ namespace dotnetCampus.SourceYard ...@@ -93,6 +93,10 @@ namespace dotnetCampus.SourceYard
// 安装的项目的兼容性无法处理?源代码包有 net45 框架,项目是 net47 框架,如何让项目能兼容使用到 net45 框架?当前没有此生成逻辑 // 安装的项目的兼容性无法处理?源代码包有 net45 框架,项目是 net47 框架,如何让项目能兼容使用到 net45 框架?当前没有此生成逻辑
var sourcePackingFolder = GetCommonSourcePackingFolder(multiTargetingPackageInfo, logger); var sourcePackingFolder = GetCommonSourcePackingFolder(multiTargetingPackageInfo, logger);
var packageOutputPath = options.PackageOutputPath; var packageOutputPath = options.PackageOutputPath;
if (!string.IsNullOrEmpty(packageOutputPath))
{
packageOutputPath = packageOutputPath.Trim();
}
var packageVersion = options.PackageVersion; var packageVersion = options.PackageVersion;
// logger.Message($@"项目文件 {projectFile} // logger.Message($@"项目文件 {projectFile}
......
...@@ -43,6 +43,9 @@ ...@@ -43,6 +43,9 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference> </PackageReference>
<!-- 现在 CI 上没有 .NET Framework 4.5 的支持,需要手动加上 Microsoft.NETFramework.ReferenceAssemblies 才能修复构建。详细请看 https://blog.walterlv.com/post/support-old-netfx-on-vs2022-or-later -->
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="$(TargetFramework)=='net45'"> <ItemGroup Condition="$(TargetFramework)=='net45'">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册