Skip to content

Commit 0c0d4b0

Browse files
committed
sketched support for trimmed publishing #104
1 parent ef107e9 commit 0c0d4b0

8 files changed

Lines changed: 129 additions & 82 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ symbolCache.db
2929
**/.DS_Store
3030
/tmp/
3131
/.fsdocs
32-
/output
32+
/output
33+
/.idea

FSharp.Data.Adaptive.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FileSystem", "src\Demo\File
2424
EndProject
2525
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Scratch", "src\Demo\Scratch\Scratch.fsproj", "{929BB872-3FFF-48E6-ABC7-3E1FB3E72242}"
2626
EndProject
27+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "PublishTrimmedTest", "src\Demo\PublishTrimmedTest\PublishTrimmedTest.fsproj", "{11280471-7178-4DC3-9BAD-18411B1AE62B}"
28+
EndProject
2729
Global
2830
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2931
Debug|Any CPU = Debug|Any CPU
@@ -66,6 +68,10 @@ Global
6668
{929BB872-3FFF-48E6-ABC7-3E1FB3E72242}.Debug|Any CPU.Build.0 = Debug|Any CPU
6769
{929BB872-3FFF-48E6-ABC7-3E1FB3E72242}.Release|Any CPU.ActiveCfg = Release|Any CPU
6870
{929BB872-3FFF-48E6-ABC7-3E1FB3E72242}.Release|Any CPU.Build.0 = Release|Any CPU
71+
{11280471-7178-4DC3-9BAD-18411B1AE62B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
72+
{11280471-7178-4DC3-9BAD-18411B1AE62B}.Debug|Any CPU.Build.0 = Debug|Any CPU
73+
{11280471-7178-4DC3-9BAD-18411B1AE62B}.Release|Any CPU.ActiveCfg = Release|Any CPU
74+
{11280471-7178-4DC3-9BAD-18411B1AE62B}.Release|Any CPU.Build.0 = Release|Any CPU
6975
EndGlobalSection
7076
GlobalSection(SolutionProperties) = preSolution
7177
HideSolutionNode = FALSE
@@ -78,6 +84,7 @@ Global
7884
{D4058F6D-A8D5-4587-AE05-D32A3B99B625} = {B5A29D79-4C76-4148-A69F-814ED1BEEFCE}
7985
{2AE99C0D-703D-4042-9E8D-BF8A66284B0D} = {B5A29D79-4C76-4148-A69F-814ED1BEEFCE}
8086
{929BB872-3FFF-48E6-ABC7-3E1FB3E72242} = {B5A29D79-4C76-4148-A69F-814ED1BEEFCE}
87+
{11280471-7178-4DC3-9BAD-18411B1AE62B} = {B5A29D79-4C76-4148-A69F-814ED1BEEFCE}
8188
EndGlobalSection
8289
GlobalSection(ExtensibilityGlobals) = postSolution
8390
SolutionGuid = {0E91AEEA-75F2-484D-8E5E-E3322D13C65A}

paket.lock

Lines changed: 78 additions & 78 deletions
Large diffs are not rendered by default.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
open FSharp.Data.Adaptive
2+
3+
4+
let a = cval 10
5+
6+
let b = a |> AVal.map (fun x -> x * 2)
7+
printfn "%A" (AVal.force b)
8+
9+
transact (fun () -> a.Value <- 100)
10+
printfn "%A" (AVal.force b)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net6.0</TargetFramework>
6+
<PublishTrimmed>true</PublishTrimmed>
7+
</PropertyGroup>
8+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
9+
<OutputPath>..\..\..\bin\Release\</OutputPath>
10+
</PropertyGroup>
11+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
12+
<OutputPath>..\..\..\bin\Debug\</OutputPath>
13+
</PropertyGroup>
14+
<ItemGroup>
15+
<Compile Include="Program.fs" />
16+
</ItemGroup>
17+
<ItemGroup>
18+
<ProjectReference Include="..\..\FSharp.Data.Adaptive\FSharp.Data.Adaptive.fsproj" />
19+
</ItemGroup>
20+
<Import Project="..\..\..\.paket\Paket.Restore.targets" />
21+
</Project>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FSharp.Core
2+
Aardvark.Build

src/FSharp.Data.Adaptive/FSharp.Data.Adaptive.fsproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
44
<OutputType>Library</OutputType>
5-
<TargetFrameworks>netstandard2.0;netcoreapp3.1</TargetFrameworks>
5+
<TargetFrameworks>netstandard2.0;net5.0;net6.0</TargetFrameworks>
66
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
77

8+
<TrimMode>link</TrimMode>
9+
<IsTrimmable>true</IsTrimmable>
10+
811
<!-- Example ultra-simple styling and generation settings for FsDocs default template-->
912
<PackageLicenseUrl>https://github.com/fsprojects/FSharp.Data.Adaptive/blob/master/LICENSE</PackageLicenseUrl>
1013
<PackageProjectUrl>https://fsprojects.github.io/FSharp.Data.Adaptive</PackageProjectUrl>

src/FSharp.Data.Adaptive/ShallowEquality.fs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
namespace FSharp.Data.Adaptive
2+
open System.Diagnostics.CodeAnalysis
23

34

45
#if FABLE_COMPILER
@@ -84,7 +85,9 @@ type private HashCodeHelpers private() =
8485
)
8586

8687
static member CombineMethod = combineMeth
87-
88+
#if NET5_0
89+
[<RequiresUnreferencedCode("used by ShallowEqualityComparer")>]
90+
#endif
8891
static member Combine(a : int, b : int) =
8992
uint32 a ^^^ uint32 b + 0x9e3779b9u + ((uint32 a) <<< 6) + ((uint32 a) >>> 2) |> int
9093

@@ -313,7 +316,7 @@ type ShallowEqualityComparer<'a> private() =
313316
let del = meth.CreateDelegate(typeof<ShallowEqDelegate<'a>>) |> unbox<ShallowEqDelegate<'a>>
314317
fun (a : 'a) (b : 'a) -> del.Invoke(a, b)
315318
else
316-
/// TODO: better way?
319+
// TODO: better way?
317320
fun (a : 'a) (b : 'a) -> false
318321
elif FSharpType.IsUnion(typ, true) && DynamicMethod.IsSupported && not isRecursive then
319322
let cases = FSharpType.GetUnionCases(typ, true)

0 commit comments

Comments
 (0)