Skip to content
This repository was archived by the owner on Mar 10, 2021. It is now read-only.

Commit 1585056

Browse files
author
Lou Amadio
committed
Implement Arduino SDK nuget package
1 parent 7a43614 commit 1585056

8 files changed

+879
-1
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "Arduino"]
2+
path = Arduino
3+
url = https://github.com/ooeygui/Arduino.git

Arduino

Submodule Arduino added at e9e257b

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
arduino-sdk
22
===========
33

4-
This repository contains the solution for the Arduino SDK components
4+
This repository contains the solution for the Arduino SDK components.
5+
6+
# Contributing
7+
```git submodule init```
8+
```git submodule update```
9+

license.txt

+752
Large diffs are not rendered by default.

source/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nupkg/
2+
*.nupkg
3+
nuget.exe
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
3+
<metadata>
4+
<id>Microsoft.IoT.Arduino.SDK</id>
5+
<version>1.0.0-alpha</version>
6+
<title>Arduino SDK</title>
7+
<authors>Microsoft Corporation</authors>
8+
<owners>Arduino, Microsoft Corporation</owners>
9+
<licenseUrl>https://github.com/arduino/Arduino/blob/master/license.txt</licenseUrl>
10+
<projectUrl>http://www.arduino.cc</projectUrl>
11+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
12+
<description>The Arduino SDK contains sources implemented by the Arduino community.</description>
13+
<summary>Arduino SDK</summary>
14+
<releaseNotes />
15+
<copyright>Copyright 2014</copyright>
16+
<tags>arduino microsoft native nativepackage</tags>
17+
</metadata>
18+
</package>
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemDefinitionGroup>
4+
<ClCompile>
5+
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
6+
</ClCompile>
7+
<ResourceCompile>
8+
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
9+
</ResourceCompile>
10+
</ItemDefinitionGroup>
11+
<ItemGroup>
12+
<ClCompile Include="$(MSBuildThisFileDirectory)\Source\WString.cpp" />
13+
<ClCompile Include="$(MSBuildThisFileDirectory)\Source\Stream.cpp" />
14+
<ClCompile Include="$(MSBuildThisFileDirectory)\Source\Print.cpp" />
15+
</ItemGroup>
16+
</Project>

source/build-nupkg.cmd

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
@echo off
2+
setlocal enableextensions disabledelayedexpansion
3+
4+
:: Parse options
5+
:GETOPTS
6+
if /I "%~1" == "/?" goto USAGE
7+
if /I "%~1" == "/Help" goto USAGE
8+
if /I "%~1" == "/clean" set CLEAN=1
9+
if /I "%~1" == "/nopack" set NOPACK=1
10+
shift
11+
if not (%1)==() goto GETOPTS
12+
13+
echo Cleaning outputs
14+
del Microsoft.IoT.Arduino.SDK*.nupkg 2> NUL
15+
rmdir /s /q nupkg 2> NUL
16+
17+
:: if a clean was requested, exit here
18+
if "%CLEAN%"=="1" goto end
19+
20+
echo.
21+
echo Creating nupkg directory structure
22+
md nupkg
23+
md nupkg\build
24+
md nupkg\build\native
25+
md nupkg\build\native\include
26+
md nupkg\build\native\source
27+
md nupkg\build\native\lib
28+
29+
set arduinoSDKSources=..\Arduino\hardware\arduino\cores\arduino
30+
31+
if not exist %arduinoSDKSources%\Print.h (
32+
echo The Arduino sources are not checked out. checking them out
33+
pushd ..
34+
git submodule init
35+
git submodule update
36+
popd
37+
)
38+
39+
if not exist %arduinoSDKSources%\Print.h (
40+
echo The Arduino sources could not be checked out
41+
)
42+
43+
echo.
44+
echo Copying files into nuget package structure
45+
copy Microsoft.IoT.Arduino.SDK.nuspec nupkg /y || goto err
46+
copy Microsoft.IoT.Arduino.SDK.targets nupkg\build\native /y || goto err
47+
48+
if exist (*.h) copy *.h nupkg\build\native\include /y || goto err
49+
copy %arduinoSDKSources%\Print.h nupkg\build\native\include /y || goto err
50+
copy %arduinoSDKSources%\Printable.h nupkg\build\native\include /y || goto err
51+
copy %arduinoSDKSources%\Stream.h nupkg\build\native\include /y || goto err
52+
copy %arduinoSDKSources%\WString.h nupkg\build\native\include /y || goto err
53+
54+
if exist (*.cpp) copy *.cpp nupkg\build\native\source /y || goto err
55+
copy %arduinoSDKSources%\Print.cpp nupkg\build\native\source /y || goto err
56+
copy %arduinoSDKSources%\Stream.cpp nupkg\build\native\source /y || goto err
57+
copy %arduinoSDKSources%\WString.cpp nupkg\build\native\source /y || goto err
58+
59+
copy ..\license.txt nupkg /y || goto err
60+
61+
:: skip packaging step if requested
62+
if "%NOPACK%"=="1" goto end
63+
64+
echo Creating NuGet Package
65+
nuget help > NUL
66+
IF ERRORLEVEL 1 (
67+
echo Please install nuget.exe from http://nuget.org
68+
goto err
69+
)
70+
nuget pack nupkg\Microsoft.IoT.Arduino.SDK.nuspec || goto err
71+
72+
73+
:end
74+
75+
echo Success
76+
exit /b 0
77+
78+
:err
79+
echo Script failed!
80+
exit /b 1

0 commit comments

Comments
 (0)