forked from apache/arrow-adbc
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for building nuget packages on Windows
- Loading branch information
David Coe
committed
Nov 28, 2023
1 parent
8500389
commit aa36b19
Showing
12 changed files
with
203 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,4 @@ x64 | |
|
||
artifacts/ | ||
TestResults/ | ||
nugets/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"msbuild-sdks": { | ||
"Microsoft.Build.CentralPackageVersions" : "2.1.3", | ||
"Microsoft.Build.Traversal": "3.4.0", | ||
"Microsoft.Build.NoTargets": "3.7.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This does the following: | ||
|
||
# 1.) Builds each managed library as a nuget package using `dotnet pack` | ||
# 2.) Builds each interop library and packages it in to a nuget using `nuget pack` | ||
# 3.) Copies them all to a single folder | ||
# 4.) Need to run tests using the nuget packages (dotnet test ?) | ||
|
||
param ( | ||
[string]$destination=".\nugets" | ||
) | ||
|
||
$location = Get-Location | ||
|
||
Write-Host "Building Snowflake Go driver" | ||
|
||
cd ..\src\Drivers\Snowflake | ||
|
||
powershell -ExecutionPolicy Unrestricted -File .\Build-SnowflakeDriver.ps1 | ||
|
||
cd $location | ||
|
||
cd .. | ||
|
||
Write-Host "Running dotnet pack" | ||
|
||
dotnet pack -o $destination |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
# About | ||
|
||
This is a C# implementation of the ADBC spec. It is designed so drivers can be written in any C-based language and leveraged from .NET. | ||
|
||
Current C#-implemented drivers include BigQuery and FlightSQL. | ||
|
||
The Snowflake Go driver can also be used from .NET. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks> | ||
<PackageReadmeFile>readme.md</PackageReadmeFile> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Apache.Arrow.Adbc\Apache.Arrow.Adbc.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="readme.md"> | ||
<Pack>true</Pack> | ||
<PackagePath>\</PackagePath> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
csharp/src/Drivers/Snowflake/Apache.Arrow.Adbc.Drivers.Interop.Snowflake.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<Project Sdk="Microsoft.Build.NoTargets"> | ||
<PropertyGroup> | ||
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks> | ||
<PackageReadmeFile>readme.md</PackageReadmeFile> | ||
</PropertyGroup> | ||
<!--<Target Name="PreBuild" BeforeTargets="PreBuildEvent"> | ||
<Exec Command="powershell -ExecutionPolicy Unrestricted -File $(ProjectDir)build-SnowflakeDriver.ps1 -netversion $(TargetFramework)" /> | ||
</Target>--> | ||
|
||
<!-- use Build-SnowflakeDriver.ps1 to build the dll --> | ||
|
||
<!-- libadbc_driver_snowflake.dll is listed for each framework because Condition doesn't work here --> | ||
|
||
<ItemGroup> | ||
<Content Include="libadbc_driver_snowflake.dll"> | ||
<Pack>true</Pack> | ||
<PackagePath>lib\netstandard2.0</PackagePath> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="libadbc_driver_snowflake.dll"> | ||
<Pack>true</Pack> | ||
<PackagePath>lib\net6.0</PackagePath> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="readme.md"> | ||
<Pack>true</Pack> | ||
<PackagePath>\</PackagePath> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http:#www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
#param ( | ||
# [string]$netversion | ||
#) | ||
|
||
#Write-Host "Building for $netversion" | ||
|
||
$location = Get-Location | ||
|
||
$file = "libadbc_driver_snowflake.dll" | ||
|
||
cd ..\..\..\..\go\adbc\pkg | ||
del $file | ||
go build -tags driverlib -o $file -buildmode=c-shared -ldflags "-s -w" ./snowflake | ||
COPY $file $location |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
|
||
# About | ||
This project generates a NuGet package containing the Snowflake ADBC Go Driver for use in other .NET projects. | ||
|
||
For details, see: | ||
|
||
[Snowflake Driver](https://arrow.apache.org/adbc/main/driver/snowflake.html) for docs | ||
|
||
[GitHub](https://github.com/apache/arrow-adbc/tree/main/go/adbc/driver/snowflake) for source code |