Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita0918f2

Browse files
forkiKevinRansom
authored andcommitted
Activate FCS build on CI (dotnet#3769)
* Activate FCS build on CI* Simplify groovy* Use paket in magic mode* Ignore .fake* Gitignore fcs/packages* Ignore paket-files
1 parent064d804 commita0918f2

File tree

7 files changed

+252
-13
lines changed

7 files changed

+252
-13
lines changed

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,6 @@ source_link.json
118118
/VSRelease/net40/bin
119119
System.ValueTuple.dll
120120
tests/fsharpqa/testenv/bin/System.ValueTuple.dll
121+
*/.fake
122+
/fcs/packages/
123+
*/paket-files/

‎fcs/.paket/Paket.Restore.targets‎

Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
<Projectxmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<!-- Prevent dotnet template engine to parse this file-->
3+
<!--/-:cnd:noEmit-->
4+
<PropertyGroup>
5+
<!-- make MSBuild track this file for incremental builds.-->
6+
<!-- ref https://blogs.msdn.microsoft.com/msbuild/2005/09/26/how-to-ensure-changes-to-a-custom-target-file-prompt-a-rebuild/-->
7+
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
8+
<!-- Mark that this target file has been loaded.-->
9+
<IsPaketRestoreTargetsFileLoaded>true</IsPaketRestoreTargetsFileLoaded>
10+
<PaketToolsPath>$(MSBuildThisFileDirectory)</PaketToolsPath>
11+
<PaketRootPath>$(MSBuildThisFileDirectory)..\</PaketRootPath>
12+
<PaketRestoreCacheFile>$(PaketRootPath)paket-files\paket.restore.cached</PaketRestoreCacheFile>
13+
<PaketLockFilePath>$(PaketRootPath)paket.lock</PaketLockFilePath>
14+
<MonoPathCondition="'$(MonoPath)' == '' And Exists('/Library/Frameworks/Mono.framework/Commands/mono')">/Library/Frameworks/Mono.framework/Commands/mono</MonoPath>
15+
<MonoPathCondition="'$(MonoPath)' == ''">mono</MonoPath>
16+
<!-- Paket command-->
17+
<PaketExePathCondition=" '$(PaketExePath)' == '' AND Exists('$(PaketRootPath)paket.exe')">$(PaketRootPath)paket.exe</PaketExePath>
18+
<PaketExePathCondition=" '$(PaketExePath)' == ''">$(PaketToolsPath)paket.exe</PaketExePath>
19+
<PaketCommandCondition=" '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
20+
<PaketCommandCondition=" '$(OS)' != 'Windows_NT'">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>
21+
<PaketBootStrapperExePathCondition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
22+
<PaketBootStrapperExePathCondition=" '$(PaketBootStrapperExePath)' == ''">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
23+
<PaketBootStrapperCommandCondition=" '$(OS)' == 'Windows_NT'">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
24+
<PaketBootStrapperCommandCondition=" '$(OS)' != 'Windows_NT'">$(MonoPath) --runtime=v4.0.30319 "$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
25+
26+
<!-- Disable automagic references for F# dotnet sdk-->
27+
<!-- This will not do anything for other project types-->
28+
<!-- see https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-1032-fsharp-in-dotnet-sdk.md-->
29+
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
30+
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
31+
</PropertyGroup>
32+
33+
<TargetName="PaketRestore"BeforeTargets="_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" >
34+
35+
<!-- Step 1 Check if lockfile is properly restored-->
36+
<PropertyGroup>
37+
<PaketRestoreRequired>true</PaketRestoreRequired>
38+
<NoWarn>$(NoWarn);NU1603</NoWarn>
39+
</PropertyGroup>
40+
41+
<PropertyGroupCondition="Exists('$(PaketRestoreCacheFile)')">
42+
<PaketRestoreCachedHash>$([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)'))</PaketRestoreCachedHash>
43+
<PaketRestoreLockFileHash>$([System.IO.File]::ReadAllText('$(PaketLockFilePath)'))</PaketRestoreLockFileHash>
44+
<PaketRestoreRequired>true</PaketRestoreRequired>
45+
<PaketRestoreRequiredCondition=" '$(PaketRestoreLockFileHash)' == '$(PaketRestoreCachedHash)'">false</PaketRestoreRequired>
46+
<PaketRestoreRequiredCondition=" '$(PaketRestoreLockFileHash)' == ''">true</PaketRestoreRequired>
47+
</PropertyGroup>
48+
49+
<!-- Do a global restore if required-->
50+
<ExecCommand='$(PaketBootStrapperCommand)'Condition="Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))"ContinueOnError="false" />
51+
<ExecCommand='$(PaketCommand) restore'Condition=" '$(PaketRestoreRequired)' == 'true'"ContinueOnError="false" />
52+
53+
<!-- Step 2 Detect project specific changes-->
54+
<PropertyGroup>
55+
<PaketReferencesCachedFilePath>$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).paket.references.cached</PaketReferencesCachedFilePath>
56+
<!-- MyProject.fsproj.paket.references has the highest precedence-->
57+
<PaketOriginalReferencesFilePath>$(MSBuildProjectFullPath).paket.references</PaketOriginalReferencesFilePath>
58+
<!-- MyProject.paket.references-->
59+
<PaketOriginalReferencesFilePathCondition=" !Exists('$(PaketOriginalReferencesFilePath)')">$(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references</PaketOriginalReferencesFilePath>
60+
<!-- paket.references-->
61+
<PaketOriginalReferencesFilePathCondition=" !Exists('$(PaketOriginalReferencesFilePath)')">$(MSBuildProjectDirectory)\paket.references</PaketOriginalReferencesFilePath>
62+
<PaketResolvedFilePath>$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).$(TargetFramework).paket.resolved</PaketResolvedFilePath>
63+
<PaketRestoreRequired>true</PaketRestoreRequired>
64+
<PaketRestoreRequiredReason>references-file-or-cache-not-found</PaketRestoreRequiredReason>
65+
</PropertyGroup>
66+
67+
<!-- Step 2 a Detect changes in references file-->
68+
<PropertyGroupCondition="Exists('$(PaketOriginalReferencesFilePath)') AND Exists('$(PaketReferencesCachedFilePath)')">
69+
<PaketRestoreCachedHash>$([System.IO.File]::ReadAllText('$(PaketReferencesCachedFilePath)'))</PaketRestoreCachedHash>
70+
<PaketRestoreReferencesFileHash>$([System.IO.File]::ReadAllText('$(PaketOriginalReferencesFilePath)'))</PaketRestoreReferencesFileHash>
71+
<PaketRestoreRequiredReason>references-file</PaketRestoreRequiredReason>
72+
<PaketRestoreRequiredCondition=" '$(PaketRestoreReferencesFileHash)' == '$(PaketRestoreCachedHash)'">false</PaketRestoreRequired>
73+
</PropertyGroup>
74+
75+
<PropertyGroupCondition="!Exists('$(PaketOriginalReferencesFilePath)') AND !Exists('$(PaketReferencesCachedFilePath)')">
76+
<!-- If both don't exist there is nothing to do.-->
77+
<PaketRestoreRequired>false</PaketRestoreRequired>
78+
</PropertyGroup>
79+
80+
<!-- Step 2 b detect relevant changes in project file (new targetframework)-->
81+
<PropertyGroupCondition=" !Exists('$(PaketResolvedFilePath)') AND '$(TargetFramework)' != ''">
82+
<PaketRestoreRequired>true</PaketRestoreRequired>
83+
<PaketRestoreRequiredReason>target-framework '$(TargetFramework)'</PaketRestoreRequiredReason>
84+
</PropertyGroup>
85+
86+
<!-- Step 3 Restore project specific stuff if required-->
87+
<MessageCondition=" '$(PaketRestoreRequired)' == 'true'"Importance="low"Text="Detected a change ('$(PaketRestoreRequiredReason)') in the project file '$(MSBuildProjectFullPath)', calling paket restore" />
88+
<ExecCommand='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)"'Condition=" '$(PaketRestoreRequired)' == 'true'"ContinueOnError="false" />
89+
90+
<!-- This shouldn't actually happen, but just to be sure.-->
91+
<ErrorCondition=" !Exists('$(PaketResolvedFilePath)') AND '$(TargetFramework)' != ''"Text="A paket file for the framework '$(TargetFramework)' is missing. Please delete 'paket-files/paket.restore.cached' and call 'paket restore'." />
92+
93+
<!-- Step 4 forward all msbuild properties (PackageReference, DotNetCliToolReference) to msbuild-->
94+
<ReadLinesFromFileCondition="Exists('$(PaketResolvedFilePath)')"File="$(PaketResolvedFilePath)" >
95+
<OutputTaskParameter="Lines"ItemName="PaketReferencesFileLines"/>
96+
</ReadLinesFromFile>
97+
98+
<ItemGroupCondition=" Exists('$(PaketResolvedFilePath)') AND '@(PaketReferencesFileLines)' != ''" >
99+
<PaketReferencesFileLinesInfoInclude="@(PaketReferencesFileLines)" >
100+
<PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName>
101+
<PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion>
102+
</PaketReferencesFileLinesInfo>
103+
<PackageReferenceInclude="%(PaketReferencesFileLinesInfo.PackageName)">
104+
<Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
105+
</PackageReference>
106+
</ItemGroup>
107+
108+
<PropertyGroup>
109+
<RestoreConfigFile>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).NuGet.Config</RestoreConfigFile>
110+
</PropertyGroup>
111+
112+
</Target>
113+
114+
<TargetName="PaketDisableDirectPack"AfterTargets="_IntermediatePack"BeforeTargets="GenerateNuspec"Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
115+
<PropertyGroup>
116+
<ContinuePackingAfterGeneratingNuspec>false</ContinuePackingAfterGeneratingNuspec>
117+
</PropertyGroup>
118+
</Target>
119+
120+
<TargetName="PaketOverrideNuspec"AfterTargets="GenerateNuspec"Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
121+
<PropertyGroup>
122+
<PaketProjectFile>$(MSBuildProjectDirectory)/$(MSBuildProjectFile)</PaketProjectFile>
123+
<ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec>
124+
<UseNewPack>false</UseNewPack>
125+
<UseNewPackCondition=" '$(NuGetToolVersion)' != '4.0.0'">true</UseNewPack>
126+
</PropertyGroup>
127+
128+
<ItemGroup>
129+
<_NuspecFilesInclude="$(BaseIntermediateOutputPath)*.nuspec"/>
130+
</ItemGroup>
131+
132+
<ExecCommand='$(PaketCommand) fix-nuspecs files "@(_NuspecFiles)" project-file "$(PaketProjectFile)"'Condition="@(_NuspecFiles) != ''" />
133+
134+
<ConvertToAbsolutePathCondition="@(_NuspecFiles) != ''"Paths="@(_NuspecFiles)">
135+
<OutputTaskParameter="AbsolutePaths"PropertyName="NuspecFileAbsolutePath" />
136+
</ConvertToAbsolutePath>
137+
138+
<!-- Call Pack-->
139+
<PackTaskCondition="$(UseNewPack)"
140+
PackItem="$(PackProjectInputFile)"
141+
PackageFiles="@(_PackageFiles)"
142+
PackageFilesToExclude="@(_PackageFilesToExclude)"
143+
PackageVersion="$(PackageVersion)"
144+
PackageId="$(PackageId)"
145+
Title="$(Title)"
146+
Authors="$(Authors)"
147+
Description="$(Description)"
148+
Copyright="$(Copyright)"
149+
RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)"
150+
LicenseUrl="$(PackageLicenseUrl)"
151+
ProjectUrl="$(PackageProjectUrl)"
152+
IconUrl="$(PackageIconUrl)"
153+
ReleaseNotes="$(PackageReleaseNotes)"
154+
Tags="$(PackageTags)"
155+
DevelopmentDependency="$(DevelopmentDependency)"
156+
BuildOutputInPackage="@(_BuildOutputInPackage)"
157+
TargetPathsToSymbols="@(_TargetPathsToSymbols)"
158+
TargetFrameworks="@(_TargetFrameworks)"
159+
AssemblyName="$(AssemblyName)"
160+
PackageOutputPath="$(PackageOutputAbsolutePath)"
161+
IncludeSymbols="$(IncludeSymbols)"
162+
IncludeSource="$(IncludeSource)"
163+
PackageTypes="$(PackageType)"
164+
IsTool="$(IsTool)"
165+
RepositoryUrl="$(RepositoryUrl)"
166+
RepositoryType="$(RepositoryType)"
167+
SourceFiles="@(_SourceFiles->Distinct())"
168+
NoPackageAnalysis="$(NoPackageAnalysis)"
169+
MinClientVersion="$(MinClientVersion)"
170+
Serviceable="$(Serviceable)"
171+
FrameworkAssemblyReferences="@(_FrameworkAssemblyReferences)"
172+
ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
173+
NuspecOutputPath="$(BaseIntermediateOutputPath)"
174+
IncludeBuildOutput="$(IncludeBuildOutput)"
175+
BuildOutputFolder="$(BuildOutputTargetFolder)"
176+
ContentTargetFolders="$(ContentTargetFolders)"
177+
RestoreOutputPath="$(RestoreOutputAbsolutePath)"
178+
NuspecFile="$(NuspecFileAbsolutePath)"
179+
NuspecBasePath="$(NuspecBasePath)"
180+
NuspecProperties="$(NuspecProperties)"/>
181+
182+
<PackTaskCondition="! $(UseNewPack)"
183+
PackItem="$(PackProjectInputFile)"
184+
PackageFiles="@(_PackageFiles)"
185+
PackageFilesToExclude="@(_PackageFilesToExclude)"
186+
PackageVersion="$(PackageVersion)"
187+
PackageId="$(PackageId)"
188+
Title="$(Title)"
189+
Authors="$(Authors)"
190+
Description="$(Description)"
191+
Copyright="$(Copyright)"
192+
RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)"
193+
LicenseUrl="$(PackageLicenseUrl)"
194+
ProjectUrl="$(PackageProjectUrl)"
195+
IconUrl="$(PackageIconUrl)"
196+
ReleaseNotes="$(PackageReleaseNotes)"
197+
Tags="$(PackageTags)"
198+
TargetPathsToAssemblies="@(_TargetPathsToAssemblies->'%(FinalOutputPath)')"
199+
TargetPathsToSymbols="@(_TargetPathsToSymbols)"
200+
TargetFrameworks="@(_TargetFrameworks)"
201+
AssemblyName="$(AssemblyName)"
202+
PackageOutputPath="$(PackageOutputAbsolutePath)"
203+
IncludeSymbols="$(IncludeSymbols)"
204+
IncludeSource="$(IncludeSource)"
205+
PackageTypes="$(PackageType)"
206+
IsTool="$(IsTool)"
207+
RepositoryUrl="$(RepositoryUrl)"
208+
RepositoryType="$(RepositoryType)"
209+
SourceFiles="@(_SourceFiles->Distinct())"
210+
NoPackageAnalysis="$(NoPackageAnalysis)"
211+
MinClientVersion="$(MinClientVersion)"
212+
Serviceable="$(Serviceable)"
213+
AssemblyReferences="@(_References)"
214+
ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
215+
NuspecOutputPath="$(BaseIntermediateOutputPath)"
216+
IncludeBuildOutput="$(IncludeBuildOutput)"
217+
BuildOutputFolder="$(BuildOutputTargetFolder)"
218+
ContentTargetFolders="$(ContentTargetFolders)"
219+
RestoreOutputPath="$(RestoreOutputAbsolutePath)"
220+
NuspecFile="$(NuspecFileAbsolutePath)"
221+
NuspecBasePath="$(NuspecBasePath)"
222+
NuspecProperties="$(NuspecProperties)"/>
223+
</Target>
224+
<!--/+:cnd:noEmit-->
225+
</Project>

‎fcs/.paket/paket.bootstrapper.exe‎

-27.5 KB
Binary file not shown.

‎fcs/.paket/paket.exe‎

62.3 KB
Binary file not shown.

‎fcs/build.cmd‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.nuget\NuGet.exe restore -PackagesDirectory packages
33
setlocal
44
cd fcs
5-
.paket\paket.bootstrapper.exe
5+
66
dotnet restore tools.fsproj
77
iferrorlevel1 (
88
endlocal

‎fcs/build.sh‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ else
1515

1616
dotnet restore tools.fsproj
1717

18-
mono .paket/paket.bootstrapper.exe
19-
exit_code=$?
20-
if [$exit_code-ne 0 ];then
21-
exit$exit_code
22-
fi
23-
2418
mono .paket/paket.exe restore
2519
exit_code=$?
2620
if [$exit_code-ne 0 ];then

‎netci.groovy‎

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def static getBuildJobName(def configuration, def os) {
1212

1313
[true,false].each {isPullRequest->
1414
osList.each {os->
15-
def configurations= ['Debug','Release_ci_part1','Release_ci_part2','Release_ci_part3','Release_net40_no_vs' ];
15+
def configurations= ['Debug','Release_ci_part1','Release_ci_part2','Release_ci_part3','Release_net40_no_vs','Release_fcs' ];
1616
if (os!='Windows_NT') {
1717
// Only build one configuration on Linux/... so far
1818
configurations= ['Release'];
@@ -24,10 +24,27 @@ def static getBuildJobName(def configuration, def os) {
2424
// Calculate job name
2525
def jobName= getBuildJobName(configuration, os)
2626

27+
def buildPath='';
28+
if (os=='Windows_NT') {
29+
buildPath=".\\"
30+
}
31+
else {
32+
buildPath="./"
33+
}
2734
def buildCommand='';
28-
2935
def buildFlavor='';
30-
if (configuration=="Debug") {
36+
37+
if (configuration=="Release_fcs") {
38+
if (os=='Windows_NT') {
39+
buildPath=".\\fcs\\"
40+
}
41+
else {
42+
buildPath="./fcs/"
43+
}
44+
buildFlavor=""
45+
build_args="TestAndNuget"
46+
}
47+
elseif (configuration=="Debug") {
3148
buildFlavor="debug"
3249
build_args=""
3350
}
@@ -51,10 +68,10 @@ def static getBuildJobName(def configuration, def os) {
5168
}
5269

5370
if (os=='Windows_NT') {
54-
buildCommand=".\\build.cmd${buildFlavor}${build_args}"
71+
buildCommand="${buildPath}build.cmd${buildFlavor}${build_args}"
5572
}
5673
else {
57-
buildCommand="./build.sh${buildFlavor}${build_args}"
74+
buildCommand="${buildPath}build.sh${buildFlavor}${build_args}"
5875
}
5976

6077
def newJobName=Utilities.getFullJobName(project, jobName, isPullRequest)
@@ -64,7 +81,7 @@ def static getBuildJobName(def configuration, def os) {
6481
batchFile("""
6582
echo *** Build Visual F# Tools ***
6683
67-
.\\build.cmd${buildFlavor}${build_args}""")
84+
${buildPath}build.cmd${buildFlavor}${build_args}""")
6885
}
6986
else {
7087
// Shell

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp