Skip to content

Commit ad5d659

Browse files
committed
SimpleWeather.Uno: net7.0 + Uno.Material
* Fix build errors as well
1 parent f753ca6 commit ad5d659

File tree

152 files changed

+2481
-1267
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+2481
-1267
lines changed

.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@ ModelManifest.xml
244244
# FAKE - F# Make
245245
.fake/
246246

247+
# MacOS
248+
.DS_Store
249+
247250
# SimpleWeather
248251
API_KEY.txt
249252
/SimpleWeather.Uno/SimpleWeather.Uno.UWP/Package.StoreAssociation.xml
@@ -262,10 +265,11 @@ API_KEY.txt
262265
/SimpleWeather.Weather-API/Keys/Keys.7z
263266
/Utf8Json.UniversalCodeGenerator
264267
/*.bat*
268+
/*.sh*
265269
/TranslationImport
266270
listingData-*.csv
267271
/SimpleWeather.Shared.Extras
268-
/SimpleWeather.UWP.Extras
272+
/SimpleWeather.Uno.Extras
269273
/SimpleWeather.Backgrounds
270274
/SimpleWeather.Extras
271275
/SimpleWeather.WeatherIcons

BingMapsRESTToolkit/Source/BingMapsRESTToolkit.Standard/BingMapsRESTToolkit.Standard.csproj

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
22

33
<PropertyGroup>
4-
<TargetFrameworks>uap10.0.19041;netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0</TargetFrameworks>
5+
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">uap10.0.19041;$(TargetFrameworks)</TargetFrameworks>
56
<Version>1.1.5</Version>
67
<Authors>Microsoft</Authors>
78
<Company>Microsoft</Company>

Directory.Build.props

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<Project>
22
<PropertyGroup>
33
<LangVersion>latest</LangVersion>
4+
<Version>$(VersionPrefix)5.2.7.0</Version>
45
</PropertyGroup>
56
</Project>

EditManifest/App.config

-6
This file was deleted.

EditManifest/EditManifest.csproj

+3-50
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,9 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
42
<PropertyGroup>
5-
<LangVersion>9.0</LangVersion>
6-
<TargetFrameworkProfile />
3+
<TargetFramework>net7.0</TargetFramework>
4+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
75
</PropertyGroup>
86
<PropertyGroup>
9-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
10-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
11-
<ProjectGuid>{94F8637B-52B8-429B-A5CA-043CFF4DD201}</ProjectGuid>
127
<OutputType>Exe</OutputType>
13-
<RootNamespace>EditManifest</RootNamespace>
14-
<AssemblyName>EditManifest</AssemblyName>
15-
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
16-
<FileAlignment>512</FileAlignment>
17-
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
188
</PropertyGroup>
19-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
20-
<PlatformTarget>AnyCPU</PlatformTarget>
21-
<DebugSymbols>true</DebugSymbols>
22-
<DebugType>full</DebugType>
23-
<Optimize>false</Optimize>
24-
<OutputPath>bin\Debug\</OutputPath>
25-
<DefineConstants>DEBUG;TRACE</DefineConstants>
26-
<ErrorReport>prompt</ErrorReport>
27-
<WarningLevel>4</WarningLevel>
28-
</PropertyGroup>
29-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
30-
<PlatformTarget>AnyCPU</PlatformTarget>
31-
<DebugType>pdbonly</DebugType>
32-
<Optimize>true</Optimize>
33-
<OutputPath>bin\Release\</OutputPath>
34-
<DefineConstants>TRACE</DefineConstants>
35-
<ErrorReport>prompt</ErrorReport>
36-
<WarningLevel>4</WarningLevel>
37-
</PropertyGroup>
38-
<ItemGroup>
39-
<Reference Include="System" />
40-
<Reference Include="System.Core" />
41-
<Reference Include="System.Xml.Linq" />
42-
<Reference Include="System.Data.DataSetExtensions" />
43-
<Reference Include="Microsoft.CSharp" />
44-
<Reference Include="System.Data" />
45-
<Reference Include="System.Net.Http" />
46-
<Reference Include="System.Xml" />
47-
</ItemGroup>
48-
<ItemGroup>
49-
<Compile Include="Program.cs" />
50-
<Compile Include="Properties\AssemblyInfo.cs" />
51-
</ItemGroup>
52-
<ItemGroup>
53-
<None Include="App.config" />
54-
</ItemGroup>
55-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
569
</Project>

KeyCheck.exe

100644100755
File mode changed.

KeyCheck/App.config

-6
This file was deleted.

KeyCheck/KeyCheck.csproj

+7-53
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,10 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
43
<PropertyGroup>
5-
<LangVersion>9.0</LangVersion>
6-
</PropertyGroup>
7-
<PropertyGroup>
8-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
9-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
10-
<ProjectGuid>{69259AD2-5CDE-4047-B7B4-CDE2F1AA5987}</ProjectGuid>
114
<OutputType>Exe</OutputType>
12-
<RootNamespace>KeyCheck</RootNamespace>
13-
<AssemblyName>KeyCheck</AssemblyName>
14-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
15-
<FileAlignment>512</FileAlignment>
16-
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
17-
<Deterministic>true</Deterministic>
18-
</PropertyGroup>
19-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
20-
<PlatformTarget>AnyCPU</PlatformTarget>
21-
<DebugSymbols>true</DebugSymbols>
22-
<DebugType>full</DebugType>
23-
<Optimize>false</Optimize>
24-
<OutputPath>bin\Debug\</OutputPath>
25-
<DefineConstants>DEBUG;TRACE</DefineConstants>
26-
<ErrorReport>prompt</ErrorReport>
27-
<WarningLevel>4</WarningLevel>
28-
</PropertyGroup>
29-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
30-
<PlatformTarget>AnyCPU</PlatformTarget>
31-
<DebugType>pdbonly</DebugType>
32-
<Optimize>true</Optimize>
33-
<OutputPath>bin\Release\</OutputPath>
34-
<DefineConstants>TRACE</DefineConstants>
35-
<ErrorReport>prompt</ErrorReport>
36-
<WarningLevel>4</WarningLevel>
5+
<TargetFramework>net7.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
378
</PropertyGroup>
38-
<ItemGroup>
39-
<Reference Include="System" />
40-
<Reference Include="System.Core" />
41-
<Reference Include="System.Xml.Linq" />
42-
<Reference Include="System.Data.DataSetExtensions" />
43-
<Reference Include="Microsoft.CSharp" />
44-
<Reference Include="System.Data" />
45-
<Reference Include="System.Net.Http" />
46-
<Reference Include="System.Xml" />
47-
</ItemGroup>
48-
<ItemGroup>
49-
<Compile Include="Program.cs" />
50-
<Compile Include="Properties\AssemblyInfo.cs" />
51-
</ItemGroup>
52-
<ItemGroup>
53-
<None Include="App.config" />
54-
</ItemGroup>
55-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
56-
</Project>
9+
10+
</Project>

KeyCheck/Program.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ public static class Program
1212
{
1313
private static void Main(string[] args)
1414
{
15+
// Set default exit code as success
16+
Environment.ExitCode = 0;
17+
1518
if (args == null || args.Length == 0)
1619
{
1720
Console.WriteLine("Missing arguments!!");
@@ -74,8 +77,7 @@ private static void Main(string[] args)
7477
}
7578
}
7679

77-
if (Environment.ExitCode != 0)
78-
Environment.Exit(Environment.ExitCode);
80+
Environment.Exit(Environment.ExitCode);
7981
}
8082
}
8183
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<WebPublishMethod>FileSystem</WebPublishMethod>
5+
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
6+
<LastUsedPlatform>AnyCPU</LastUsedPlatform>
7+
<publishUrl>bin/Release/net7.0/publish</publishUrl>
8+
<DeleteExistingFiles>false</DeleteExistingFiles>
9+
<TargetFramework>net7.0</TargetFramework>
10+
<SelfContained>false</SelfContained>
11+
<_IsPortable>true</_IsPortable>
12+
</PropertyGroup>
13+
</Project>
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"profiles": {
3+
"KeyCheck": {
4+
"commandName": "Project",
5+
"commandLineArgs": "\"D:\\Visual Studio 2019\\Projects\\SimpleWeather-Windows\\SimpleWeather.Shared\\Keys\"",
6+
"workingDirectory": "D:\\Visual Studio 2019\\Projects\\SimpleWeather-Windows"
7+
}
8+
}
9+
}

SimpleWeather.Common/Migrations/VersionMigrations.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
using SQLite;
55
using System.Collections.Generic;
66
using System.Globalization;
7+
using System.Reflection;
8+
using System.Text.RegularExpressions;
79
using System.Threading.Tasks;
810

911
namespace SimpleWeather.Common.Migrations
@@ -14,9 +16,13 @@ internal static async Task PerformVersionMigrations(SQLiteAsyncConnection weathe
1416
{
1517
var SettingsMgr = DI.Utils.SettingsManager;
1618

19+
#if NETSTANDARD2_0
20+
var version = Regex.Match(Assembly.GetEntryAssembly().FullName, @"(\d+)(.\d+)(.\d+)?(.\d+)?").ToString().Replace(".", "");
21+
#else
1722
var PackageVersion = Windows.ApplicationModel.Package.Current.Id.Version;
1823
var version = string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}0",
1924
PackageVersion.Major, PackageVersion.Minor, PackageVersion.Build); // Exclude revision number used by Xbox & others
25+
#endif
2026
var CurrentVersionCode = int.Parse(version, CultureInfo.InvariantCulture);
2127

2228
if (SettingsMgr.WeatherLoaded && SettingsMgr.VersionCode < CurrentVersionCode)
@@ -95,7 +101,7 @@ internal static async Task PerformVersionMigrations(SQLiteAsyncConnection weathe
95101
}
96102

97103
// DevSettings -> Settings.SetAPIKey
98-
#if WINDOWS_UWP || NETFX_CORE || NETSTANDARD || __ANDROID__
104+
#if WINDOWS_UWP || __ANDROID__
99105
var devSettingsMap = SettingsMgr.GetDevSettingsPreferenceMap();
100106
devSettingsMap.ForEach((kvp) =>
101107
{
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
22
<PropertyGroup>
3-
<TargetFrameworks>uap10.0.19041;netstandard2.0;net6.0-ios;net6.0-maccatalyst;net6.0-android</TargetFrameworks>
3+
<TargetFrameworks>netstandard2.0;net7.0-ios;net7.0-macos;net7.0-maccatalyst;net7.0-android</TargetFrameworks>
4+
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">uap10.0.19041;$(TargetFrameworks)</TargetFrameworks>
45
<!-- Ensures the .xr.xml files are generated in a proper layout folder -->
56
<GenerateLibraryLayout>true</GenerateLibraryLayout>
67
</PropertyGroup>
@@ -13,14 +14,18 @@
1314
<ItemGroup Condition="!$(TargetFramework.StartsWith('uap'))">
1415
<PackageReference Include="Uno.UI" Version="4.6.19" />
1516
</ItemGroup>
16-
<ItemGroup>
17-
<ProjectReference Include="..\SimpleWeather.Shared\SimpleWeather.Shared.csproj" />
18-
<ProjectReference Include="..\SimpleWeather.Weather-API\SimpleWeather.Weather-API.csproj" />
19-
</ItemGroup>
2017
<ItemGroup Condition="!$(TargetFramework.StartsWith('uap'))">
2118
<Content Include="Assets\**" />
19+
<Page Include="**\*.xaml" Exclude="bin\**\*.xaml;obj\**\*.xaml" />
20+
<Compile Update="**\*.xaml.cs">
21+
<DependentUpon>%(Filename)</DependentUpon>
22+
</Compile>
2223
</ItemGroup>
2324
<ItemGroup>
2425
<UpToDateCheckInput Include="**\*.xaml" Exclude="bin\**\*.xaml;obj\**\*.xaml" />
2526
</ItemGroup>
27+
<ItemGroup>
28+
<ProjectReference Include="..\SimpleWeather.Shared\SimpleWeather.Shared.csproj" />
29+
<ProjectReference Include="..\SimpleWeather.Weather-API\SimpleWeather.Weather-API.csproj" />
30+
</ItemGroup>
2631
</Project>
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
using System.IO;
2-
using Windows.Storage;
1+
using SimpleWeather.Helpers;
2+
using System.IO;
33

44
namespace SimpleWeather.Database
55
{
66
public partial class LocationsDatabase
77
{
88
private static string GetDatabasePath()
99
{
10-
var appDataFolder = ApplicationData.Current.LocalFolder;
11-
return Path.Combine(appDataFolder.Path, DatabaseFileName);
10+
var appDataFolderPath = ApplicationDataHelper.GetLocalFolderPath();
11+
return Path.Combine(appDataFolderPath, DatabaseFileName);
1212
}
1313
}
1414
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
using System.IO;
2-
using Windows.Storage;
1+
using SimpleWeather.Helpers;
2+
using System.IO;
33

44
namespace SimpleWeather.Database
55
{
66
public partial class TZDatabase
77
{
88
private static string GetDatabasePath()
99
{
10-
var appDataFolder = ApplicationData.Current.LocalFolder;
11-
return Path.Combine(appDataFolder.Path, DatabaseFileName);
10+
var appDataFolderPath = ApplicationDataHelper.GetLocalFolderPath();
11+
return Path.Combine(appDataFolderPath, DatabaseFileName);
1212
}
1313
}
1414
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
using System.IO;
2-
using Windows.Storage;
1+
using SimpleWeather.Helpers;
2+
using System.IO;
33

44
namespace SimpleWeather.Database
55
{
66
public partial class WeatherDatabase
77
{
88
private static string GetDatabasePath()
99
{
10-
var appDataFolder = ApplicationData.Current.LocalFolder;
11-
return Path.Combine(appDataFolder.Path, DatabaseFileName);
10+
var appDataFolderPath = ApplicationDataHelper.GetLocalFolderPath();
11+
return Path.Combine(appDataFolderPath, DatabaseFileName);
1212
}
1313
}
1414
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#if __MACOS__
2+
using Foundation;
3+
#endif
4+
using System.IO;
5+
using Windows.Storage;
6+
7+
namespace SimpleWeather.Helpers
8+
{
9+
public static class ApplicationDataHelper
10+
{
11+
public static string GetLocalFolderPath()
12+
{
13+
var appDataFolder = ApplicationData.Current.LocalFolder;
14+
var appDataFolderPath = appDataFolder.Path;
15+
16+
bool appendPath = false;
17+
#if __MACOS__
18+
appendPath = NSProcessInfo.ProcessInfo.Environment["APP_SANDBOX_CONTAINER_ID"] != null; // Sandboxed
19+
#elif WINDOWS_UWP
20+
// appendPath = false;
21+
#elif __IOS__ || __SKIA__ || NETSTANDARD2_0
22+
appendPath = true;
23+
#endif
24+
25+
if (appendPath)
26+
{
27+
appDataFolderPath = Path.Combine(appDataFolderPath, "SimpleWeather");
28+
}
29+
30+
Directory.CreateDirectory(appDataFolderPath);
31+
32+
return appDataFolderPath;
33+
}
34+
}
35+
}

SimpleWeather.Shared/Preferences/ISettingsService.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public interface ISettingsService
3030

3131
void Clear();
3232

33-
#if WINDOWS_UWP || NETFX_CORE || NETSTANDARD || __ANDROID__
33+
#if WINDOWS_UWP || __ANDROID__
3434
IDictionary<string, object> GetAllSettings();
3535
#endif
3636
}

0 commit comments

Comments
 (0)