├── .github
└── workflows
│ └── dotnet.yml
├── .gitignore
├── .idea
└── .idea.FSharpPacker
│ └── .idea
│ ├── .gitignore
│ ├── encodings.xml
│ ├── indexLayout.xml
│ └── vcs.xml
├── Dockerfile
├── FSharpPacker.FSharp
├── FSharpPacker.FSharp.fsproj
├── FsxPrepocessor.fs
├── Packer.fs
├── Program.fs
└── Properties
│ └── launchSettings.json
├── FSharpPacker.Tests
├── FSharpPacker.Tests.csproj
├── Samples
│ ├── ConditionalCompilation.fsx
│ ├── FsProjReferenceExtension.fsx
│ ├── HelpCommand.fsx
│ ├── IncludePath.fsx
│ ├── Level1
│ │ ├── Loader.fsx
│ │ ├── Quit.fsx
│ │ ├── WithNamespace.fsx
│ │ └── WithNamespaceAndComments.fsx
│ ├── LoadFile.fsx
│ ├── MultipleLoadDirectivesFile.fsx
│ ├── MultipleLoadFile.fsx
│ ├── Namespaces.fsx
│ ├── NamespacesWithComments.fsx
│ ├── NugetCustomFeed.fsx
│ ├── NugetExplicitVersion.fsx
│ ├── NugetLastVersion.fsx
│ ├── PlainFsharp.fsx
│ ├── QuitCommand.fsx
│ ├── RegularReference.fsx
│ ├── Shebang.fsx
│ ├── TimeCommands.fsx
│ ├── fake_dll.fsx
│ ├── lowercase-script.fsx
│ └── testscript.fsx
├── UnitTest1.cs
└── Usings.cs
├── FSharpPacker.sln
├── LICENSE
├── README.md
├── build.nix
├── deps.nix
├── flake.lock
├── flake.nix
└── nuget.config
/.github/workflows/dotnet.yml:
--------------------------------------------------------------------------------
1 | name: .NET
2 |
3 | on:
4 | push:
5 | branches: [ "main" ]
6 | pull_request:
7 | branches: [ "main" ]
8 |
9 | jobs:
10 | build:
11 |
12 | runs-on: ubuntu-latest
13 |
14 | steps:
15 | - uses: actions/checkout@v3
16 | - name: Setup .NET
17 | uses: actions/setup-dotnet@v2
18 | with:
19 | dotnet-version: 6.0.x
20 | - name: Restore dependencies
21 | run: dotnet restore
22 | - name: Build
23 | run: dotnet build --no-restore
24 | - name: Test
25 | run: dotnet test --no-build --verbosity normal
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Ll]og/
33 | [Ll]ogs/
34 |
35 | # Visual Studio 2015/2017 cache/options directory
36 | .vs/
37 | # Uncomment if you have tasks that create the project's static files in wwwroot
38 | #wwwroot/
39 |
40 | # Visual Studio 2017 auto generated files
41 | Generated\ Files/
42 |
43 | # MSTest test Results
44 | [Tt]est[Rr]esult*/
45 | [Bb]uild[Ll]og.*
46 |
47 | # NUnit
48 | *.VisualState.xml
49 | TestResult.xml
50 | nunit-*.xml
51 |
52 | # Build Results of an ATL Project
53 | [Dd]ebugPS/
54 | [Rr]eleasePS/
55 | dlldata.c
56 |
57 | # Benchmark Results
58 | BenchmarkDotNet.Artifacts/
59 |
60 | # .NET
61 | project.lock.json
62 | project.fragment.lock.json
63 | artifacts/
64 |
65 | # Tye
66 | .tye/
67 |
68 | # ASP.NET Scaffolding
69 | ScaffoldingReadMe.txt
70 |
71 | # StyleCop
72 | StyleCopReport.xml
73 |
74 | # Files built by Visual Studio
75 | *_i.c
76 | *_p.c
77 | *_h.h
78 | *.ilk
79 | *.meta
80 | *.obj
81 | *.iobj
82 | *.pch
83 | *.pdb
84 | *.ipdb
85 | *.pgc
86 | *.pgd
87 | *.rsp
88 | *.sbr
89 | *.tlb
90 | *.tli
91 | *.tlh
92 | *.tmp
93 | *.tmp_proj
94 | *_wpftmp.csproj
95 | *.log
96 | *.tlog
97 | *.vspscc
98 | *.vssscc
99 | .builds
100 | *.pidb
101 | *.svclog
102 | *.scc
103 |
104 | # Chutzpah Test files
105 | _Chutzpah*
106 |
107 | # Visual C++ cache files
108 | ipch/
109 | *.aps
110 | *.ncb
111 | *.opendb
112 | *.opensdf
113 | *.sdf
114 | *.cachefile
115 | *.VC.db
116 | *.VC.VC.opendb
117 |
118 | # Visual Studio profiler
119 | *.psess
120 | *.vsp
121 | *.vspx
122 | *.sap
123 |
124 | # Visual Studio Trace Files
125 | *.e2e
126 |
127 | # TFS 2012 Local Workspace
128 | $tf/
129 |
130 | # Guidance Automation Toolkit
131 | *.gpState
132 |
133 | # ReSharper is a .NET coding add-in
134 | _ReSharper*/
135 | *.[Rr]e[Ss]harper
136 | *.DotSettings.user
137 |
138 | # TeamCity is a build add-in
139 | _TeamCity*
140 |
141 | # DotCover is a Code Coverage Tool
142 | *.dotCover
143 |
144 | # AxoCover is a Code Coverage Tool
145 | .axoCover/*
146 | !.axoCover/settings.json
147 |
148 | # Coverlet is a free, cross platform Code Coverage Tool
149 | coverage*.json
150 | coverage*.xml
151 | coverage*.info
152 |
153 | # Visual Studio code coverage results
154 | *.coverage
155 | *.coveragexml
156 |
157 | # NCrunch
158 | _NCrunch_*
159 | .*crunch*.local.xml
160 | nCrunchTemp_*
161 |
162 | # MightyMoose
163 | *.mm.*
164 | AutoTest.Net/
165 |
166 | # Web workbench (sass)
167 | .sass-cache/
168 |
169 | # Installshield output folder
170 | [Ee]xpress/
171 |
172 | # DocProject is a documentation generator add-in
173 | DocProject/buildhelp/
174 | DocProject/Help/*.HxT
175 | DocProject/Help/*.HxC
176 | DocProject/Help/*.hhc
177 | DocProject/Help/*.hhk
178 | DocProject/Help/*.hhp
179 | DocProject/Help/Html2
180 | DocProject/Help/html
181 |
182 | # Click-Once directory
183 | publish/
184 |
185 | # Publish Web Output
186 | *.[Pp]ublish.xml
187 | *.azurePubxml
188 | # Note: Comment the next line if you want to checkin your web deploy settings,
189 | # but database connection strings (with potential passwords) will be unencrypted
190 | *.pubxml
191 | *.publishproj
192 |
193 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
194 | # checkin your Azure Web App publish settings, but sensitive information contained
195 | # in these scripts will be unencrypted
196 | PublishScripts/
197 |
198 | # NuGet Packages
199 | *.nupkg
200 | # NuGet Symbol Packages
201 | *.snupkg
202 | # The packages folder can be ignored because of Package Restore
203 | **/[Pp]ackages/*
204 | # except build/, which is used as an MSBuild target.
205 | !**/[Pp]ackages/build/
206 | # Uncomment if necessary however generally it will be regenerated when needed
207 | #!**/[Pp]ackages/repositories.config
208 | # NuGet v3's project.json files produces more ignorable files
209 | *.nuget.props
210 | *.nuget.targets
211 |
212 | # Microsoft Azure Build Output
213 | csx/
214 | *.build.csdef
215 |
216 | # Microsoft Azure Emulator
217 | ecf/
218 | rcf/
219 |
220 | # Windows Store app package directories and files
221 | AppPackages/
222 | BundleArtifacts/
223 | Package.StoreAssociation.xml
224 | _pkginfo.txt
225 | *.appx
226 | *.appxbundle
227 | *.appxupload
228 |
229 | # Visual Studio cache files
230 | # files ending in .cache can be ignored
231 | *.[Cc]ache
232 | # but keep track of directories ending in .cache
233 | !?*.[Cc]ache/
234 |
235 | # Others
236 | ClientBin/
237 | ~$*
238 | *~
239 | *.dbmdl
240 | *.dbproj.schemaview
241 | *.jfm
242 | *.pfx
243 | *.publishsettings
244 | orleans.codegen.cs
245 |
246 | # Including strong name files can present a security risk
247 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
248 | #*.snk
249 |
250 | # Since there are multiple workflows, uncomment next line to ignore bower_components
251 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
252 | #bower_components/
253 |
254 | # RIA/Silverlight projects
255 | Generated_Code/
256 |
257 | # Backup & report files from converting an old project file
258 | # to a newer Visual Studio version. Backup files are not needed,
259 | # because we have git ;-)
260 | _UpgradeReport_Files/
261 | Backup*/
262 | UpgradeLog*.XML
263 | UpgradeLog*.htm
264 | ServiceFabricBackup/
265 | *.rptproj.bak
266 |
267 | # SQL Server files
268 | *.mdf
269 | *.ldf
270 | *.ndf
271 |
272 | # Business Intelligence projects
273 | *.rdl.data
274 | *.bim.layout
275 | *.bim_*.settings
276 | *.rptproj.rsuser
277 | *- [Bb]ackup.rdl
278 | *- [Bb]ackup ([0-9]).rdl
279 | *- [Bb]ackup ([0-9][0-9]).rdl
280 |
281 | # Microsoft Fakes
282 | FakesAssemblies/
283 |
284 | # GhostDoc plugin setting file
285 | *.GhostDoc.xml
286 |
287 | # Node.js Tools for Visual Studio
288 | .ntvs_analysis.dat
289 | node_modules/
290 |
291 | # Visual Studio 6 build log
292 | *.plg
293 |
294 | # Visual Studio 6 workspace options file
295 | *.opt
296 |
297 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
298 | *.vbw
299 |
300 | # Visual Studio 6 auto-generated project file (contains which files were open etc.)
301 | *.vbp
302 |
303 | # Visual Studio 6 workspace and project file (working project files containing files to include in project)
304 | *.dsw
305 | *.dsp
306 |
307 | # Visual Studio 6 technical files
308 | *.ncb
309 | *.aps
310 |
311 | # Visual Studio LightSwitch build output
312 | **/*.HTMLClient/GeneratedArtifacts
313 | **/*.DesktopClient/GeneratedArtifacts
314 | **/*.DesktopClient/ModelManifest.xml
315 | **/*.Server/GeneratedArtifacts
316 | **/*.Server/ModelManifest.xml
317 | _Pvt_Extensions
318 |
319 | # Paket dependency manager
320 | .paket/paket.exe
321 | paket-files/
322 |
323 | # FAKE - F# Make
324 | .fake/
325 |
326 | # CodeRush personal settings
327 | .cr/personal
328 |
329 | # Python Tools for Visual Studio (PTVS)
330 | __pycache__/
331 | *.pyc
332 |
333 | # Cake - Uncomment if you are using it
334 | # tools/**
335 | # !tools/packages.config
336 |
337 | # Tabs Studio
338 | *.tss
339 |
340 | # Telerik's JustMock configuration file
341 | *.jmconfig
342 |
343 | # BizTalk build output
344 | *.btp.cs
345 | *.btm.cs
346 | *.odx.cs
347 | *.xsd.cs
348 |
349 | # OpenCover UI analysis results
350 | OpenCover/
351 |
352 | # Azure Stream Analytics local run output
353 | ASALocalRun/
354 |
355 | # MSBuild Binary and Structured Log
356 | *.binlog
357 |
358 | # NVidia Nsight GPU debugger configuration file
359 | *.nvuser
360 |
361 | # MFractors (Xamarin productivity tool) working folder
362 | .mfractor/
363 |
364 | # Local History for Visual Studio
365 | .localhistory/
366 |
367 | # Visual Studio History (VSHistory) files
368 | .vshistory/
369 |
370 | # BeatPulse healthcheck temp database
371 | healthchecksdb
372 |
373 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
374 | MigrationBackup/
375 |
376 | # Ionide (cross platform F# VS Code tools) working folder
377 | .ionide/
378 |
379 | # Fody - auto-generated XML schema
380 | FodyWeavers.xsd
381 |
382 | # VS Code files for those working on multiple tools
383 | .vscode/*
384 | !.vscode/settings.json
385 | !.vscode/tasks.json
386 | !.vscode/launch.json
387 | !.vscode/extensions.json
388 | *.code-workspace
389 |
390 | # Local History for Visual Studio Code
391 | .history/
392 |
393 | # Windows Installer files from build outputs
394 | *.cab
395 | *.msi
396 | *.msix
397 | *.msm
398 | *.msp
399 |
400 | # JetBrains Rider
401 | *.sln.iml
402 |
403 | ##
404 | ## Visual studio for Mac
405 | ##
406 |
407 |
408 | # globs
409 | Makefile.in
410 | *.userprefs
411 | *.usertasks
412 | config.make
413 | config.status
414 | aclocal.m4
415 | install-sh
416 | autom4te.cache/
417 | *.tar.gz
418 | tarballs/
419 | test-results/
420 |
421 | # Mac bundle stuff
422 | *.dmg
423 | *.app
424 |
425 | # content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
426 | # General
427 | .DS_Store
428 | .AppleDouble
429 | .LSOverride
430 |
431 | # Icon must end with two \r
432 | Icon
433 |
434 |
435 | # Thumbnails
436 | ._*
437 |
438 | # Files that might appear in the root of a volume
439 | .DocumentRevisions-V100
440 | .fseventsd
441 | .Spotlight-V100
442 | .TemporaryItems
443 | .Trashes
444 | .VolumeIcon.icns
445 | .com.apple.timemachine.donotpresent
446 |
447 | # Directories potentially created on remote AFP share
448 | .AppleDB
449 | .AppleDesktop
450 | Network Trash Folder
451 | Temporary Items
452 | .apdisk
453 |
454 | # content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
455 | # Windows thumbnail cache files
456 | Thumbs.db
457 | ehthumbs.db
458 | ehthumbs_vista.db
459 |
460 | # Dump file
461 | *.stackdump
462 |
463 | # Folder config file
464 | [Dd]esktop.ini
465 |
466 | # Recycle Bin used on file shares
467 | $RECYCLE.BIN/
468 |
469 | # Windows Installer files
470 | *.cab
471 | *.msi
472 | *.msix
473 | *.msm
474 | *.msp
475 |
476 | # Windows shortcuts
477 | *.lnk
478 |
479 | test/
480 | test2/
481 | /test-aot
482 |
--------------------------------------------------------------------------------
/.idea/.idea.FSharpPacker/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Rider ignored files
5 | /.idea.FSharpPacker.iml
6 | /contentModel.xml
7 | /modules.xml
8 | /projectSettingsUpdater.xml
9 | # Editor-based HTTP Client requests
10 | /httpRequests/
11 | # Datasource local storage ignored files
12 | /dataSources/
13 | /dataSources.local.xml
14 |
--------------------------------------------------------------------------------
/.idea/.idea.FSharpPacker/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/.idea.FSharpPacker/.idea/indexLayout.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/.idea.FSharpPacker/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:8.0
2 | WORKDIR /App
3 |
4 | # Copy everything
5 | COPY . ./
6 | # Restore as distinct layers
7 | RUN dotnet restore
8 | # Build and publish a release
9 | RUN dotnet pack FSharpPacker.FSharp -c Release
10 | RUN dotnet tool install FSharpPacker --global --add-source FSharpPacker.FSharp/bin/Release/
11 | ENV PATH "$PATH:/root/.dotnet/tools"
12 |
13 | ENTRYPOINT ["/bin/bash"]
14 |
--------------------------------------------------------------------------------
/FSharpPacker.FSharp/FSharpPacker.FSharp.fsproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | FSharpPacker
7 | True
8 | true
9 | fspack
10 | 1.2.0
11 | FSharpPacker
12 | README.md
13 | MIT
14 | LatestMajor
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/FSharpPacker.FSharp/FsxPrepocessor.fs:
--------------------------------------------------------------------------------
1 | namespace FSharpPacker
2 |
3 | open System
4 | open System.IO
5 | open Packer
6 |
7 | type FsxPreprocessor(verbose: bool) =
8 |
9 | let mutable sourceFiles = ResizeArray()
10 |
11 | let mutable references = ResizeArray()
12 | let mutable packageSources = ResizeArray()
13 | let mutable packageReferences = ResizeArray()
14 | let mutable projectReferences = ResizeArray()
15 |
16 | member _.AddSource (sourceFile:string, content:string) =
17 | let newSourceFile = SourceFile(sourceFile, content)
18 | sourceFiles.Add(newSourceFile)
19 | newSourceFile
20 |
21 | member this.AddSource (sourceFile:string) =
22 | this.AddSource(sourceFile, File.ReadAllText(sourceFile))
23 |
24 | member _.AddPackageSource (packageSource:string) =
25 | packageSources.Add packageSource
26 |
27 | member _.AddProjectReference (projectReference:string) =
28 | projectReferences.Add projectReference
29 |
30 | member _.Process () =
31 | packageSources <- ResizeArray()
32 | for sourceFile in sourceFiles do
33 | if verbose then Console.WriteLine($"Processing {sourceFile.FileName}")
34 | let state: FsxProgramState = {
35 | sourceFiles = sourceFiles.ToArray()
36 | references = references
37 | packageReferences = packageReferences
38 | nugetSources = packageSources
39 | projectReferences = projectReferences
40 | }
41 | Packer.ProcessFile state sourceFile verbose
42 | sourceFiles <- ResizeArray(state.sourceFiles)
43 | references <- ResizeArray(state.references)
44 | packageReferences <- ResizeArray(state.packageReferences)
45 | packageSources.AddRange(state.nugetSources)
46 | projectReferences.AddRange(state.projectReferences)
47 |
48 | member _.GetSource(mainFsx: string) =
49 | sourceFiles
50 | |> Seq.tryFind (fun x -> x.FileName = mainFsx)
51 | |> Option.map (fun x -> x.ReadProducedFile())
52 | |> Option.defaultValue ""
53 |
54 | member _.FindSource(matcher: Func) =
55 | sourceFiles
56 | |> Seq.tryFind (fun x -> matcher.Invoke(x.FileName))
57 | |> Option.map (fun x -> x.ReadProducedFile())
58 | |> Option.defaultValue ""
59 |
60 | member _.GetSources() =
61 | sourceFiles.ToArray()
62 |
63 | member _.GetReferences() =
64 | references.ToArray()
65 |
66 | member _.GetPackageReferences() =
67 | packageReferences.ToArray()
68 |
69 | member _.GetPackageSources() =
70 | packageSources.ToArray()
71 |
72 | member _.GetProjectReferences() =
73 | projectReferences.ToArray()
74 |
--------------------------------------------------------------------------------
/FSharpPacker.FSharp/Packer.fs:
--------------------------------------------------------------------------------
1 | module Packer
2 |
3 | open System
4 | open System.IO
5 | open System.Text.RegularExpressions
6 |
7 | type public NugetReference = {
8 | Name: string;
9 | Version: string;
10 | }
11 |
12 | type public SourceFile(fileName: string, reader: TextReader) = class
13 | let tempFile = Path.GetTempFileName()
14 | let stream = new FileStream(tempFile, FileMode.Open, FileAccess.Write, FileShare.Read)
15 | let writer = new StreamWriter( stream )
16 | let mutable additionalSearchPaths = [ Path.GetDirectoryName(Path.GetFullPath(fileName)) ]
17 | let mutable additionalNugetSources = [ ]
18 | let mutable sourceDependencies = [ ]
19 |
20 | new (fileName, content) = SourceFile(fileName, new StringReader(content))
21 | new (fileName: string) = SourceFile(fileName, new StreamReader(fileName))
22 |
23 | member this.FileName = fileName
24 | member this.ReadLine() = reader.ReadLine
25 | member this.WriteLine(line: string) =
26 | writer.WriteLine line
27 | writer.Flush()
28 |
29 | member this.ReadProducedFile() =
30 | writer.Close()
31 | File.ReadAllText tempFile
32 |
33 | member this.AddIncludePaths (enumerable: seq) =
34 | let x = Seq.map (fun (p: string) -> if Path.IsPathRooted(p) then p else Path.Combine(additionalSearchPaths[0], p)) enumerable
35 | additionalSearchPaths <- additionalSearchPaths @ (x |> List.ofSeq);
36 |
37 | member this.AddNugetSource (enumerable: seq) =
38 | let x = Seq.map (fun (p: string) -> if Path.IsPathRooted(p) then p else Path.Combine(additionalSearchPaths[0], p)) enumerable
39 | additionalNugetSources <- additionalNugetSources @ (x |> List.ofSeq);
40 |
41 | member this.AddSourceDependency (dependency: SourceFile) =
42 | sourceDependencies <- sourceDependencies @ [dependency]
43 |
44 | member this.GetDependencies() =
45 | sourceDependencies
46 |
47 | member this.ResolveRelativePath(path: string) =
48 | let resolve basePath =
49 | let resolvedPath = Path.Combine(basePath, path)
50 | if File.Exists resolvedPath then Some(resolvedPath) else None
51 |
52 | match Seq.tryPick resolve additionalSearchPaths with
53 | | Some(path) -> path
54 | | None -> raise (InvalidOperationException($"Cannot resolve file {path}"))
55 |
56 | member this.ReadContent() =seq {
57 | let mutable line = reader.ReadLine()
58 | while line <> null do
59 | yield line
60 | line <- reader.ReadLine()
61 | }
62 |
63 | end
64 |
65 | let GetModuleName (sourceFile: SourceFile) =
66 | let fileName = Path.GetFileNameWithoutExtension(sourceFile.FileName)
67 | let isIdentifier = Regex.IsMatch (fileName, "^[_a-zA-Z][_a-zA-Z0-9]{0,30}$")
68 | if not isIdentifier
69 | then "``" + fileName + "``"
70 | else if Char.IsLower(fileName[0]) then Char.ToUpper(fileName[0]).ToString() + fileName.Substring(1)
71 | else fileName
72 |
73 | type public FsxProgramState = {
74 | mutable sourceFiles: array;
75 | mutable references: seq;
76 | mutable packageReferences: seq;
77 | mutable nugetSources: seq;
78 | mutable projectReferences: seq;
79 | }
80 |
81 | let public AddSource state sourceFile (content: string) =
82 | let m = Array.append state.sourceFiles [| new SourceFile(sourceFile, content) |]
83 | { state with sourceFiles = m }
84 |
85 | let public AddSourceFromFile state sourceFile =
86 | AddSource state sourceFile (File.ReadAllText(sourceFile))
87 |
88 | let Unquote (data: string) = data.Trim('"')
89 |
90 | let ParsePaths paths =
91 | Regex.Matches(paths, "(\"|')(?:\\\\\\1|[^\\1])*?\\1") |> Seq.map (fun x -> Unquote x.Value)
92 |
93 | type FsxLine =
94 | | SourceCode of string
95 | | Unsupported
96 | | Skipped
97 | | IncludePath of seq
98 | | IncludeFiles of seq
99 | | IncludeReference of references: seq * packages: seq * projectReferences: seq
100 | | AddNugetFeed of string
101 |
102 | let rec findTree (file : SourceFile) =
103 | seq {
104 | for sf in file.GetDependencies() do
105 | for nsf in findTree sf do
106 | yield nsf
107 | yield file
108 | }
109 |
110 | let classifyLine (sourceFile: SourceFile) (normalizedLine: string) =
111 | if normalizedLine.StartsWith("#") then
112 | if normalizedLine.StartsWith("#r") then
113 | let pathStrings = normalizedLine.Replace("#r ", "")
114 | let mutable references: seq = []
115 | let mutable projectReferences: seq = []
116 | let mutable packages: seq = []
117 | for path in ParsePaths(pathStrings) do
118 | let normalizedReference = Regex.Replace(path, "\\s+(nuget|fsproj)\\s+:\\s+", "$1:")
119 | if normalizedReference.StartsWith("nuget:") then
120 | let packageParts = normalizedReference.Substring("nuget:".Length).Split(',')
121 | let package = match packageParts with
122 | | [| name; version |] -> { Name = name.Trim(); Version = version.Trim() }
123 | | [| name |] -> { Name = name.Trim(); Version = "*" }
124 | | _ -> raise (new InvalidOperationException("Incorrect format of nuget package"))
125 | packages <- Seq.append packages [package]
126 | elif normalizedReference.StartsWith("fsproj:") then
127 | let projectPath = normalizedReference.Substring("fsproj:".Length)
128 | projectReferences <- Seq.append projectReferences [projectPath.Trim()]
129 | else
130 | let relativeReferencePath = sourceFile.ResolveRelativePath(path)
131 | references <- Seq.append references [Path.GetFullPath(relativeReferencePath)]
132 | ()
133 | IncludeReference(references, packages, projectReferences)
134 | elif normalizedLine.StartsWith("#i") && not (normalizedLine.StartsWith("#if")) then
135 | let pathStrings = normalizedLine.Replace("#i ", "")
136 | let normalizedReference = Regex.Replace(pathStrings, "\\s+nuget\\s+:\\s+", "nuget:") |> Unquote
137 | if normalizedReference.StartsWith("nuget:") then
138 | let packageParts = normalizedReference.Substring("nuget:".Length).Trim()
139 | AddNugetFeed(packageParts)
140 | else
141 | Unsupported
142 | elif normalizedLine.StartsWith("#help") then
143 | Unsupported
144 | elif normalizedLine.StartsWith("#time") then
145 | Unsupported
146 | elif normalizedLine.StartsWith("#quit") then
147 | SourceCode("System.Environment.Exit 0")
148 | elif normalizedLine.StartsWith("#I") then
149 | let pathStrings = normalizedLine.Replace("#I ", "");
150 | IncludePath(ParsePaths(pathStrings))
151 | elif normalizedLine.StartsWith("#load") then
152 | let pathStrings = normalizedLine.Replace("#load ", "");
153 | let files = ParsePaths(pathStrings) |> Seq.map sourceFile.ResolveRelativePath
154 | IncludeFiles(files)
155 | elif normalizedLine.StartsWith("#!") then
156 | Skipped
157 | else
158 | SourceCode(normalizedLine)
159 | else SourceCode(normalizedLine)
160 |
161 | let rec public ProcessLine verbose state sourceFile line =
162 | let normalizedLine = Regex.Replace(line, "\\s+\\#\\s+", "#")
163 | let lineResult = classifyLine sourceFile normalizedLine
164 | match lineResult with
165 | | SourceCode(code) -> sourceFile.WriteLine(code)
166 | | Unsupported -> ()
167 | | Skipped -> ()
168 | | AddNugetFeed(code) -> state.nugetSources <- Seq.append state.nugetSources [code]
169 | | IncludePath(files) -> sourceFile.AddIncludePaths(files)
170 | | IncludeFiles(files) -> for file in files do
171 | if verbose then Console.WriteLine($"Including {file}")
172 | let innerFile = new SourceFile(file)
173 | sourceFile.AddSourceDependency(innerFile)
174 | let entryPoint = state.sourceFiles |> Array.last
175 | state.sourceFiles <- findTree entryPoint |> Seq.toArray
176 | ProcessFile state innerFile verbose
177 | | IncludeReference(references, packages: seq, projectReferences) ->
178 | state.references <- Seq.append state.references references
179 | state.projectReferences <- Seq.append state.projectReferences projectReferences
180 | state.packageReferences <- Seq.append state.packageReferences packages
181 |
182 | ()
183 |
184 | and public ProcessFile state sourceFile verbose =
185 | let worker = ProcessLine verbose state sourceFile
186 | let mutable insertedModule = false
187 | sourceFile.ReadContent()
188 | |> Seq.iteri (fun i line ->
189 | if insertedModule || (String.IsNullOrWhiteSpace(line.Trim()) || line.TrimStart().StartsWith("//"))
190 | then worker line
191 | else
192 | let trimmed = line.TrimStart()
193 | insertedModule <- true
194 | if not (trimmed.StartsWith("namespace ") || trimmed.StartsWith("namespace\t")) then
195 | sourceFile.WriteLine($"module {GetModuleName(sourceFile)}")
196 | worker line)
197 | ()
198 |
199 |
200 |
--------------------------------------------------------------------------------
/FSharpPacker.FSharp/Program.fs:
--------------------------------------------------------------------------------
1 | module FSharpPacker.Program
2 |
3 | open System
4 | open System.Diagnostics
5 | open System.IO
6 | open FSharpPacker
7 | open Argu
8 |
9 | type CliArguments =
10 | | [] Framework of framework:string
11 | | [] Verbose
12 | | [] NoSelfContained
13 | | [] SingeFile
14 | | AOT
15 | | [] File of file:string
16 | | ProjectRef of projectReferences:string list
17 |
18 | interface IArgParserTemplate with
19 | member s.Usage =
20 | match s with
21 | | Framework _ -> "Specify target framework (e.g. net6.0)"
22 | | Verbose -> "Verbose output"
23 | | File _ -> ".fsx file to convert to executable file"
24 | | AOT -> "Enable AOT-compilation"
25 | | SingeFile -> "Produce single file"
26 | | NoSelfContained -> "Don't publish as self-contained (with dotnet runtime included)"
27 | | ProjectRef _ -> "Add project references to the script, so you can use classes from them"
28 |
29 | []
30 | let main argv =
31 | let errorHandler = ProcessExiter(colorizer = function ErrorCode.HelpText -> None | _ -> Some ConsoleColor.Red)
32 | let parser = ArgumentParser.Create(programName = "fspack", errorHandler = errorHandler)
33 |
34 | let results = parser.ParseCommandLine (inputs=argv, ignoreUnrecognized = true)
35 |
36 |
37 | let sourceFileName = results.GetResult(CliArguments.File)
38 | let targetFramework = results.GetResult(CliArguments.Framework, defaultValue = "net6.0")
39 | let verbose = match results.TryGetResult(CliArguments.Verbose) with | Some _ -> true |None -> false
40 | let preprocessor = FsxPreprocessor(verbose = verbose)
41 | preprocessor.AddSource(sourceFileName) |> ignore
42 | preprocessor.Process()
43 | results.GetResult(CliArguments.ProjectRef, defaultValue = []) |> List.iter preprocessor.AddProjectReference
44 |
45 | let sourceFiles = preprocessor.GetSources()
46 |
47 | let sourceFilesList =
48 | sourceFiles
49 | |> Array.map (fun sf ->
50 | let tempSource = Path.GetTempFileName() + ".fs"
51 | File.WriteAllText(tempSource, sf.ReadProducedFile())
52 | $"")
53 | |> fun x -> String.Join(Environment.NewLine, x)
54 |
55 | let packageReferences = preprocessor.GetPackageReferences()
56 | let packageReferencesList =
57 | packageReferences
58 | |> Array.map (fun pr ->
59 | $""
60 | )
61 | |> fun x -> String.Join(Environment.NewLine, x)
62 | let references = preprocessor.GetReferences()
63 | let referencesList =
64 | references
65 | |> Array.map (fun pr ->
66 | $"{pr}"
67 | )
68 | |> fun x -> String.Join(Environment.NewLine, x)
69 | let projectReferences = preprocessor.GetProjectReferences()
70 | let projectReferencesList =
71 | projectReferences
72 | |> Array.map (fun projectReferences ->
73 | $""
74 | )
75 | |> fun x -> String.Join(Environment.NewLine, x)
76 | let defineInteractive = true;
77 | let projectContent = $"""
78 |
79 | {Path.GetFileNameWithoutExtension(sourceFileName)}
80 | Exe
81 | {targetFramework}
82 | {(if defineInteractive then "$(DefineConstants);INTERACTIVE;COMPILED_INTERACTIVE" else String.Empty)}
83 |
84 |
85 |
86 | {projectReferencesList}
87 |
88 |
89 |
90 | {packageReferencesList}
91 |
92 |
93 |
94 | {referencesList}
95 |
96 |
97 |
98 | {sourceFilesList}
99 |
100 |
101 |
102 | """
103 |
104 | let path = Path.GetTempFileName()
105 | let tempProject = path + ".fsproj";
106 | File.WriteAllText(tempProject, projectContent);
107 |
108 | let selfContained = match results.TryGetResult(CliArguments.NoSelfContained) with | Some _ -> false |None -> true
109 | let doAot = match results.TryGetResult(CliArguments.AOT) with | Some _ -> true |None -> false
110 | let doSingleFile = match results.TryGetResult(CliArguments.SingeFile) with | Some _ -> true |None -> false
111 | let additionalArguments = results.UnrecognizedCliParams
112 |
113 | if verbose then Console.WriteLine($"Compiling generated file {tempProject}")
114 | let commandLineArguments = Array.append [| "publish"
115 | tempProject
116 | "-c"
117 | "Release"
118 | if doAot then "/p:PublishAot=true" else ""
119 | if doSingleFile then "/p:PublishSingleFile=true" else ""
120 | if doSingleFile then "/p:IncludeNativeLibrariesForSelfExtract=true" else ""
121 | if selfContained then "--self-contained" else "--no-self-contained"|]
122 | (additionalArguments |> List.toArray)
123 | if verbose then Console.WriteLine($"""Running dotnet {String.Join(" ", commandLineArguments)}""")
124 | let prc = Process.Start("dotnet", commandLineArguments)
125 | prc.WaitForExit()
126 | prc.ExitCode
127 |
--------------------------------------------------------------------------------
/FSharpPacker.FSharp/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "FSharpPacker.FSharp": {
4 | "commandName": "Project",
5 | "commandLineArgs": "C:\\d\\my\\lesson1\\lesson15.fsx -sf -r win-x86 --framework net7.0 -o x86 -p:EnableCompressionInSingleFile=true"
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/FSharpPacker.Tests/FSharpPacker.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 | enable
6 | enable
7 |
8 | false
9 |
10 |
11 |
12 |
13 | all
14 | runtime; build; native; contentfiles; analyzers; buildtransitive
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/ConditionalCompilation.fsx:
--------------------------------------------------------------------------------
1 | #if INTERACTIVE
2 | printfn "INTERACTIVE"
3 | #else
4 | printfn "NOT INTERACTIVE"
5 | #endif
6 |
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/FsProjReferenceExtension.fsx:
--------------------------------------------------------------------------------
1 | #r "fsproj: test.fsproj"
2 | printfn "Hello, world"
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/HelpCommand.fsx:
--------------------------------------------------------------------------------
1 | printfn "Hello, world"
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/IncludePath.fsx:
--------------------------------------------------------------------------------
1 | printfn "Hello, world"
2 | #I "Level1"
3 | #load "Quit.fsx"
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/Level1/Loader.fsx:
--------------------------------------------------------------------------------
1 | #load "WithNamespace.fsx"
2 | #load "WithNamespaceAndComments.fsx"
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/Level1/Quit.fsx:
--------------------------------------------------------------------------------
1 | #quit
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/Level1/WithNamespace.fsx:
--------------------------------------------------------------------------------
1 | namespace Asfaload.Collector
2 | module Queue=
3 | let f (s:string) = s
4 |
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/Level1/WithNamespaceAndComments.fsx:
--------------------------------------------------------------------------------
1 | // Use this
2 | namespace Asfaload.Collector
3 | module Queue=
4 | let f (s:string) = s
5 |
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/LoadFile.fsx:
--------------------------------------------------------------------------------
1 | printfn "Hello, world"
2 | #load "Level1/Quit.fsx"
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/MultipleLoadDirectivesFile.fsx:
--------------------------------------------------------------------------------
1 | #load "Level1/Loader.fsx"
2 | printfn "Hello, world"
3 |
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/MultipleLoadFile.fsx:
--------------------------------------------------------------------------------
1 | printfn "Hello, world"
2 | #load "HelpCommand.fsx" "Level1/Quit.fsx"
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/Namespaces.fsx:
--------------------------------------------------------------------------------
1 | #load "Level1/WithNamespace.fsx"
2 | printfn "Hello, world"
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/NamespacesWithComments.fsx:
--------------------------------------------------------------------------------
1 | #load "Level1/WithNamespaceAndComments.fsx"
2 | printfn "Hello, world"
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/NugetCustomFeed.fsx:
--------------------------------------------------------------------------------
1 | #i "nuget: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json"
2 | printfn "Hello, world"
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/NugetExplicitVersion.fsx:
--------------------------------------------------------------------------------
1 | #r "nuget: DiffSharp-lite, 1.0.0-preview-328097867"
2 | printfn "Hello, world"
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/NugetLastVersion.fsx:
--------------------------------------------------------------------------------
1 | #r "nuget: Newtonsoft.Json"
2 | printfn "Hello, world"
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/PlainFsharp.fsx:
--------------------------------------------------------------------------------
1 | printfn "Hello, world"
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/QuitCommand.fsx:
--------------------------------------------------------------------------------
1 | printfn "Hello, world"
2 | #quit
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/RegularReference.fsx:
--------------------------------------------------------------------------------
1 | #r "fake_dll.fsx"
2 | printfn "Hello, world"
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/Shebang.fsx:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env -S dotnet fsi
2 |
3 | printfn "Hello, world!"
4 |
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/TimeCommands.fsx:
--------------------------------------------------------------------------------
1 | #time "on"
2 | printfn "Hello, world"
3 | #time "off"
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/fake_dll.fsx:
--------------------------------------------------------------------------------
1 | printfn "Hello, world"
2 | #I "Level1"
3 | #load "Quit.fsx"
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/lowercase-script.fsx:
--------------------------------------------------------------------------------
1 | #load "testscript.fsx"
2 | open Testscript
3 | testScript()
4 |
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Samples/testscript.fsx:
--------------------------------------------------------------------------------
1 | open System
2 | let testScript() = Console.WriteLine 1
3 |
--------------------------------------------------------------------------------
/FSharpPacker.Tests/UnitTest1.cs:
--------------------------------------------------------------------------------
1 | namespace FSharpPacker.Tests;
2 |
3 | [TestClass]
4 | public class UnitTest1
5 | {
6 | [TestMethod]
7 | public void PassthroughFileContent()
8 | {
9 | var sourceFile = "Samples/PlainFsharp.fsx";
10 | var preprocessor = new FsxPreprocessor(verbose:false);
11 | preprocessor.AddSource(sourceFile);
12 |
13 | preprocessor.Process();
14 |
15 | Assert.AreEqual("module PlainFsharp" + Environment.NewLine + "printfn \"Hello, world\"" + Environment.NewLine, preprocessor.GetSource(sourceFile));
16 | }
17 | [TestMethod]
18 | public void HelpCommand()
19 | {
20 | var sourceFile = "Samples/HelpCommand.fsx";
21 | var preprocessor = new FsxPreprocessor(verbose:false);
22 | preprocessor.AddSource(sourceFile);
23 |
24 | preprocessor.Process();
25 |
26 | Assert.AreEqual("module HelpCommand" + Environment.NewLine + "printfn \"Hello, world\"" + Environment.NewLine, preprocessor.GetSource(sourceFile));
27 | }
28 | [TestMethod]
29 | public void TimeCommands()
30 | {
31 | var sourceFile = "Samples/TimeCommands.fsx";
32 | var preprocessor = new FsxPreprocessor(verbose:false);
33 | preprocessor.AddSource(sourceFile);
34 |
35 | preprocessor.Process();
36 |
37 | Assert.AreEqual("module TimeCommands" + Environment.NewLine + "printfn \"Hello, world\"" + Environment.NewLine, preprocessor.GetSource(sourceFile));
38 | }
39 | [TestMethod]
40 | public void QuitCommand()
41 | {
42 | var sourceFile = "Samples/QuitCommand.fsx";
43 | var preprocessor = new FsxPreprocessor(verbose:false);
44 | preprocessor.AddSource(sourceFile);
45 |
46 | preprocessor.Process();
47 |
48 | Assert.AreEqual("module QuitCommand" + Environment.NewLine + "printfn \"Hello, world\"" + Environment.NewLine + "System.Environment.Exit 0" + Environment.NewLine, preprocessor.GetSource(sourceFile));
49 | }
50 | [TestMethod]
51 | public void ResolveReferences()
52 | {
53 | var sourceFile = "Samples/RegularReference.fsx";
54 | var preprocessor = new FsxPreprocessor(verbose:false);
55 | preprocessor.AddSource(sourceFile);
56 |
57 | preprocessor.Process();
58 |
59 | Assert.AreEqual("module RegularReference" + Environment.NewLine + "printfn \"Hello, world\"" + Environment.NewLine, preprocessor.GetSource(sourceFile));
60 | var assemblies = preprocessor.GetReferences();
61 | Assert.AreEqual(1, assemblies.Length);
62 | Assert.AreEqual(Path.GetFullPath("Samples/fake_dll.fsx"), assemblies[0]);
63 | }
64 | [TestMethod]
65 | public void NugetPackageWithoutVersion()
66 | {
67 | var sourceFile = "Samples/NugetLastVersion.fsx";
68 | var preprocessor = new FsxPreprocessor(verbose:false);
69 | preprocessor.AddSource(sourceFile);
70 |
71 | preprocessor.Process();
72 |
73 | Assert.AreEqual("module NugetLastVersion" + Environment.NewLine + "printfn \"Hello, world\"" + Environment.NewLine, preprocessor.GetSource(sourceFile));
74 | var assemblies = preprocessor.GetReferences();
75 | Assert.AreEqual(0, assemblies.Length);
76 | var packages = preprocessor.GetPackageReferences();
77 | Assert.AreEqual(1, packages.Length);
78 | Assert.AreEqual("Newtonsoft.Json", packages[0].Name);
79 | Assert.AreEqual("*", packages[0].Version);
80 | }
81 | [TestMethod]
82 | public void NugetPackageWithExplicitVersion()
83 | {
84 | var sourceFile = "Samples/NugetExplicitVersion.fsx";
85 | var preprocessor = new FsxPreprocessor(verbose:false);
86 | preprocessor.AddSource(sourceFile);
87 |
88 | preprocessor.Process();
89 |
90 | Assert.AreEqual("module NugetExplicitVersion" + Environment.NewLine + "printfn \"Hello, world\"" + Environment.NewLine, preprocessor.GetSource(sourceFile));
91 | var assemblies = preprocessor.GetReferences();
92 | Assert.AreEqual(0, assemblies.Length);
93 | var packages = preprocessor.GetPackageReferences();
94 | Assert.AreEqual(1, packages.Length);
95 | Assert.AreEqual("DiffSharp-lite", packages[0].Name);
96 | Assert.AreEqual("1.0.0-preview-328097867", packages[0].Version);
97 | }
98 | [TestMethod]
99 | public void NugetCustomFeed()
100 | {
101 | var sourceFile = "Samples/NugetCustomFeed.fsx";
102 | var preprocessor = new FsxPreprocessor(verbose:false);
103 | preprocessor.AddSource(sourceFile);
104 |
105 | preprocessor.Process();
106 |
107 | Assert.AreEqual("module NugetCustomFeed" + Environment.NewLine + "printfn \"Hello, world\"" + Environment.NewLine, preprocessor.GetSource(sourceFile));
108 | var assemblies = preprocessor.GetReferences();
109 | Assert.AreEqual(0, assemblies.Length);
110 | var packageSources = preprocessor.GetPackageSources();
111 | Assert.AreEqual(1, packageSources.Length);
112 | Assert.AreEqual("https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json", packageSources[0]);
113 | }
114 | [TestMethod]
115 | public void FsProjReferenceExtension()
116 | {
117 | var sourceFile = "Samples/FsProjReferenceExtension.fsx";
118 | var preprocessor = new FsxPreprocessor(verbose: false);
119 | preprocessor.AddSource(sourceFile);
120 |
121 | preprocessor.Process();
122 |
123 | Assert.AreEqual("module FsProjReferenceExtension" + Environment.NewLine + "printfn \"Hello, world\"" + Environment.NewLine, preprocessor.GetSource(sourceFile));
124 | var assemblies = preprocessor.GetReferences();
125 | Assert.AreEqual(0, assemblies.Length);
126 | var projectReferences = preprocessor.GetProjectReferences();
127 | Assert.AreEqual(1, projectReferences.Length);
128 | Assert.AreEqual("test.fsproj", projectReferences[0]);
129 | }
130 | [TestMethod]
131 | public void LoadFile()
132 | {
133 | var sourceFile = "Samples/LoadFile.fsx";
134 | var preprocessor = new FsxPreprocessor(verbose:false);
135 | preprocessor.AddSource(sourceFile);
136 |
137 | preprocessor.Process();
138 |
139 | Assert.AreEqual("module LoadFile" + Environment.NewLine + "printfn \"Hello, world\"" + Environment.NewLine, preprocessor.GetSource(sourceFile));
140 | var sources = preprocessor.GetSources();
141 | Assert.AreEqual(2, sources.Length);
142 | }
143 |
144 | [TestMethod]
145 | public void MultipleLoadFile()
146 | {
147 | var sourceFile = "Samples/MultipleLoadFile.fsx";
148 | var preprocessor = new FsxPreprocessor(verbose:false);
149 | preprocessor.AddSource(sourceFile);
150 |
151 | preprocessor.Process();
152 |
153 | Assert.AreEqual("module MultipleLoadFile" + Environment.NewLine + "printfn \"Hello, world\"" + Environment.NewLine, preprocessor.GetSource(sourceFile));
154 | var sources = preprocessor.GetSources();
155 | Assert.AreEqual(3, sources.Length);
156 | }
157 |
158 | [TestMethod]
159 | public void LowercaseScriptWithDashesInName()
160 | {
161 | var sourceFile = "Samples/lowercase-script.fsx";
162 | var preprocessor = new FsxPreprocessor(verbose:false);
163 | preprocessor.AddSource(sourceFile);
164 |
165 | preprocessor.Process();
166 |
167 | var sources = preprocessor.GetSources();
168 | Assert.AreEqual(2, sources.Length);
169 | // we expect module name of test in lowercase should be in pascal case
170 | Assert.AreEqual("module Testscript" + Environment.NewLine + "open System" + Environment.NewLine + "let testScript() = Console.WriteLine 1" + Environment.NewLine, sources[0].ReadProducedFile());
171 | // we expect module name of test in kebabcase should be escaped correctly
172 | Assert.AreEqual("module ``lowercase-script``" + Environment.NewLine + "open Testscript" + Environment.NewLine + "testScript()" + Environment.NewLine, sources[1].ReadProducedFile());
173 | }
174 | [TestMethod]
175 | public void IncludePath()
176 | {
177 | var sourceFile = "Samples/IncludePath.fsx";
178 | var preprocessor = new FsxPreprocessor(verbose:false);
179 | preprocessor.AddSource(sourceFile);
180 |
181 | preprocessor.Process();
182 |
183 | Assert.AreEqual("module IncludePath" + Environment.NewLine + "printfn \"Hello, world\"" + Environment.NewLine, preprocessor.GetSource(sourceFile));
184 | var sources = preprocessor.GetSources();
185 | Assert.AreEqual(2, sources.Length);
186 | }
187 | [TestMethod]
188 | public void ConditionalCompilation()
189 | {
190 | var sourceFile = "Samples/ConditionalCompilation.fsx";
191 | var preprocessor = new FsxPreprocessor(verbose: false);
192 | preprocessor.AddSource(sourceFile);
193 |
194 | preprocessor.Process();
195 |
196 | Assert.AreEqual("module ConditionalCompilation" + Environment.NewLine + "#if INTERACTIVE" + Environment.NewLine + "printfn \"INTERACTIVE\"" + Environment.NewLine + "#else" + Environment.NewLine + "printfn \"NOT INTERACTIVE\"" + Environment.NewLine + "#endif" + Environment.NewLine, preprocessor.GetSource(sourceFile));
197 | var sources = preprocessor.GetSources();
198 | Assert.AreEqual(1, sources.Length);
199 | }
200 | [TestMethod]
201 | public void NamespacesInLoadFiles()
202 | {
203 | var sourceFile = "Samples/Namespaces.fsx";
204 | var preprocessor = new FsxPreprocessor(verbose: true);
205 | preprocessor.AddSource(sourceFile);
206 |
207 | preprocessor.Process();
208 |
209 | Assert.AreEqual(@"module Namespaces
210 | printfn ""Hello, world""
211 | ".ReplaceLineEndings(), preprocessor.GetSource(sourceFile));
212 |
213 | Assert.AreEqual(@"namespace Asfaload.Collector
214 | module Queue=
215 | let f (s:string) = s
216 | ".ReplaceLineEndings(), preprocessor.FindSource(_ => _.EndsWith("Level1/WithNamespace.fsx")));
217 | }
218 | [TestMethod]
219 | public void NamespacesWithCommentsInLoadFiles()
220 | {
221 | var sourceFile = "Samples/NamespacesWithComments.fsx";
222 | var preprocessor = new FsxPreprocessor(verbose: true);
223 | preprocessor.AddSource(sourceFile);
224 |
225 | preprocessor.Process();
226 |
227 | Assert.AreEqual(@"module NamespacesWithComments
228 | printfn ""Hello, world""
229 | ".ReplaceLineEndings(), preprocessor.GetSource(sourceFile));
230 |
231 | Assert.AreEqual(@"// Use this
232 | namespace Asfaload.Collector
233 | module Queue=
234 | let f (s:string) = s
235 | ".ReplaceLineEndings(), preprocessor.FindSource(_ => _.EndsWith("Level1/WithNamespaceAndComments.fsx")));
236 | }
237 | [TestMethod]
238 | public void MultipleLoadDirectivesFile()
239 | {
240 | var sourceFile = "Samples/MultipleLoadDirectivesFile.fsx";
241 | var preprocessor = new FsxPreprocessor(verbose: true);
242 | preprocessor.AddSource(sourceFile);
243 |
244 | preprocessor.Process();
245 |
246 | CollectionAssert.AreEqual(new string[] { "WithNamespace.fsx", "WithNamespaceAndComments.fsx", "Loader.fsx", "MultipleLoadDirectivesFile.fsx" }, preprocessor.GetSources().Select(_ => Path.GetFileName(_.FileName)).ToArray());
247 | }
248 | [TestMethod]
249 | public void Shebang()
250 | {
251 | var sourceFile = "Samples/Shebang.fsx";
252 | var preprocessor = new FsxPreprocessor(verbose: false);
253 | preprocessor.AddSource(sourceFile);
254 |
255 | preprocessor.Process();
256 |
257 | Assert.AreEqual("module Shebang" + Environment.NewLine + Environment.NewLine + "printfn \"Hello, world!\"" + Environment.NewLine, preprocessor.GetSource(sourceFile));
258 | }
259 | }
--------------------------------------------------------------------------------
/FSharpPacker.Tests/Usings.cs:
--------------------------------------------------------------------------------
1 | global using Microsoft.VisualStudio.TestTools.UnitTesting;
--------------------------------------------------------------------------------
/FSharpPacker.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.4.32912.340
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FSharpPacker.Tests", "FSharpPacker.Tests\FSharpPacker.Tests.csproj", "{0F8BDD37-4B22-43C3-910C-B3A3DDABEDAC}"
7 | EndProject
8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{534D7B89-96BA-42F3-8AAE-8051C8A7504D}"
9 | ProjectSection(SolutionItems) = preProject
10 | nuget.config = nuget.config
11 | README.md = README.md
12 | EndProjectSection
13 | EndProject
14 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharpPacker.FSharp", "FSharpPacker.FSharp\FSharpPacker.FSharp.fsproj", "{B9185DFF-E9FC-4464-B08B-EE49608210FD}"
15 | EndProject
16 | Global
17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
18 | Debug|Any CPU = Debug|Any CPU
19 | Release|Any CPU = Release|Any CPU
20 | EndGlobalSection
21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
22 | {0F8BDD37-4B22-43C3-910C-B3A3DDABEDAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23 | {0F8BDD37-4B22-43C3-910C-B3A3DDABEDAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
24 | {0F8BDD37-4B22-43C3-910C-B3A3DDABEDAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
25 | {0F8BDD37-4B22-43C3-910C-B3A3DDABEDAC}.Release|Any CPU.Build.0 = Release|Any CPU
26 | {B9185DFF-E9FC-4464-B08B-EE49608210FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27 | {B9185DFF-E9FC-4464-B08B-EE49608210FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
28 | {B9185DFF-E9FC-4464-B08B-EE49608210FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
29 | {B9185DFF-E9FC-4464-B08B-EE49608210FD}.Release|Any CPU.Build.0 = Release|Any CPU
30 | EndGlobalSection
31 | GlobalSection(SolutionProperties) = preSolution
32 | HideSolutionNode = FALSE
33 | EndGlobalSection
34 | GlobalSection(ExtensibilityGlobals) = postSolution
35 | SolutionGuid = {53A28840-8B55-4996-B5F6-6886AC86A8CC}
36 | EndGlobalSection
37 | EndGlobal
38 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Andrii Kurdiumov
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | FSharp Packer
2 | =============
3 |
4 | This tool allows package FSX files as self-contained executables.
5 |
6 | Installation:
7 |
8 | ```shell
9 | dotnet tool install --global FSharpPacker
10 | ```
11 |
12 | ### [Nix](https://nixos.org/manual/nix/stable/) (Nix/NixOS)
13 |
14 | Nix w/ [Flakes](https://nixos.wiki/wiki/Flakes)
15 | ```
16 | nix profile install github:kant2002/FSharpPacker
17 | ```
18 |
19 | Run without installing
20 | ```
21 | nix run github:kant2002/FSharpPacker -- --help
22 | ```
23 |
24 | # Usage
25 |
26 | USAGE: `fspack [--help] [--framework ] [--verbose] [--noselfcontained] [--aot] `
27 |
28 | FILE:
29 |
30 | .fsx file to convert to executable file
31 |
32 | OPTIONS:
33 |
34 | --framework, -f
35 | Specify target framework (e.g. net6.0)
36 | --verbose, -v Verbose output
37 | --noselfcontained, -nsc
38 | Don't publish as self-contained (with dotnet runtime included)
39 | --singefile, -sf Produce single file
40 | --aot, -aot Enable AOT-compilation
41 | --projectref [...]
42 | Add project references to the script, so you can use classes from them
43 | --help display this list of options.
44 |
45 |
46 | **Please note that the app is produced as self-contained by default.**
47 |
48 |
49 |
50 | Simple usage:
51 |
52 | ```shell
53 | fspack fsx-file.fsx []
54 | ```
55 |
56 | For example:
57 | ```shell
58 | fspack FSharpPacker.Tests\Samples\LoadFile.fsx -o test -r win-x64
59 | test\LoadFile.exe
60 | ```
61 |
62 | for AOT build
63 | ```shell
64 | fspack FSharpPacker.Tests\Samples\LoadFile.fsx -aot -o test-aot -r win-x64 -f net7.0
65 | test-aot\LoadFile.exe
66 | ```
67 |
68 | Self-contained with dotnet 7 and a single-file executable:
69 | ```shell
70 | fspack FSharpPacker.Tests/Samples/LoadFile.fsx -o test-single-file -r win-x64 -f net7.0 -sf -p:EnableCompressionInSingleFile=true
71 | test-single-file\LoadFile.exe
72 | ```
73 |
74 | ## Extensions
75 |
76 | You can specify project reference using `--projectref` option. There can be more then one project references.
77 | Also script now supported [DependencyManager.FsProj](https://github.com/ThisFunctionalTom/DependencyManager.FsProj) extension which allow you specify `#r "fsproj: test.fsproj"` inside FSX file.
78 |
79 | # Supported FSX directives
80 |
81 | | Directive | Status | Notes |
82 | | --------- | ------- | -----
83 | | #load | :white_check_mark: | |
84 | | #r "path\file.dll" | :white_check_mark: | |
85 | | #r "nuget: package" | :white_check_mark: | |
86 | | #r "nuget: package, version" | :white_check_mark: | |
87 | | #r "fsproj: custom-path-search-hint" | :white_large_square: | |
88 | | #load | :white_check_mark: | |
89 | | #i "nuget: source-feed" | :white_check_mark: | |
90 | | #quit | :white_check_mark: | |
91 | | #r "custom: custom-path" | :white_large_square: | This is tricky and require deep involvement with FSharp.Compiler.Services |
92 | | #I "custom: custom-path-search-hint" | :white_large_square: | |
93 |
94 | # Ignored FSX directives
95 |
96 | | Directive |
97 | | --------- |
98 | | #help |
99 | | #time |
100 |
101 | # Producing Nuget package
102 |
103 | ```shell
104 | dotnet pack FSharpPacker.FSharp -c Release
105 | dotnet tool install FSharpPacker --global --add-source FSharpPacker.FSharp\bin\Release\
106 | ```
107 |
108 | ```shell
109 | dotnet tool uninstall -g FSharpPacker
110 | ```
--------------------------------------------------------------------------------
/build.nix:
--------------------------------------------------------------------------------
1 | { pkgs, src }:
2 | pkgs.buildDotnetModule rec {
3 | inherit src;
4 |
5 | pname = "fspack";
6 | name = "fspack";
7 |
8 |
9 | projectFile = "FSharpPacker.FSharp/FSharpPacker.FSharp.fsproj";
10 | testProjectFile = "FSharpPacker.Tests/FSharpPacker.Tests.csproj";
11 | nugetDeps = ./deps.nix;
12 |
13 | doCheck = false;
14 | dotnet-sdk = pkgs.dotnetCorePackages.sdk_6_0;
15 | dotnet-runtime = pkgs.dotnetCorePackages.aspnetcore_6_0;
16 |
17 | runtimeDeps = [
18 | pkgs.dotnetCorePackages.sdk_6_0
19 | ];
20 |
21 | postPatch = ''
22 | # this fixes "dotnet" path
23 | substituteInPlace \
24 | FSharpPacker.FSharp/Program.fs \
25 | --replace \
26 | 'Process.Start("dotnet"' \
27 | 'Process.Start("${pkgs.dotnetCorePackages.sdk_6_0}/bin/dotnet"'
28 | '';
29 |
30 | postFixup = ''
31 | mv $out/bin/FSharpPacker.FSharp $out/bin/fspack
32 | '';
33 | executables = [ "FSharpPacker.FSharp" ];
34 | }
35 |
--------------------------------------------------------------------------------
/deps.nix:
--------------------------------------------------------------------------------
1 | { fetchNuGet }: [
2 | (fetchNuGet { pname = "Argu"; version = "6.1.1"; sha256 = "1v996g0760qhiys2ahdpnvkldaxr2jn5f1falf789glnk4a6f3xl"; })
3 | (fetchNuGet { pname = "coverlet.collector"; version = "3.1.2"; sha256 = "0gsk2q93qw7pqxwd4pdyq5364wz0lvldcqqnf4amz13jaq86idmz"; })
4 | (fetchNuGet { pname = "FSharp.Core"; version = "7.0.0"; sha256 = "1pgk3qk9p1s53wvja17744x4bf7zs3a3wf0dmxi66w1w06z7i85x"; })
5 | (fetchNuGet { pname = "Microsoft.AspNetCore.App.Ref"; version = "6.0.11"; sha256 = "15n8x52njzxs2cwzzswi0kawm673jkvf2yga87jaf7hr729bfmcr"; })
6 | (fetchNuGet { pname = "Microsoft.CodeCoverage"; version = "17.2.0"; sha256 = "018yl113i037m5qhm3z6csb0c4l8kj412dxw2dagdbj07qbxwikj"; })
7 | (fetchNuGet { pname = "Microsoft.CSharp"; version = "4.0.1"; sha256 = "0zxc0apx1gcx361jlq8smc9pfdgmyjh6hpka8dypc9w23nlsh6yj"; })
8 | (fetchNuGet { pname = "Microsoft.CSharp"; version = "4.3.0"; sha256 = "0gw297dgkh0al1zxvgvncqs0j15lsna9l1wpqas4rflmys440xvb"; })
9 | (fetchNuGet { pname = "Microsoft.NET.Test.Sdk"; version = "17.2.0"; sha256 = "0ncnq378pk1immy2dyf75xjf2xn72r4m5gma1njhc4rvhzx9qz11"; })
10 | (fetchNuGet { pname = "Microsoft.NETCore.App.Ref"; version = "6.0.11"; sha256 = "1j64ppdvh5s3pqr6sm3sq9bmk3fzj7l4j3bx023zn3dyllibpv68"; })
11 | (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "1.0.1"; sha256 = "01al6cfxp68dscl15z7rxfw9zvhm64dncsw09a1vmdkacsa2v6lr"; })
12 | (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "1.1.0"; sha256 = "08vh1r12g6ykjygq5d3vq09zylgb84l63k49jc4v8faw9g93iqqm"; })
13 | (fetchNuGet { pname = "Microsoft.NETCore.Targets"; version = "1.0.1"; sha256 = "0ppdkwy6s9p7x9jix3v4402wb171cdiibq7js7i13nxpdky7074p"; })
14 | (fetchNuGet { pname = "Microsoft.NETCore.Targets"; version = "1.1.0"; sha256 = "193xwf33fbm0ni3idxzbr5fdq3i2dlfgihsac9jj7whj0gd902nh"; })
15 | (fetchNuGet { pname = "Microsoft.TestPlatform.ObjectModel"; version = "17.2.0"; sha256 = "0l05smcgjzdfa5f60f9q5lylap3i21aswxbava92s19bgv46w2rv"; })
16 | (fetchNuGet { pname = "Microsoft.TestPlatform.TestHost"; version = "17.2.0"; sha256 = "1238hx3hdg22s123cxygdfm89h54abw1jv6az6hl8h76ip39ybdp"; })
17 | (fetchNuGet { pname = "Microsoft.Win32.Primitives"; version = "4.3.0"; sha256 = "0j0c1wj4ndj21zsgivsc24whiya605603kxrbiw6wkfdync464wq"; })
18 | (fetchNuGet { pname = "MSTest.TestAdapter"; version = "2.2.10"; sha256 = "0w6c55n30w6imm0rjafl2sg0x8vf9852xmil9dzqb4h36cs7v6y6"; })
19 | (fetchNuGet { pname = "MSTest.TestFramework"; version = "2.2.10"; sha256 = "0j5p3p5a0pr3rmzg7va21z3w0lb929zqj5xcdd81iys5vvh1hjiw"; })
20 | (fetchNuGet { pname = "NETStandard.Library"; version = "1.6.1"; sha256 = "1z70wvsx2d847a2cjfii7b83pjfs34q05gb037fdjikv5kbagml8"; })
21 | (fetchNuGet { pname = "Newtonsoft.Json"; version = "10.0.3"; sha256 = "06vy67bkshclpz69kps4vgzc9h2cgg41c8vlqmdbwclfky7c4haq"; })
22 | (fetchNuGet { pname = "Newtonsoft.Json"; version = "9.0.1"; sha256 = "0mcy0i7pnfpqm4pcaiyzzji4g0c8i3a5gjz28rrr28110np8304r"; })
23 | (fetchNuGet { pname = "NuGet.Frameworks"; version = "5.11.0"; sha256 = "0wv26gq39hfqw9md32amr5771s73f5zn1z9vs4y77cgynxr73s4z"; })
24 | (fetchNuGet { pname = "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "16rnxzpk5dpbbl1x354yrlsbvwylrq456xzpsha1n9y3glnhyx9d"; })
25 | (fetchNuGet { pname = "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0hkg03sgm2wyq8nqk6dbm9jh5vcq57ry42lkqdmfklrw89lsmr59"; })
26 | (fetchNuGet { pname = "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0c2p354hjx58xhhz7wv6div8xpi90sc6ibdm40qin21bvi7ymcaa"; })
27 | (fetchNuGet { pname = "runtime.native.System"; version = "4.3.0"; sha256 = "15hgf6zaq9b8br2wi1i3x0zvmk410nlmsmva9p0bbg73v6hml5k4"; })
28 | (fetchNuGet { pname = "runtime.native.System.IO.Compression"; version = "4.3.0"; sha256 = "1vvivbqsk6y4hzcid27pqpm5bsi6sc50hvqwbcx8aap5ifrxfs8d"; })
29 | (fetchNuGet { pname = "runtime.native.System.Net.Http"; version = "4.3.0"; sha256 = "1n6rgz5132lcibbch1qlf0g9jk60r0kqv087hxc0lisy50zpm7kk"; })
30 | (fetchNuGet { pname = "runtime.native.System.Security.Cryptography.Apple"; version = "4.3.0"; sha256 = "1b61p6gw1m02cc1ry996fl49liiwky6181dzr873g9ds92zl326q"; })
31 | (fetchNuGet { pname = "runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "18pzfdlwsg2nb1jjjjzyb5qlgy6xjxzmhnfaijq5s2jw3cm3ab97"; })
32 | (fetchNuGet { pname = "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0qyynf9nz5i7pc26cwhgi8j62ps27sqmf78ijcfgzab50z9g8ay3"; })
33 | (fetchNuGet { pname = "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "1klrs545awhayryma6l7g2pvnp9xy4z0r1i40r80zb45q3i9nbyf"; })
34 | (fetchNuGet { pname = "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple"; version = "4.3.0"; sha256 = "10yc8jdrwgcl44b4g93f1ds76b176bajd3zqi2faf5rvh1vy9smi"; })
35 | (fetchNuGet { pname = "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0zcxjv5pckplvkg0r6mw3asggm7aqzbdjimhvsasb0cgm59x09l3"; })
36 | (fetchNuGet { pname = "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0vhynn79ih7hw7cwjazn87rm9z9fj0rvxgzlab36jybgcpcgphsn"; })
37 | (fetchNuGet { pname = "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "160p68l2c7cqmyqjwxydcvgw7lvl1cr0znkw8fp24d1by9mqc8p3"; })
38 | (fetchNuGet { pname = "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "15zrc8fgd8zx28hdghcj5f5i34wf3l6bq5177075m2bc2j34jrqy"; })
39 | (fetchNuGet { pname = "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "1p4dgxax6p7rlgj4q73k73rslcnz4wdcv8q2flg1s8ygwcm58ld5"; })
40 | (fetchNuGet { pname = "System.AppContext"; version = "4.3.0"; sha256 = "1649qvy3dar900z3g817h17nl8jp4ka5vcfmsr05kh0fshn7j3ya"; })
41 | (fetchNuGet { pname = "System.Buffers"; version = "4.3.0"; sha256 = "0fgns20ispwrfqll4q1zc1waqcmylb3zc50ys9x8zlwxh9pmd9jy"; })
42 | (fetchNuGet { pname = "System.Collections"; version = "4.0.11"; sha256 = "1ga40f5lrwldiyw6vy67d0sg7jd7ww6kgwbksm19wrvq9hr0bsm6"; })
43 | (fetchNuGet { pname = "System.Collections"; version = "4.3.0"; sha256 = "19r4y64dqyrq6k4706dnyhhw7fs24kpp3awak7whzss39dakpxk9"; })
44 | (fetchNuGet { pname = "System.Collections.Concurrent"; version = "4.3.0"; sha256 = "0wi10md9aq33jrkh2c24wr2n9hrpyamsdhsxdcnf43b7y86kkii8"; })
45 | (fetchNuGet { pname = "System.Collections.NonGeneric"; version = "4.3.0"; sha256 = "07q3k0hf3mrcjzwj8fwk6gv3n51cb513w4mgkfxzm3i37sc9kz7k"; })
46 | (fetchNuGet { pname = "System.Collections.Specialized"; version = "4.3.0"; sha256 = "1sdwkma4f6j85m3dpb53v9vcgd0zyc9jb33f8g63byvijcj39n20"; })
47 | (fetchNuGet { pname = "System.ComponentModel"; version = "4.3.0"; sha256 = "0986b10ww3nshy30x9sjyzm0jx339dkjxjj3401r3q0f6fx2wkcb"; })
48 | (fetchNuGet { pname = "System.ComponentModel.Primitives"; version = "4.3.0"; sha256 = "1svfmcmgs0w0z9xdw2f2ps05rdxmkxxhf0l17xk9l1l8xfahkqr0"; })
49 | (fetchNuGet { pname = "System.ComponentModel.TypeConverter"; version = "4.3.0"; sha256 = "17ng0p7v3nbrg3kycz10aqrrlw4lz9hzhws09pfh8gkwicyy481x"; })
50 | (fetchNuGet { pname = "System.Configuration.ConfigurationManager"; version = "4.4.0"; sha256 = "1hjgmz47v5229cbzd2pwz2h0dkq78lb2wp9grx8qr72pb5i0dk7v"; })
51 | (fetchNuGet { pname = "System.Console"; version = "4.3.0"; sha256 = "1flr7a9x920mr5cjsqmsy9wgnv3lvd0h1g521pdr1lkb2qycy7ay"; })
52 | (fetchNuGet { pname = "System.Diagnostics.Debug"; version = "4.0.11"; sha256 = "0gmjghrqmlgzxivd2xl50ncbglb7ljzb66rlx8ws6dv8jm0d5siz"; })
53 | (fetchNuGet { pname = "System.Diagnostics.Debug"; version = "4.3.0"; sha256 = "00yjlf19wjydyr6cfviaph3vsjzg3d5nvnya26i2fvfg53sknh3y"; })
54 | (fetchNuGet { pname = "System.Diagnostics.DiagnosticSource"; version = "4.3.0"; sha256 = "0z6m3pbiy0qw6rn3n209rrzf9x1k4002zh90vwcrsym09ipm2liq"; })
55 | (fetchNuGet { pname = "System.Diagnostics.TextWriterTraceListener"; version = "4.3.0"; sha256 = "09db74f36wkwg30f7v7zhz1yhkyrnl5v6bdwljq1jdfgzcfch7c3"; })
56 | (fetchNuGet { pname = "System.Diagnostics.Tools"; version = "4.0.1"; sha256 = "19cknvg07yhakcvpxg3cxa0bwadplin6kyxd8mpjjpwnp56nl85x"; })
57 | (fetchNuGet { pname = "System.Diagnostics.Tools"; version = "4.3.0"; sha256 = "0in3pic3s2ddyibi8cvgl102zmvp9r9mchh82ns9f0ms4basylw1"; })
58 | (fetchNuGet { pname = "System.Diagnostics.TraceSource"; version = "4.3.0"; sha256 = "1kyw4d7dpjczhw6634nrmg7yyyzq72k75x38y0l0nwhigdlp1766"; })
59 | (fetchNuGet { pname = "System.Diagnostics.Tracing"; version = "4.3.0"; sha256 = "1m3bx6c2s958qligl67q7grkwfz3w53hpy7nc97mh6f7j5k168c4"; })
60 | (fetchNuGet { pname = "System.Dynamic.Runtime"; version = "4.0.11"; sha256 = "1pla2dx8gkidf7xkciig6nifdsb494axjvzvann8g2lp3dbqasm9"; })
61 | (fetchNuGet { pname = "System.Dynamic.Runtime"; version = "4.3.0"; sha256 = "1d951hrvrpndk7insiag80qxjbf2y0y39y8h5hnq9612ws661glk"; })
62 | (fetchNuGet { pname = "System.Globalization"; version = "4.0.11"; sha256 = "070c5jbas2v7smm660zaf1gh0489xanjqymkvafcs4f8cdrs1d5d"; })
63 | (fetchNuGet { pname = "System.Globalization"; version = "4.3.0"; sha256 = "1cp68vv683n6ic2zqh2s1fn4c2sd87g5hpp6l4d4nj4536jz98ki"; })
64 | (fetchNuGet { pname = "System.Globalization.Calendars"; version = "4.3.0"; sha256 = "1xwl230bkakzzkrggy1l1lxmm3xlhk4bq2pkv790j5lm8g887lxq"; })
65 | (fetchNuGet { pname = "System.Globalization.Extensions"; version = "4.3.0"; sha256 = "02a5zfxavhv3jd437bsncbhd2fp1zv4gxzakp1an9l6kdq1mcqls"; })
66 | (fetchNuGet { pname = "System.IO"; version = "4.1.0"; sha256 = "1g0yb8p11vfd0kbkyzlfsbsp5z44lwsvyc0h3dpw6vqnbi035ajp"; })
67 | (fetchNuGet { pname = "System.IO"; version = "4.3.0"; sha256 = "05l9qdrzhm4s5dixmx68kxwif4l99ll5gqmh7rqgw554fx0agv5f"; })
68 | (fetchNuGet { pname = "System.IO.Compression"; version = "4.3.0"; sha256 = "084zc82yi6yllgda0zkgl2ys48sypiswbiwrv7irb3r0ai1fp4vz"; })
69 | (fetchNuGet { pname = "System.IO.Compression.ZipFile"; version = "4.3.0"; sha256 = "1yxy5pq4dnsm9hlkg9ysh5f6bf3fahqqb6p8668ndy5c0lk7w2ar"; })
70 | (fetchNuGet { pname = "System.IO.FileSystem"; version = "4.0.1"; sha256 = "0kgfpw6w4djqra3w5crrg8xivbanh1w9dh3qapb28q060wb9flp1"; })
71 | (fetchNuGet { pname = "System.IO.FileSystem"; version = "4.3.0"; sha256 = "0z2dfrbra9i6y16mm9v1v6k47f0fm617vlb7s5iybjjsz6g1ilmw"; })
72 | (fetchNuGet { pname = "System.IO.FileSystem.Primitives"; version = "4.0.1"; sha256 = "1s0mniajj3lvbyf7vfb5shp4ink5yibsx945k6lvxa96r8la1612"; })
73 | (fetchNuGet { pname = "System.IO.FileSystem.Primitives"; version = "4.3.0"; sha256 = "0j6ndgglcf4brg2lz4wzsh1av1gh8xrzdsn9f0yznskhqn1xzj9c"; })
74 | (fetchNuGet { pname = "System.Linq"; version = "4.1.0"; sha256 = "1ppg83svb39hj4hpp5k7kcryzrf3sfnm08vxd5sm2drrijsla2k5"; })
75 | (fetchNuGet { pname = "System.Linq"; version = "4.3.0"; sha256 = "1w0gmba695rbr80l1k2h4mrwzbzsyfl2z4klmpbsvsg5pm4a56s7"; })
76 | (fetchNuGet { pname = "System.Linq.Expressions"; version = "4.1.0"; sha256 = "1gpdxl6ip06cnab7n3zlcg6mqp7kknf73s8wjinzi4p0apw82fpg"; })
77 | (fetchNuGet { pname = "System.Linq.Expressions"; version = "4.3.0"; sha256 = "0ky2nrcvh70rqq88m9a5yqabsl4fyd17bpr63iy2mbivjs2nyypv"; })
78 | (fetchNuGet { pname = "System.Net.Http"; version = "4.3.0"; sha256 = "1i4gc757xqrzflbk7kc5ksn20kwwfjhw9w7pgdkn19y3cgnl302j"; })
79 | (fetchNuGet { pname = "System.Net.Primitives"; version = "4.3.0"; sha256 = "0c87k50rmdgmxx7df2khd9qj7q35j9rzdmm2572cc55dygmdk3ii"; })
80 | (fetchNuGet { pname = "System.Net.Sockets"; version = "4.3.0"; sha256 = "1ssa65k6chcgi6mfmzrznvqaxk8jp0gvl77xhf1hbzakjnpxspla"; })
81 | (fetchNuGet { pname = "System.ObjectModel"; version = "4.0.12"; sha256 = "1sybkfi60a4588xn34nd9a58png36i0xr4y4v4kqpg8wlvy5krrj"; })
82 | (fetchNuGet { pname = "System.ObjectModel"; version = "4.3.0"; sha256 = "191p63zy5rpqx7dnrb3h7prvgixmk168fhvvkkvhlazncf8r3nc2"; })
83 | (fetchNuGet { pname = "System.Reflection"; version = "4.1.0"; sha256 = "1js89429pfw79mxvbzp8p3q93il6rdff332hddhzi5wqglc4gml9"; })
84 | (fetchNuGet { pname = "System.Reflection"; version = "4.3.0"; sha256 = "0xl55k0mw8cd8ra6dxzh974nxif58s3k1rjv1vbd7gjbjr39j11m"; })
85 | (fetchNuGet { pname = "System.Reflection.Emit"; version = "4.0.1"; sha256 = "0ydqcsvh6smi41gyaakglnv252625hf29f7kywy2c70nhii2ylqp"; })
86 | (fetchNuGet { pname = "System.Reflection.Emit"; version = "4.3.0"; sha256 = "11f8y3qfysfcrscjpjym9msk7lsfxkk4fmz9qq95kn3jd0769f74"; })
87 | (fetchNuGet { pname = "System.Reflection.Emit.ILGeneration"; version = "4.0.1"; sha256 = "1pcd2ig6bg144y10w7yxgc9d22r7c7ww7qn1frdfwgxr24j9wvv0"; })
88 | (fetchNuGet { pname = "System.Reflection.Emit.ILGeneration"; version = "4.3.0"; sha256 = "0w1n67glpv8241vnpz1kl14sy7zlnw414aqwj4hcx5nd86f6994q"; })
89 | (fetchNuGet { pname = "System.Reflection.Emit.Lightweight"; version = "4.0.1"; sha256 = "1s4b043zdbx9k39lfhvsk68msv1nxbidhkq6nbm27q7sf8xcsnxr"; })
90 | (fetchNuGet { pname = "System.Reflection.Emit.Lightweight"; version = "4.3.0"; sha256 = "0ql7lcakycrvzgi9kxz1b3lljd990az1x6c4jsiwcacrvimpib5c"; })
91 | (fetchNuGet { pname = "System.Reflection.Extensions"; version = "4.0.1"; sha256 = "0m7wqwq0zqq9gbpiqvgk3sr92cbrw7cp3xn53xvw7zj6rz6fdirn"; })
92 | (fetchNuGet { pname = "System.Reflection.Extensions"; version = "4.3.0"; sha256 = "02bly8bdc98gs22lqsfx9xicblszr2yan7v2mmw3g7hy6miq5hwq"; })
93 | (fetchNuGet { pname = "System.Reflection.Metadata"; version = "1.6.0"; sha256 = "1wdbavrrkajy7qbdblpbpbalbdl48q3h34cchz24gvdgyrlf15r4"; })
94 | (fetchNuGet { pname = "System.Reflection.Primitives"; version = "4.0.1"; sha256 = "1bangaabhsl4k9fg8khn83wm6yial8ik1sza7401621jc6jrym28"; })
95 | (fetchNuGet { pname = "System.Reflection.Primitives"; version = "4.3.0"; sha256 = "04xqa33bld78yv5r93a8n76shvc8wwcdgr1qvvjh959g3rc31276"; })
96 | (fetchNuGet { pname = "System.Reflection.TypeExtensions"; version = "4.1.0"; sha256 = "1bjli8a7sc7jlxqgcagl9nh8axzfl11f4ld3rjqsyxc516iijij7"; })
97 | (fetchNuGet { pname = "System.Reflection.TypeExtensions"; version = "4.3.0"; sha256 = "0y2ssg08d817p0vdag98vn238gyrrynjdj4181hdg780sif3ykp1"; })
98 | (fetchNuGet { pname = "System.Resources.ResourceManager"; version = "4.0.1"; sha256 = "0b4i7mncaf8cnai85jv3wnw6hps140cxz8vylv2bik6wyzgvz7bi"; })
99 | (fetchNuGet { pname = "System.Resources.ResourceManager"; version = "4.3.0"; sha256 = "0sjqlzsryb0mg4y4xzf35xi523s4is4hz9q4qgdvlvgivl7qxn49"; })
100 | (fetchNuGet { pname = "System.Runtime"; version = "4.1.0"; sha256 = "02hdkgk13rvsd6r9yafbwzss8kr55wnj8d5c7xjnp8gqrwc8sn0m"; })
101 | (fetchNuGet { pname = "System.Runtime"; version = "4.3.0"; sha256 = "066ixvgbf2c929kgknshcxqj6539ax7b9m570cp8n179cpfkapz7"; })
102 | (fetchNuGet { pname = "System.Runtime.Extensions"; version = "4.1.0"; sha256 = "0rw4rm4vsm3h3szxp9iijc3ksyviwsv6f63dng3vhqyg4vjdkc2z"; })
103 | (fetchNuGet { pname = "System.Runtime.Extensions"; version = "4.3.0"; sha256 = "1ykp3dnhwvm48nap8q23893hagf665k0kn3cbgsqpwzbijdcgc60"; })
104 | (fetchNuGet { pname = "System.Runtime.Handles"; version = "4.0.1"; sha256 = "1g0zrdi5508v49pfm3iii2hn6nm00bgvfpjq1zxknfjrxxa20r4g"; })
105 | (fetchNuGet { pname = "System.Runtime.Handles"; version = "4.3.0"; sha256 = "0sw2gfj2xr7sw9qjn0j3l9yw07x73lcs97p8xfc9w1x9h5g5m7i8"; })
106 | (fetchNuGet { pname = "System.Runtime.InteropServices"; version = "4.1.0"; sha256 = "01kxqppx3dr3b6b286xafqilv4s2n0gqvfgzfd4z943ga9i81is1"; })
107 | (fetchNuGet { pname = "System.Runtime.InteropServices"; version = "4.3.0"; sha256 = "00hywrn4g7hva1b2qri2s6rabzwgxnbpw9zfxmz28z09cpwwgh7j"; })
108 | (fetchNuGet { pname = "System.Runtime.InteropServices.RuntimeInformation"; version = "4.3.0"; sha256 = "0q18r1sh4vn7bvqgd6dmqlw5v28flbpj349mkdish2vjyvmnb2ii"; })
109 | (fetchNuGet { pname = "System.Runtime.Numerics"; version = "4.3.0"; sha256 = "19rav39sr5dky7afygh309qamqqmi9kcwvz3i0c5700v0c5cg61z"; })
110 | (fetchNuGet { pname = "System.Runtime.Serialization.Formatters"; version = "4.3.0"; sha256 = "114j35n8gcvn3sqv9ar36r1jjq0y1yws9r0yk8i6wm4aq7n9rs0m"; })
111 | (fetchNuGet { pname = "System.Runtime.Serialization.Primitives"; version = "4.1.1"; sha256 = "042rfjixknlr6r10vx2pgf56yming8lkjikamg3g4v29ikk78h7k"; })
112 | (fetchNuGet { pname = "System.Runtime.Serialization.Primitives"; version = "4.3.0"; sha256 = "01vv2p8h4hsz217xxs0rixvb7f2xzbh6wv1gzbfykcbfrza6dvnf"; })
113 | (fetchNuGet { pname = "System.Security.Cryptography.Algorithms"; version = "4.3.0"; sha256 = "03sq183pfl5kp7gkvq77myv7kbpdnq3y0xj7vi4q1kaw54sny0ml"; })
114 | (fetchNuGet { pname = "System.Security.Cryptography.Cng"; version = "4.3.0"; sha256 = "1k468aswafdgf56ab6yrn7649kfqx2wm9aslywjam1hdmk5yypmv"; })
115 | (fetchNuGet { pname = "System.Security.Cryptography.Csp"; version = "4.3.0"; sha256 = "1x5wcrddf2s3hb8j78cry7yalca4lb5vfnkrysagbn6r9x6xvrx1"; })
116 | (fetchNuGet { pname = "System.Security.Cryptography.Encoding"; version = "4.3.0"; sha256 = "1jr6w70igqn07k5zs1ph6xja97hxnb3mqbspdrff6cvssgrixs32"; })
117 | (fetchNuGet { pname = "System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0givpvvj8yc7gv4lhb6s1prq6p2c4147204a0wib89inqzd87gqc"; })
118 | (fetchNuGet { pname = "System.Security.Cryptography.Primitives"; version = "4.3.0"; sha256 = "0pyzncsv48zwly3lw4f2dayqswcfvdwq2nz0dgwmi7fj3pn64wby"; })
119 | (fetchNuGet { pname = "System.Security.Cryptography.ProtectedData"; version = "4.4.0"; sha256 = "1q8ljvqhasyynp94a1d7jknk946m20lkwy2c3wa8zw2pc517fbj6"; })
120 | (fetchNuGet { pname = "System.Security.Cryptography.X509Certificates"; version = "4.3.0"; sha256 = "0valjcz5wksbvijylxijjxb1mp38mdhv03r533vnx1q3ikzdav9h"; })
121 | (fetchNuGet { pname = "System.Text.Encoding"; version = "4.0.11"; sha256 = "1dyqv0hijg265dwxg6l7aiv74102d6xjiwplh2ar1ly6xfaa4iiw"; })
122 | (fetchNuGet { pname = "System.Text.Encoding"; version = "4.3.0"; sha256 = "1f04lkir4iladpp51sdgmis9dj4y8v08cka0mbmsy0frc9a4gjqr"; })
123 | (fetchNuGet { pname = "System.Text.Encoding.Extensions"; version = "4.0.11"; sha256 = "08nsfrpiwsg9x5ml4xyl3zyvjfdi4mvbqf93kjdh11j4fwkznizs"; })
124 | (fetchNuGet { pname = "System.Text.Encoding.Extensions"; version = "4.3.0"; sha256 = "11q1y8hh5hrp5a3kw25cb6l00v5l5dvirkz8jr3sq00h1xgcgrxy"; })
125 | (fetchNuGet { pname = "System.Text.RegularExpressions"; version = "4.1.0"; sha256 = "1mw7vfkkyd04yn2fbhm38msk7dz2xwvib14ygjsb8dq2lcvr18y7"; })
126 | (fetchNuGet { pname = "System.Text.RegularExpressions"; version = "4.3.0"; sha256 = "1bgq51k7fwld0njylfn7qc5fmwrk2137gdq7djqdsw347paa9c2l"; })
127 | (fetchNuGet { pname = "System.Threading"; version = "4.0.11"; sha256 = "19x946h926bzvbsgj28csn46gak2crv2skpwsx80hbgazmkgb1ls"; })
128 | (fetchNuGet { pname = "System.Threading"; version = "4.3.0"; sha256 = "0rw9wfamvhayp5zh3j7p1yfmx9b5khbf4q50d8k5rk993rskfd34"; })
129 | (fetchNuGet { pname = "System.Threading.Tasks"; version = "4.0.11"; sha256 = "0nr1r41rak82qfa5m0lhk9mp0k93bvfd7bbd9sdzwx9mb36g28p5"; })
130 | (fetchNuGet { pname = "System.Threading.Tasks"; version = "4.3.0"; sha256 = "134z3v9abw3a6jsw17xl3f6hqjpak5l682k2vz39spj4kmydg6k7"; })
131 | (fetchNuGet { pname = "System.Threading.Tasks.Extensions"; version = "4.0.0"; sha256 = "1cb51z062mvc2i8blpzmpn9d9mm4y307xrwi65di8ri18cz5r1zr"; })
132 | (fetchNuGet { pname = "System.Threading.Tasks.Extensions"; version = "4.3.0"; sha256 = "1xxcx2xh8jin360yjwm4x4cf5y3a2bwpn2ygkfkwkicz7zk50s2z"; })
133 | (fetchNuGet { pname = "System.Threading.Timer"; version = "4.3.0"; sha256 = "1nx773nsx6z5whv8kaa1wjh037id2f1cxhb69pvgv12hd2b6qs56"; })
134 | (fetchNuGet { pname = "System.Xml.ReaderWriter"; version = "4.0.11"; sha256 = "0c6ky1jk5ada9m94wcadih98l6k1fvf6vi7vhn1msjixaha419l5"; })
135 | (fetchNuGet { pname = "System.Xml.ReaderWriter"; version = "4.3.0"; sha256 = "0c47yllxifzmh8gq6rq6l36zzvw4kjvlszkqa9wq3fr59n0hl3s1"; })
136 | (fetchNuGet { pname = "System.Xml.XDocument"; version = "4.0.11"; sha256 = "0n4lvpqzy9kc7qy1a4acwwd7b7pnvygv895az5640idl2y9zbz18"; })
137 | (fetchNuGet { pname = "System.Xml.XDocument"; version = "4.3.0"; sha256 = "08h8fm4l77n0nd4i4fk2386y809bfbwqb7ih9d7564ifcxr5ssxd"; })
138 | (fetchNuGet { pname = "System.Xml.XmlDocument"; version = "4.3.0"; sha256 = "0bmz1l06dihx52jxjr22dyv5mxv6pj4852lx68grjm7bivhrbfwi"; })
139 | ]
140 |
--------------------------------------------------------------------------------
/flake.lock:
--------------------------------------------------------------------------------
1 | {
2 | "nodes": {
3 | "flake-utils": {
4 | "locked": {
5 | "lastModified": 1676283394,
6 | "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
7 | "owner": "numtide",
8 | "repo": "flake-utils",
9 | "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
10 | "type": "github"
11 | },
12 | "original": {
13 | "owner": "numtide",
14 | "repo": "flake-utils",
15 | "type": "github"
16 | }
17 | },
18 | "nixpkgs": {
19 | "locked": {
20 | "lastModified": 1676253841,
21 | "narHash": "sha256-jhuI8Mmky8VCD45OoJEuF6HdPLFBwNrHA0ljjZ/zkfw=",
22 | "owner": "NixOS",
23 | "repo": "nixpkgs",
24 | "rev": "a45a8916243a7d27acc358f4fc18c4491f3eeca8",
25 | "type": "github"
26 | },
27 | "original": {
28 | "id": "nixpkgs",
29 | "ref": "nixos-22.11",
30 | "type": "indirect"
31 | }
32 | },
33 | "root": {
34 | "inputs": {
35 | "flake-utils": "flake-utils",
36 | "nixpkgs": "nixpkgs"
37 | }
38 | }
39 | },
40 | "root": "root",
41 | "version": 7
42 | }
43 |
--------------------------------------------------------------------------------
/flake.nix:
--------------------------------------------------------------------------------
1 | {
2 | description = "Tool for packaging FSX files as self-contained executables";
3 |
4 | inputs = {
5 | nixpkgs.url = "nixpkgs/nixos-22.11";
6 | flake-utils.url = "github:numtide/flake-utils";
7 | };
8 |
9 | outputs = { self, nixpkgs, flake-utils }:
10 | flake-utils.lib.eachSystem ([
11 | flake-utils.lib.system.x86_64-linux
12 | flake-utils.lib.system.aarch64-linux
13 | flake-utils.lib.system.x86_64-darwin
14 | flake-utils.lib.system.aarch64-darwin
15 | ]) (system:
16 | let
17 | pkgs = import nixpkgs { inherit system; };
18 | fspack = import ./build.nix {
19 | inherit pkgs;
20 | src = builtins.path { path = ./.; };
21 | };
22 | derivation = { inherit fspack; };
23 | in rec
24 | {
25 | packages = derivation;
26 | defaultPackage = fspack;
27 | apps = rec {
28 | fspack = flake-utils.lib.mkApp { drv = derivation.fspack; exePath = "/bin/fspack"; };
29 | default = fspack;
30 | };
31 | devShells.default = pkgs.mkShell {
32 | name = "dotnet-env";
33 | packages = [
34 | pkgs.dotnet-sdk
35 | ];
36 | };
37 | }
38 | );
39 | }
--------------------------------------------------------------------------------
/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------