Skip to content

Commit

Permalink
try to solve multi dotnet versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Benarbia committed Feb 17, 2024
1 parent 3a17f55 commit 8daae8e
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 13 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
obj/
bin/
serpapi/obj/
test/obj/
test/bin/
serpapi/bin
.vscode/
newtonsoft.json/
derive.rb
10 changes: 10 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<!-- <Nullable>enable</Nullable> -->
<ImplicitUsings>disable</ImplicitUsings>
<LangVersion>preview</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
</Project>
11 changes: 11 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageVersion Include="MSTest.TestFramework" Version="1.3.2" />
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

dotnet is not available on arm64 debian 12
5 changes: 2 additions & 3 deletions serpapi/serpapi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public class SerpApi
// Core HTTP search
public HttpClient client;


public SerpApi(Hashtable parameter = null)
{
// assign query parameter
Expand Down Expand Up @@ -73,10 +72,10 @@ public string html(Hashtable parameter)
/***
* Get user account
*/
public JObject account(string apiKey = null)
public JObject account(string apiKey = "")
{
Hashtable parameter = new Hashtable();
if(apiKey != null) {
if(apiKey != "") {
parameter.Add("api_key", apiKey);
}
return json("/account", parameter);
Expand Down
10 changes: 7 additions & 3 deletions serpapi/serpapi.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
<RootNamespace>serpapi</RootNamespace>
<PackageId>serpapi</PackageId>
<Version>1.0.0</Version>
<PackageVersion>1.0.0</PackageVersion>
<Authors>victor@serpapi.com</Authors>
<Company>SerpApi.LLC</Company>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReleaseNotes>README.md</PackageReleaseNotes>
Expand All @@ -19,9 +19,13 @@
<IsTestProject>true</IsTestProject>
<RepositoryUrl>https://github.com/serpapi/serpapi-dotnet</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<EnableDynamicLoading>true</EnableDynamicLoading>
<EnableDynamicLoading>true</EnableDynamicLoading>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Newtonsoft.Json" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<None Include="../LICENSE" Pack="true" PackagePath="" />
<None Include="../README.md" Pack="true" PackagePath=""/>
</ItemGroup>
</Project>
8 changes: 3 additions & 5 deletions test/test.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" PrivateAssets="All" />
<PackageReference Include="MSTest.TestAdapter" PrivateAssets="All" />
<PackageReference Include="MSTest.TestFramework" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="../serpapi/serpapi.csproj" />
</ItemGroup>

</Project>

0 comments on commit 8daae8e

Please sign in to comment.