Skip to content

Commit

Permalink
attempted progress on #450 -- not successful. it's not clear exactly …
Browse files Browse the repository at this point in the history
…how the net5-windows10 tfms are supposed to work with native assets in a nuget. seems like this change does put the right e_sqlite3.dll in place when building with dotnet build -r win10-x64, but DllImport complains it can't load it, so need to confirm that the e_sqlite3.dll appcontainer version is in fact okay.
  • Loading branch information
ericsink committed Sep 27, 2021
1 parent 67b7458 commit c1ab204
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
55 changes: 55 additions & 0 deletions gen_nuspecs/gen_nuspecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ enum TFM
TVOS,
ANDROID,
UWP,
WIN10,
NETSTANDARD20,
NET461,
XAMARIN_MAC,
Expand Down Expand Up @@ -110,6 +111,7 @@ static string AsString(this TFM e)
case TFM.TVOS: return "Xamarin.tvOS10";
case TFM.ANDROID: return "MonoAndroid80";
case TFM.UWP: return "uap10.0";
case TFM.WIN10: return "net6.0-windows10";
case TFM.NETSTANDARD20: return "netstandard2.0";
case TFM.XAMARIN_MAC: return "Xamarin.Mac20";
case TFM.NET461: return "net461";
Expand Down Expand Up @@ -395,6 +397,25 @@ XmlWriter f
);
}

static void write_nuspec_file_entry_native_win10(
WhichLib lib,
string toolset,
string flavor,
string cpu,
string rid,
XmlWriter f
)
{
var filename = lib.AsString_libname_in_nupkg(LibSuffix.DLL);
write_nuspec_file_entry_nativeassets(
make_cb_path_win(lib, toolset, flavor, cpu),
rid,
TFM.WIN10,
filename,
f
);
}

static void write_nuspec_file_entries_from_cb(
WhichLib lib,
string win_toolset,
Expand All @@ -405,11 +426,17 @@ XmlWriter f
write_nuspec_file_entry_native_win(lib, win_toolset, "plain", "x64", "win-x64", f);
write_nuspec_file_entry_native_win(lib, win_toolset, "plain", "arm", "win-arm", f);
write_nuspec_file_entry_native_win(lib, win_toolset, "plain", "arm64", "win-arm64", f);

write_nuspec_file_entry_native_uwp(lib, win_toolset, "appcontainer", "arm64", "win10-arm64", f);
write_nuspec_file_entry_native_uwp(lib, win_toolset, "appcontainer", "arm", "win10-arm", f);
write_nuspec_file_entry_native_uwp(lib, win_toolset, "appcontainer", "x64", "win10-x64", f);
write_nuspec_file_entry_native_uwp(lib, win_toolset, "appcontainer", "x86", "win10-x86", f);

write_nuspec_file_entry_native_win10(lib, win_toolset, "appcontainer", "arm64", "win10-arm64", f);
write_nuspec_file_entry_native_win10(lib, win_toolset, "appcontainer", "arm", "win10-arm", f);
write_nuspec_file_entry_native_win10(lib, win_toolset, "appcontainer", "x64", "win10-x64", f);
write_nuspec_file_entry_native_win10(lib, win_toolset, "appcontainer", "x86", "win10-x86", f);

write_nuspec_file_entry_native_mac(lib, "x86_64", "osx-x64", f);
write_nuspec_file_entry_native_mac(lib, "arm64", "osx-arm64", f);

Expand Down Expand Up @@ -1003,6 +1030,13 @@ private static void gen_nuspec_provider_e_sqlite3(string dir_src)
tfm_dest: TFM.UWP,
f
);
write_nuspec_file_entry_lib_mt(
"SQLitePCLRaw.provider.e_sqlite3.uwp",
"SQLitePCLRaw.provider.e_sqlite3",
tfm_build: TFM.NETSTANDARD20,
tfm_dest: TFM.WIN10,
f
);

f.WriteEndElement(); // files

Expand Down Expand Up @@ -1063,6 +1097,13 @@ private static void gen_nuspec_provider_e_sqlcipher(string dir_src)
tfm_dest: TFM.UWP,
f
);
write_nuspec_file_entry_lib_mt(
"SQLitePCLRaw.provider.e_sqlcipher.uwp",
"SQLitePCLRaw.provider.e_sqlcipher",
tfm_build: TFM.NETSTANDARD20,
tfm_dest: TFM.WIN10,
f
);

f.WriteEndElement(); // files

Expand Down Expand Up @@ -1123,6 +1164,13 @@ private static void gen_nuspec_provider_sqlite3(string dir_src)
tfm_dest: TFM.UWP,
f
);
write_nuspec_file_entry_lib_mt(
"SQLitePCLRaw.provider.sqlite3.uwp",
"SQLitePCLRaw.provider.sqlite3",
tfm_build: TFM.NETSTANDARD20,
tfm_dest: TFM.WIN10,
f
);

f.WriteEndElement(); // files

Expand Down Expand Up @@ -1183,6 +1231,13 @@ private static void gen_nuspec_provider_sqlcipher(string dir_src)
tfm_dest: TFM.UWP,
f
);
write_nuspec_file_entry_lib_mt(
"SQLitePCLRaw.provider.sqlcipher.uwp",
"SQLitePCLRaw.provider.sqlcipher",
tfm_build: TFM.NETSTANDARD20,
tfm_dest: TFM.WIN10,
f
);

f.WriteEndElement(); // files

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;net461;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;net461;netcoreapp3.1;net6.0-windows10.0.19041</TargetFrameworks>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net461' ">
Expand Down

0 comments on commit c1ab204

Please sign in to comment.