Skip to content

Commit f2949f4

Browse files
committed
add new pkg SQLitePCLRaw.config.e_sqlite3, which is basically bundle_e_sqlite3 except without the lib reference, so it's like a hollow bundle, bringing in just the config stuff but not any specific native library. redefine bundle_e_sqlite3 to be nothing more than a reference to the config pkg and the lib pkg. by using the config pkg, we can make the inclusion of a lib pkg more explicit, so we can substitute something like SEE or sqlite3mc with the e_sqlite3 name. change the test cases to support crypto builds in a better way, and fix the tests for e_sqlite3mc to use the config bundle.
1 parent ba15d96 commit f2949f4

File tree

7 files changed

+43
-60
lines changed

7 files changed

+43
-60
lines changed

Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<Copyright>Copyright 2014-2025 SourceGear, LLC</Copyright>
55
<Company>SourceGear</Company>
66
<Authors>Eric Sink</Authors>
7-
<Version>3.0.0-pre20250716122630</Version>
8-
<AssemblyVersion>3.0.0.2753</AssemblyVersion>
9-
<FileVersion>3.0.0.2753</FileVersion>
7+
<Version>3.0.0-pre20250717091040</Version>
8+
<AssemblyVersion>3.0.0.2754</AssemblyVersion>
9+
<FileVersion>3.0.0.2754</FileVersion>
1010
<Description>SQLitePCLRaw is a Portable Class Library (PCL) for low-level (raw) access to SQLite</Description>
1111
<ProviderLangVersion>10.0</ProviderLangVersion>
1212
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>

build/Program.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ let main argv =
3636
"provider.e_sqlite3"
3737
"provider.sqlite3"
3838
"provider.sqlcipher"
39+
"config.e_sqlite3"
3940
"bundle_e_sqlite3"
4041
"bundle_zetetic"
4142
]
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;$(tfm_net);$(tfm_ios);$(tfm_maccatalyst);$(tfm_framework);$(tfm_tvos)</TargetFrameworks>
5-
<SignAssembly>true</SignAssembly>
4+
<IncludeBuildOutput>false</IncludeBuildOutput>
5+
<TargetFrameworks>netstandard2.0</TargetFrameworks>
66
<PackageId>SQLitePCLRaw.bundle_e_sqlite3</PackageId>
7-
<AssemblyName>SQLitePCLRaw.batteries_v2</AssemblyName>
8-
<AssemblyOriginatorKeyFile>..\..\sn\SQLitePCLRaw.batteries_v2.snk</AssemblyOriginatorKeyFile>
9-
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
107
<PackageDescription>This 'batteries-included' bundle brings in SQLitePCLRaw.core and the necessary stuff for certain common use cases. Call SQLitePCL.Batteries.Init(). Policy of this bundle: e_sqlite3 included</PackageDescription>
118
</PropertyGroup>
129

1310
<ItemGroup>
14-
<Compile Include="..\..\src\common\batteries_v2.cs" />
11+
<ProjectReference Include="..\SQLitePCLRaw.config.e_sqlite3\SQLitePCLRaw.config.e_sqlite3.csproj" />
1512
</ItemGroup>
1613

1714
<ItemGroup>
1815
<PackageReference Include="SQLitePCLRaw.lib.e_sqlite3" Version="$(lib_e_sqlite3_package_reference_version)" />
1916
</ItemGroup>
2017

21-
<Import Condition=" '$(TargetFramework)' == 'netstandard2.0' " Project="..\msbuild_bundle_fragments\e_sqlite3_dllimport.xml" />
22-
<Import Condition=" '$(TargetFramework)' == '$(tfm_net)' " Project="..\msbuild_bundle_fragments\e_sqlite3_dllimport.xml" />
23-
<Import Condition=" '$(TargetFramework)' == '$(tfm_ios)' " Project="..\msbuild_bundle_fragments\e_sqlite3_internal.xml" />
24-
<Import Condition=" '$(TargetFramework)' == '$(tfm_maccatalyst)' " Project="..\msbuild_bundle_fragments\e_sqlite3_dllimport.xml" />
25-
<Import Condition=" '$(TargetFramework)' == '$(tfm_framework)' " Project="..\msbuild_bundle_fragments\e_sqlite3_dllimport.xml" />
26-
<Import Condition=" '$(TargetFramework)' == '$(tfm_tvos)' " Project="..\msbuild_bundle_fragments\e_sqlite3_internal.xml" />
27-
2818
</Project>
2919

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>netstandard2.0;$(tfm_net);$(tfm_ios);$(tfm_maccatalyst);$(tfm_framework);$(tfm_tvos)</TargetFrameworks>
5+
<SignAssembly>true</SignAssembly>
6+
<PackageId>SQLitePCLRaw.config.e_sqlite3</PackageId>
7+
<AssemblyName>SQLitePCLRaw.batteries_v2</AssemblyName>
8+
<AssemblyOriginatorKeyFile>..\..\sn\SQLitePCLRaw.batteries_v2.snk</AssemblyOriginatorKeyFile>
9+
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
10+
<PackageDescription>This 'batteries-included' bundle brings in SQLitePCLRaw.core and the necessary stuff for certain common use cases. Call SQLitePCL.Batteries.Init(). Policy of this bundle: e_sqlite3 included</PackageDescription>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<Compile Include="..\..\src\common\batteries_v2.cs" />
15+
</ItemGroup>
16+
17+
<Import Condition=" '$(TargetFramework)' == 'netstandard2.0' " Project="..\msbuild_bundle_fragments\e_sqlite3_dllimport.xml" />
18+
<Import Condition=" '$(TargetFramework)' == '$(tfm_net)' " Project="..\msbuild_bundle_fragments\e_sqlite3_dllimport.xml" />
19+
<Import Condition=" '$(TargetFramework)' == '$(tfm_ios)' " Project="..\msbuild_bundle_fragments\e_sqlite3_internal.xml" />
20+
<Import Condition=" '$(TargetFramework)' == '$(tfm_maccatalyst)' " Project="..\msbuild_bundle_fragments\e_sqlite3_dllimport.xml" />
21+
<Import Condition=" '$(TargetFramework)' == '$(tfm_framework)' " Project="..\msbuild_bundle_fragments\e_sqlite3_dllimport.xml" />
22+
<Import Condition=" '$(TargetFramework)' == '$(tfm_tvos)' " Project="..\msbuild_bundle_fragments\e_sqlite3_internal.xml" />
23+
24+
</Project>
25+

src/common/tests_xunit.cs

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3334,36 +3334,14 @@ public void test_hooks_2()
33343334

33353335
}
33363336

3337+
#if TEST_WITH_CRYPTO
3338+
33373339
[Collection("Init")]
33383340
public class class_test_crypto
33393341
{
3340-
private static bool is_sqlcipher()
3341-
{
3342-
using (sqlite3 db = ugly.open(":memory:"))
3343-
{
3344-
var s = db.query_scalar<string>("PRAGMA cipher_version");
3345-
return !string.IsNullOrEmpty(s);
3346-
}
3347-
}
3348-
3349-
private static bool is_sqlite3mc()
3350-
{
3351-
using (sqlite3 db = ugly.open(":memory:"))
3352-
{
3353-
var s = db.query_scalar<string>("PRAGMA cipher");
3354-
return !string.IsNullOrEmpty(s);
3355-
}
3356-
}
3357-
33583342
[Fact]
33593343
public void test_encrypted_file_with_pragma()
33603344
{
3361-
if (is_sqlcipher() || is_sqlite3mc())
3362-
{
3363-
if (is_sqlcipher())
3364-
Assert.Contains("sqlcipher", raw.GetNativeLibraryName());
3365-
else
3366-
Assert.Contains("sqlite3mc", raw.GetNativeLibraryName());
33673345
string name;
33683346
using (sqlite3 db = ugly.open(":memory:"))
33693347
{
@@ -3408,23 +3386,11 @@ bool check_sum(string pass)
34083386
Assert.False(check_sum("wrong phrase"));
34093387

34103388
ugly.vfs__delete(null, name, 1);
3411-
}
3412-
else
3413-
{
3414-
Assert.DoesNotContain("sqlcipher", raw.GetNativeLibraryName());
3415-
Assert.DoesNotContain("sqlite3mc", raw.GetNativeLibraryName());
3416-
}
34173389
}
34183390

34193391
[Fact]
34203392
public void test_encrypted_file_with_key()
34213393
{
3422-
if (is_sqlcipher() || is_sqlite3mc())
3423-
{
3424-
if (is_sqlcipher())
3425-
Assert.Contains("sqlcipher", raw.GetNativeLibraryName());
3426-
else
3427-
Assert.Contains("sqlite3mc", raw.GetNativeLibraryName());
34283394
string name;
34293395
using (sqlite3 db = ugly.open(":memory:"))
34303396
{
@@ -3479,12 +3445,6 @@ bool check_sum(byte[] k)
34793445
Assert.True(check_sum(new_key));
34803446

34813447
ugly.vfs__delete(null, name, 1);
3482-
}
3483-
else
3484-
{
3485-
Assert.DoesNotContain("sqlcipher", raw.GetNativeLibraryName());
3486-
Assert.DoesNotContain("sqlite3mc", raw.GetNativeLibraryName());
3487-
}
34883448
}
34893449

34903450
#if TODO
@@ -3511,6 +3471,7 @@ public void test_database_is_SQLCipher4()
35113471
}
35123472
}
35133473

3474+
#if TODO
35143475
[Fact]
35153476
public void test_database_is_custom_SQLCipher2()
35163477
{
@@ -3534,8 +3495,10 @@ public void test_database_is_custom_SQLCipher2()
35343495
Assert.DoesNotContain("sqlite3mc", raw.GetNativeLibraryName());
35353496
}
35363497
}
3498+
#endif
35373499
#endif
35383500
}
3501+
#endif
35393502

35403503
[Collection("Init")]
35413504
public class class_test_serialize_deserialize

test_nupkgs/e_sqlite3mc/fake_xunit/e_sqlite3mc_with_fake_xunit.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
<TargetFrameworks>$(tfm_framework);$(tfm_net);$(tfm_windows)</TargetFrameworks>
44
<OutputType>Exe</OutputType>
55
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
6+
<DefineConstants>$(DefineConstants);TEST_WITH_CRYPTO</DefineConstants>
67
</PropertyGroup>
78
<PropertyGroup Condition=" '$(TargetFramework)' == '$(tfm_framework)' ">
89
<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
910
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
1011
</PropertyGroup>
1112
<ItemGroup>
12-
<PackageReference Include="sqlitepclraw.bundle_e_sqlite3mc" Version="$(pkg_version_for_testing)" />
13+
<PackageReference Include="sqlitepclraw.config.e_sqlite3" Version="$(pkg_version_for_testing)" />
14+
<PackageReference Include="sqlitepclraw.lib.e_sqlite3mc" Version="3.49.1" />
1315
<PackageReference Include="sqlitepclraw.ugly" Version="$(pkg_version_for_testing)" />
1416
</ItemGroup>
1517
<ItemGroup>

test_nupkgs/e_sqlite3mc/real_xunit/e_sqlite3mc_with_real_xunit.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<PropertyGroup>
33
<TargetFrameworks>$(tfm_net)</TargetFrameworks>
44
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
5+
<DefineConstants>$(DefineConstants);TEST_WITH_CRYPTO</DefineConstants>
56
</PropertyGroup>
67
<PropertyGroup Condition=" '$(TargetFramework)' == '$(tfm_framework)' ">
78
<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
@@ -12,7 +13,8 @@
1213
<PackageReference Include="xunit" Version="$(depversion_xunit)" />
1314
<PackageReference Include="xunit.runner.visualstudio" Version="$(depversion_xunit_runner_visualstudio)" />
1415

15-
<PackageReference Include="sqlitepclraw.bundle_e_sqlite3mc" Version="$(pkg_version_for_testing)" />
16+
<PackageReference Include="sqlitepclraw.config.e_sqlite3" Version="$(pkg_version_for_testing)" />
17+
<PackageReference Include="sqlitepclraw.lib.e_sqlite3mc" Version="3.49.1" />
1618
<PackageReference Include="sqlitepclraw.ugly" Version="$(pkg_version_for_testing)" />
1719
</ItemGroup>
1820
<ItemGroup>

0 commit comments

Comments
 (0)