Skip to content

Commit

Permalink
#23: Modify build so that the NuGet package can be built with a prere…
Browse files Browse the repository at this point in the history
…lease label. Update .net test scripts to install the specific package version of MapGuideDotNetApi
  • Loading branch information
jumpinjackie committed Jul 2, 2018
1 parent 521f781 commit 10fcab2
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 12 deletions.
7 changes: 6 additions & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ IF "%MG_VERSION%"=="3.3" SET MG_CONFIG=Release_VC14
IF "%MG_VERSION%"=="3.1" SET MG_CONFIG=Release_VC14
IF "%MG_VERSION%"=="3.0" SET MG_CONFIG=Release_VC11
IF "%MG_VERSION%"=="2.6" SET MG_CONFIG=Release_VC11
IF "%MG_PKG_VER%"=="" (
echo Could not determine NuGet package version. This should've been set by envsetupsdk.cmd
exit /B 1
)

SET PACKAGE_DIR=%CD%\packages
SET TOOLS_DIR=%CD%\tools
echo Using configuration [%MG_CONFIG%]
Expand All @@ -16,7 +21,7 @@ popd
pushd src\Managed\DotNet\MapGuideDotNetApi
call dotnet restore
if errorlevel 1 goto error
call dotnet pack --configuration Release --output "%PACKAGE_DIR%"
call dotnet pack --configuration Release --output "%PACKAGE_DIR%" /p:Version=%MG_PKG_VER%
if errorlevel 1 goto error
popd
pushd src\Managed\Java
Expand Down
6 changes: 5 additions & 1 deletion cmake_build.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
@echo off
IF "%MG_PKG_VER%"=="" (
echo Could not determine NuGet package version. This should've been set by envsetupsdk.cmd
exit /B 1
)
REM Test for CMake
which cmake
if %errorlevel% neq 0 (
Expand Down Expand Up @@ -60,7 +64,7 @@ if "%WITH_DOTNET%" == "1" (
pushd src\Managed\DotNet\MapGuideDotNetApi
call dotnet restore
if %errorlevel% neq 0 goto error
call dotnet pack --configuration Release --output "%PACKAGE_DIR%"
call dotnet pack --configuration Release --output "%PACKAGE_DIR%" /p:Version=%MG_PKG_VER%
if %errorlevel% neq 0 goto error
popd
)
Expand Down
7 changes: 7 additions & 0 deletions envsetupsdk.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ SET MG_VER_BUILD=%4
SET MG_VERSION=%1.%2
SET MG_VER_TRIPLET=%1.%2.%3
SET SWIG_TOOL_PATH=%5
SET MG_PKG_BUILD=%6
SET MG_PKG_VER=%MG_VER_TRIPLET%.%MG_VER_BUILD%
if not "%MG_PKG_BUILD%" == "" (
SET MG_PKG_VER=%MG_VER_TRIPLET%.%MG_VER_BUILD%-pre%MG_PKG_BUILD%
)
if not exist "%SWIG_TOOL_PATH%\swig.exe" goto no_swig

SET MG_SDK_DIR=sdk/%MG_VERSION%
Expand All @@ -14,6 +19,8 @@ IF NOT EXIST %MG_SDK_DIR% (
exit /b 1
)

echo NuGet package version will be: %MG_PKG_VER%

SET SRC_BASE=%CD%/src
SET PHP_SRC=%CD%/thirdparty/php7/src/php-7.1.18

Expand Down
2 changes: 1 addition & 1 deletion src/Test/DotNet/src/TestCommon/TestCommon.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MapGuideDotNetApi" Version="3.1.1.9389" />
<PackageReference Include="MapGuideDotNetApi" Version="3.1.1.9389-pre123" />
<PackageReference Include="Microsoft.Data.SQLite" Version="2.0.1" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Test/DotNet/src/TestMapGuideApi/TestMapGuideApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ProjectReference Include="..\TestCommon\TestCommon.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MapGuideDotNetApi" Version="3.1.1.9389" />
<PackageReference Include="MapGuideDotNetApi" Version="3.1.1.9389-pre123" />
<PackageReference Include="Microsoft.Data.SQLite" Version="2.0.1" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Test/DotNet/src/TestMisc/TestMisc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MapGuideDotNetApi" Version="3.1.1.9389" />
<PackageReference Include="MapGuideDotNetApi" Version="3.1.1.9389-pre123" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Test/DotNet/src/TestRunner/TestRunner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.2.1" />
<PackageReference Include="MapGuideDotNetApi" Version="3.1.1.9389" />
<PackageReference Include="MapGuideDotNetApi" Version="3.1.1.9389-pre123" />
</ItemGroup>
</Project>
11 changes: 8 additions & 3 deletions test_dotnet_core.cmd
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
@echo off
IF "%MG_PKG_VER%"=="" (
echo Could not determine NuGet package version. This should've been set by envsetupsdk.cmd
exit /B 1
)
SET THIS_DIR=%CD%
SET MG_INSTALL_DIR=%1
IF "%MG_INSTALL_DIR%" == "" (
SET MG_INSTALL_DIR=C:\Program Files\OSGeo\MapGuide
)
pushd src\Test\DotNet
dotnet add src\TestCommon package MapGuideDotNetApi
dotnet add src\TestMapGuideApi package MapGuideDotNetApi
dotnet add src\TestRunner package MapGuideDotNetApi
dotnet add src\TestCommon package MapGuideDotNetApi --version %MG_PKG_VER%
dotnet add src\TestMapGuideApi package MapGuideDotNetApi --version %MG_PKG_VER%
dotnet add src\TestRunner package MapGuideDotNetApi --version %MG_PKG_VER%
dotnet add src\TestMisc package MapGuideDotNetApi --version %MG_PKG_VER%
dotnet restore DotNet.sln
dotnet build --configuration Release DotNet.sln
popd
Expand Down
10 changes: 7 additions & 3 deletions test_dotnet_full.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
@echo off
IF "%MG_PKG_VER%"=="" (
echo Could not determine NuGet package version. This should've been set by envsetupsdk.cmd
exit /B 1
)
which nuget
if %errorlevel% neq 0 (
echo NuGet command-line tool not installed
Expand All @@ -11,13 +15,13 @@ IF "%MG_INSTALL_DIR%" == "" (
)
SET MG_NUGET_PKG_DIR=%CD%\packages
pushd src\Test\DotNet\src\TestCommonFull
nuget install MapGuideDotNetApi -o %MG_NUGET_PKG_DIR%
nuget install MapGuideDotNetApi -o %MG_NUGET_PKG_DIR% -Version %MG_PKG_VER%
popd
pushd src\Test\DotNet\src\TestMapGuideApiFull
nuget install MapGuideDotNetApi -o %MG_NUGET_PKG_DIR%
nuget install MapGuideDotNetApi -o %MG_NUGET_PKG_DIR% -Version %MG_PKG_VER%
popd
pushd src\Test\DotNet\src\TestRunnerFull
nuget install MapGuideDotNetApi -o %MG_NUGET_PKG_DIR%
nuget install MapGuideDotNetApi -o %MG_NUGET_PKG_DIR% -Version %MG_PKG_VER%
popd
pushd src\Test\DotNet
nuget restore FullFramework.sln
Expand Down

0 comments on commit 10fcab2

Please sign in to comment.