Skip to content

Commit

Permalink
major change to the way bundles are built. instead of using a dummy c…
Browse files Browse the repository at this point in the history
…sproj with a side nuspec, change each bundle to a csproj that builds the corresponding batteries assembly and uses multi-targeting to reference other things. rm gen_bundle_nuspecs. rm all the batteries assembly directories. simplify the build program. add src/msbuild_bundle_fragments, which contains msbuild files that can be imported into bundles to setup properties and items for specific cases, such as e_sqlite3_dllimport, etc. basically, this gives responsibility for creating the nuspec to dotnet pack, which makes it easier to eliminate mismatches between build TFMs and nuspec TFMs. seems to work okay, but I hope I don't regret it later. one piece of this change is that there is now a nuget.config file at the top of the repo tree. this is because some of the bundles need to reference SQLitePCLRaw.lib.e_sqlite3, which is still built with a dummy csproj, and so it can't be a ProjectReference, which means it needs to be a PackageReference, which means we need the output nupkgs dir to be available during the build progress, not just during testing.
  • Loading branch information
ericsink committed Feb 3, 2022
1 parent d8708fe commit 235d644
Show file tree
Hide file tree
Showing 45 changed files with 339 additions and 1,208 deletions.
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<Copyright>Copyright 2014-2022 SourceGear, LLC</Copyright>
<Company>SourceGear</Company>
<Authors>Eric Sink</Authors>
<Version>2.1.0-pre20220202154155</Version>
<AssemblyVersion>2.1.0.1493</AssemblyVersion>
<FileVersion>2.1.0.1493</FileVersion>
<Version>2.1.0-pre20220203092036</Version>
<AssemblyVersion>2.1.0.1494</AssemblyVersion>
<FileVersion>2.1.0.1494</FileVersion>
<Description>SQLitePCLRaw is a Portable Class Library (PCL) for low-level (raw) access to SQLite</Description>
<ProviderLangVersion>10.0</ProviderLangVersion>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
Expand Down
101 changes: 32 additions & 69 deletions build/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -20,72 +20,53 @@ let main argv =
exec "dotnet" "run .." (Path.Combine(top, "version_stamp"))

exec "dotnet" "run .." (Path.Combine(top, "gen_lib_nuspecs"))
exec "dotnet" "run .." (Path.Combine(top, "gen_bundle_nuspecs"))
exec "dotnet" "run" (Path.Combine(top, "gen_providers"))

let dir_nupkgs = Path.Combine(top, "nupkgs")
Directory.CreateDirectory(dir_nupkgs) |> ignore
for s in Directory.GetFiles(dir_nupkgs, "*.nupkg") do
File.Delete(s)

let pack_dirs = [
"SQLitePCLRaw.core"
"SQLitePCLRaw.ugly"
"SQLitePCLRaw.provider.dynamic_cdecl"
"SQLitePCLRaw.provider.dynamic_stdcall"
"SQLitePCLRaw.provider.internal"
"SQLitePCLRaw.provider.winsqlite3"
"SQLitePCLRaw.provider.e_sqlite3"
"SQLitePCLRaw.provider.e_sqlcipher"
"SQLitePCLRaw.provider.sqlite3"
"SQLitePCLRaw.provider.sqlcipher"
let nuspec_dirs = [
"lib.e_sqlite3"
"lib.e_sqlcipher"
]
for s in pack_dirs do
exec "dotnet" "pack -c Release" (Path.Combine(top, "src", s))

let batteries_dirs = [
"e_sqlite3.dllimport"
"e_sqlite3.dynamic"
"e_sqlcipher.dllimport"
"e_sqlcipher.dynamic"
"sqlite3.dllimport"
"sqlite3.dynamic"
"sqlcipher.dynamic"
"sqlcipher.dllimport"
"winsqlite3.dllimport"
"winsqlite3.dynamic"
]
for s in batteries_dirs do
let dir_name = sprintf "SQLitePCLRaw.batteries_v2.%s" s
exec "dotnet" "build -c Release" (Path.Combine(top, "src", dir_name))

let msbuild_dirs = [
"lib.sqlcipher.ios.placeholder"
"batteries_v2.e_sqlite3.internal.ios"
"batteries_v2.e_sqlite3.internal.tvos"
"batteries_v2.e_sqlcipher.internal.ios"
"batteries_v2.sqlcipher.internal.ios"
]
for s in msbuild_dirs do
let dir_name = sprintf "SQLitePCLRaw.%s" s
let dir = (Path.Combine(top, "src", dir_name))
//exec "dotnet" "restore" dir
//exec "msbuild" "/p:Configuration=Release" dir
exec "dotnet" "build -c Release" dir

let msbuild_pack_dirs = [
for s in nuspec_dirs do
let name = sprintf "SQLitePCLRaw.%s" s
let dir_proj = Path.Combine(top, "src", name)
let path_empty = Path.Combine(dir_proj, "_._")
if not (File.Exists(path_empty)) then
File.WriteAllText(path_empty, "")

let pack_dirs = [
"core"
"ugly"
"provider.dynamic_cdecl"
"provider.dynamic_stdcall"
"provider.internal"
"provider.winsqlite3"
"provider.e_sqlite3"
"provider.e_sqlcipher"
"provider.sqlite3"
"provider.sqlcipher"
"lib.e_sqlite3.android"
"lib.e_sqlite3.ios"
"lib.e_sqlite3.tvos"
"lib.e_sqlcipher.android"
"lib.e_sqlcipher.ios"
]
for s in msbuild_pack_dirs do
"lib.e_sqlite3"
"lib.e_sqlcipher"
"bundle_green"
"bundle_e_sqlite3"
"bundle_e_sqlcipher"
"bundle_zetetic"
"bundle_winsqlite3"
"bundle_sqlite3"
]
for s in pack_dirs do
let dir_name = sprintf "SQLitePCLRaw.%s" s
let dir = (Path.Combine(top, "src", dir_name))
//exec "dotnet" "restore" dir
//exec "msbuild" "/p:Configuration=Release /t:pack" dir
exec "dotnet" "pack -c Release" dir
exec "dotnet" "pack -c Release" (Path.Combine(top, "src", dir_name))

let get_build_prop p =
let path_xml = Path.Combine(top, "Directory.Build.props")
Expand All @@ -98,24 +79,6 @@ let main argv =

printfn "%s" version

let nuspecs = [
"lib.e_sqlite3"
"lib.e_sqlcipher"
"bundle_green"
"bundle_e_sqlite3"
"bundle_e_sqlcipher"
"bundle_zetetic"
"bundle_winsqlite3"
"bundle_sqlite3"
]
for s in nuspecs do
let name = sprintf "SQLitePCLRaw.%s" s
let dir_proj = Path.Combine(top, "src", name)
let path_empty = Path.Combine(dir_proj, "_._")
if not (File.Exists(path_empty)) then
File.WriteAllText(path_empty, "")
exec "dotnet" "pack" dir_proj

exec "dotnet" "run" (Path.Combine(top, "test_nupkgs", "smoke"))

exec "dotnet" "run" (Path.Combine(top, "test_nupkgs", "fsmoke"))
Expand Down
Loading

0 comments on commit 235d644

Please sign in to comment.