Skip to content

Commit

Permalink
#33: Update various build scripts to match new layout
Browse files Browse the repository at this point in the history
  • Loading branch information
jumpinjackie committed Jun 30, 2018
1 parent 911d0f0 commit 7162d70
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 101 deletions.
42 changes: 14 additions & 28 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ packer_*.log
/src/IMake/*.opendb
/src/Bindings/Bindings.sdf
/src/Bindings/.vs
/src/Bindings/DotNet/MapGuideDotNetApi/Constants.cs
/src/Managed/DotNet/MapGuideDotNetApi/Constants.cs
/src/IMake/IMake.sdf
/src/MapGuide/MgDev
/src/Bindings/DotNet/MapGuideApi.i
Expand All @@ -49,7 +49,7 @@ packer_*.log
/src/Bindings/DotNet/MgApi_wrap.cpp
/src/Bindings/DotNet/*.user
/src/Bindings/*.opendb
/src/Bindings/DotNet/MapGuideDotNetApi/*.cs
/src/Managed/DotNet/MapGuideDotNetApi/*.cs
/src/Bindings/MapGuideApi
/src/Bindings/ipch
/src/Bindings/Php/MapGuideApi.i
Expand All @@ -58,36 +58,32 @@ packer_*.log
/src/Bindings/Php/MgApi_wrap.cpp
/src/Bindings/Php/MapGuideApi.php
/src/Bindings/Php/php_MapGuideApi.h
/src/Bindings/Java/org/osgeo/mapguide/*.Java
/src/Bindings/Java/org/osgeo/mapguide/*.class
/src/Managed/Java/org/osgeo/mapguide/*.Java
/src/Managed/Java/org/osgeo/mapguide/*.class
/src/Bindings/Java/MgApi_wrap.cpp
/src/Bindings/Java/MapGuideApi.i
/src/Bindings/Java/MapGuideApi_Doc.i
/src/Bindings/Java/language.i
!/src/Bindings/Java/org/osgeo/mapguide/AppThrowable.java
!/src/Bindings/Java/org/osgeo/mapguide/MgBase64.java
!/src/Bindings/Java/org/osgeo/mapguide/MgLocalizer.java
!/src/Bindings/Java/org/osgeo/mapguide/ObjectFactory.java
!/src/Managed/Java/org/osgeo/mapguide/AppThrowable.java
!/src/Managed/Java/org/osgeo/mapguide/MgBase64.java
!/src/Managed/Java/org/osgeo/mapguide/MgLocalizer.java
!/src/Managed/Java/org/osgeo/mapguide/ObjectFactory.java
/src/IMake/.vs
/src/lib
/src/IMake/Release
/src/Bindings/DotNet/lib
/src/Bindings/DotNet/MapGuideApi_Properties.i
/src/Test/Dnx/src/TestRunner/*.bin
/src/Bindings/DotNet/MapGuideDotNetApi/runtimes/win-x64/native/*.dll
/src/Bindings/DotNet/MapGuideDotNetApi/runtimes/win-x86/native/*.dll
/src/Test/DotNet/src/TestRunner/*.bin
/src/Managed/DotNet/MapGuideDotNetApi/runtimes/win-x64/native/*.dll
/src/Managed/DotNet/MapGuideDotNetApi/runtimes/win-x86/native/*.dll
*.suo
*.user
/src/Test/Dnx/src/TestRunner/UnitTests.log
/src/Test/DotNet/src/TestRunner/UnitTests.log
/src/TestData/DrawingService/DrawingServiceTest.db
/src/TestData/FeatureService/FeatureServiceTest.db
/src/TestData/ResourceService/ResourceServiceTest.db
/src/Test/Dnx/src/TestCommon/project.lock.json
/src/Test/Dnx/src/TestMapGuide/project.lock.json
/src/Test/Dnx/src/TestMapGuideApi/project.lock.json
/src/Test/Dnx/src/TestRunner/project.lock.json
/src/Test/Dnx/src/TestRunner/metadata.txt
/src/Test/Dnx/src/TestRunner/metadata2.txt
/src/Test/DotNet/src/TestRunner/metadata.txt
/src/Test/DotNet/src/TestRunner/metadata2.txt
/src/TestData/MapLayer/MapLayerTest.db
/src/TestData/MappingService/MappingServiceTest.db
/src/TestData/ServerAdmin/ServerAdminTest.db
Expand All @@ -105,16 +101,6 @@ packer_*.log
/src/Bindings/artifacts
/sdk/*
!/sdk/README.md
/src/FileReplace/.vs
/src/FileReplace/Release
/src/FileReplace/Debug
/src/FileReplace/x64
/src/FileReplace/x86
/src/FileReplace/*.opendb
/src/FileReplace/*.sdf
/src/FileReplace/bin/*.iobj
/src/FileReplace/bin/*.ipdb
/src/FileReplace/bin/*.pdb
/src/Tools/StampVer/bin
/src/Tools/artifacts
constants.php
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,14 @@ if(WIN32)
endif(MSVC)
endif(WIN32)

set(MG_DOTNET_PROJECT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/Managed/DotNet/MapGuideDotNetApi")
set(MG_DOTNET_OUTPUT_DIR "${MG_DOTNET_PROJECT_DIR}/runtimes/win-${MG_ARCH}/native")
if (CMAKE_SYSTEM_NAME MATCHES Linux)
add_definitions(-DLINUX -DLINUX_IA32 -pthread -Wno-write-strings)
message(STATUS "Distro is: ${MG_DISTRO}")
if (WITH_DOTNET)
message(STATUS "Using .net RID of: ${MG_DOTNET_RID}")
set(MG_DOTNET_OUTPUT_DIR "${MG_DOTNET_PROJECT_DIR}/runtimes/${MG_DOTNET_RID}/native")
endif (WITH_DOTNET)
# CMake by default will strip RPATH when we "install" our libraries
# We *don't* want this in this case as we want to retain the path to the
Expand Down
2 changes: 1 addition & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if errorlevel 1 goto error
msbuild /m /p:Configuration=%MG_CONFIG%;Platform=x64 Bindings.sln
if errorlevel 1 goto error
popd
pushd src\Bindings\DotNet\MapGuideDotNetApi
pushd src\Managed\DotNet\MapGuideDotNetApi
call dotnet restore
if errorlevel 1 goto error
call dotnet pack --configuration Release --output "%PACKAGE_DIR%"
Expand Down
2 changes: 1 addition & 1 deletion cmake_build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ cmake --build . --config Release
if %errorlevel% neq 0 goto error
popd
if "%WITH_DOTNET%" == "1" (
pushd src\Bindings\DotNet\MapGuideDotNetApi
pushd src\Managed\DotNet\MapGuideDotNetApi
call dotnet restore
if %errorlevel% neq 0 goto error
call dotnet pack --configuration Release --output "%PACKAGE_DIR%"
Expand Down
6 changes: 3 additions & 3 deletions cmake_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ if test $USE_JAVA -eq 1; then
fi
fi
if test $USE_DOTNET -eq 1; then
if [ -f $THIS_DIR/src/Bindings/DotNet/MapGuideDotNetApi/runtimes/${DOTNET_RID}/native/libMapGuideDotNetUnmanagedApi.so ]; then
if [ -f $THIS_DIR/src/Managed/DotNet/MapGuideDotNetApi/runtimes/${DOTNET_RID}/native/libMapGuideDotNetUnmanagedApi.so ]; then
echo "Stripping .net glue library"
strip -s $THIS_DIR/src/Bindings/DotNet/MapGuideDotNetApi/runtimes/${DOTNET_RID}/native/libMapGuideDotNetUnmanagedApi.so
strip -s $THIS_DIR/src/Managed/DotNet/MapGuideDotNetApi/runtimes/${DOTNET_RID}/native/libMapGuideDotNetUnmanagedApi.so
else
echo "No .net glue library found to strip"
fi
cd $THIS_DIR/src/Bindings/DotNet/MapGuideDotNetApi
cd $THIS_DIR/src/Managed/DotNet/MapGuideDotNetApi
dotnet restore
if test "$?" -ne 0; then
exit 1
Expand Down
6 changes: 3 additions & 3 deletions envsetupsdk.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ echo Running SwigPrepare
if %errorlevel% neq 0 goto error

echo Stamping version [%MG_VER_MAJOR%.%MG_VER_MINOR%.%MG_VER_REV%.%MG_VER_BUILD%]
%MG_INTERNAL_TOOL_PATH%\StampVer %MG_VER_MAJOR% %MG_VER_MINOR% %MG_VER_REV% %MG_VER_BUILD% "%CD%\src\Bindings\DotNet\MapGuideDotNetApi\Properties\AssemblyInfo.cs" "%CD%\src\Bindings\DotNet\MapGuideDotNetApi\MapGuideDotNetApi.csproj"
%MG_INTERNAL_TOOL_PATH%\StampVer %MG_VER_MAJOR% %MG_VER_MINOR% %MG_VER_REV% %MG_VER_BUILD% "%CD%\src\Managed\DotNet\MapGuideDotNetApi\Properties\AssemblyInfo.cs" "%CD%\src\Managed\DotNet\MapGuideDotNetApi\MapGuideDotNetApi.csproj"
if %errorlevel% neq 0 goto error

REM echo Regenerating Class Maps
Expand All @@ -66,8 +66,8 @@ REM call dotnet run "%SRC_BASE%"
REM popd

echo Preparing native binaries for nuget package
copy /y "sdk\%MG_VERSION%\Bin\*.dll" "src\Bindings\DotNet\MapGuideDotNetApi\runtimes\win-x86\native"
copy /y "sdk\%MG_VERSION%\Bin64\*.dll" "src\Bindings\DotNet\MapGuideDotNetApi\runtimes\win-x64\native"
copy /y "sdk\%MG_VERSION%\Bin\*.dll" "src\Managed\DotNet\MapGuideDotNetApi\runtimes\win-x86\native"
copy /y "sdk\%MG_VERSION%\Bin64\*.dll" "src\Managed\DotNet\MapGuideDotNetApi\runtimes\win-x64\native"
echo Preparing native binaries for PHP extension
if not exist "packages\php\Release\x86" mkdir "packages\php\Release\x86"
if not exist "packages\php\Release\x64" mkdir "packages\php\Release\x64"
Expand Down
2 changes: 1 addition & 1 deletion envsetupsdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ if test "$?" -ne 0; then
exit 1
fi
echo "Stamping version [$MG_VER_MAJOR.$MG_VER_MINOR.$MG_VER_REV.$MG_VER_BUILD]"
$ROOT/tools/StampVer $MG_VER_MAJOR $MG_VER_MINOR $MG_VER_REV $MG_VER_BUILD "$ROOT/src/Bindings/DotNet/MapGuideDotNetApi/Properties/AssemblyInfo.cs" "$ROOT/src/Bindings/DotNet/MapGuideDotNetApi/MapGuideDotNetApi.csproj"
$ROOT/tools/StampVer $MG_VER_MAJOR $MG_VER_MINOR $MG_VER_REV $MG_VER_BUILD "$ROOT/src/Managed/DotNet/MapGuideDotNetApi/Properties/AssemblyInfo.cs" "$ROOT/src/Managed/DotNet/MapGuideDotNetApi/MapGuideDotNetApi.csproj"
if test "$?" -ne 0; then
exit 1
fi
2 changes: 1 addition & 1 deletion linux_build/Ubuntu14_x64/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ fi
echo "Copying java glue library"
cp $SRC_AREA/packages/Java/Release/x64/Ubuntu14.04.x86_64/libMapGuideJavaApi.so /mapguide_sources/packages/Java/Release/x64/Ubuntu14.04.x86_64
echo "Copying .net glue library"
cp $SRC_AREA/src/Bindings/DotNet/MapGuideDotNetApi/runtimes/ubuntu.14.04-x64/native/libMapGuideDotNetUnmanagedApi.so /mapguide_sources/src/Bindings/DotNet/MapGuideDotNetApi/runtimes/ubuntu.14.04-x64/native
cp $SRC_AREA/src/Managed/DotNet/MapGuideDotNetApi/runtimes/ubuntu.14.04-x64/native/libMapGuideDotNetUnmanagedApi.so /mapguide_sources/src/Managed/DotNet/MapGuideDotNetApi/runtimes/ubuntu.14.04-x64/native
21 changes: 9 additions & 12 deletions src/Bindings/DotNet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ include_directories(
${XERCESC_INCLUDE_DIR}
)

set(MG_DOTNET_OUTPUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/MapGuideDotNetApi/runtimes/win-${MG_ARCH}/native")

set(DotNetUnmanagedApi_SRCS
${CMAKE_CURRENT_BINARY_DIR}/MgApi_wrap.cpp
)
Expand All @@ -39,14 +37,14 @@ endif (UNIX)

message(STATUS "Using IMake at: ${IMAKE_TOOL}")
add_custom_command(OUTPUT ${DotNetUnmanagedApi_SRCS}
COMMAND ${CMAKE_COMMAND} -E echo Removing: ${CMAKE_CURRENT_SOURCE_DIR}/MapGuideDotNetApi/*.cs
COMMAND ${CMAKE_COMMAND} -E echo Removing: ${MG_DOTNET_PROJECT_DIR}/*.cs
COMMAND ${CMAKE_COMMAND} -E remove -f
${CMAKE_CURRENT_SOURCE_DIR}/MapGuideDotNetApi/*.cs
COMMAND ${CMAKE_COMMAND} -E echo Regenerating: ${CMAKE_CURRENT_SOURCE_DIR}/MapGuideDotNetApi/Constants.cs
${MG_DOTNET_PROJECT_DIR}/*.cs
COMMAND ${CMAKE_COMMAND} -E echo Regenerating: ${MG_DOTNET_PROJECT_DIR}/Constants.cs
COMMAND ${IMAKE_TOOL} -p ${CMAKE_CURRENT_BINARY_DIR}/../MapGuideApi/Constants.xml
-l "C#"
${IMAKE_RELATIVE_RESOLUTION}
-o ${CMAKE_CURRENT_SOURCE_DIR}/MapGuideDotNetApi/Constants.cs
-o ${MG_DOTNET_PROJECT_DIR}/Constants.cs
-t
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/dotnetcore.i
Expand All @@ -55,18 +53,18 @@ add_custom_command(OUTPUT ${DotNetUnmanagedApi_SRCS}
-l "C#"
${IMAKE_RELATIVE_RESOLUTION}
-o ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E echo Running SWIG [DotNet]. Output Dir: ${CMAKE_CURRENT_SOURCE_DIR}/MapGuideDotNetApi
COMMAND ${CMAKE_COMMAND} -E echo Running SWIG [DotNet]. Output Dir: ${MG_DOTNET_PROJECT_DIR}
COMMAND ${SWIG_TOOL} -c++ -csharp
-DDOTNETCORE -DSWIG_CSHARP_NO_EXCEPTION_HELPER
-DSWIG_CSHARP_NO_STRING_HELPER -DSWIG_CSHARP_NO_WSTRING_HELPER
-namespace OSGeo.MapGuide
-nodefaultctor -nodefaultdtor
-module MapGuideDotNetUnmanagedApi
-o "${CMAKE_CURRENT_BINARY_DIR}/MgApi_wrap.cpp"
-outdir "${CMAKE_CURRENT_SOURCE_DIR}/MapGuideDotNetApi"
-outdir "${MG_DOTNET_PROJECT_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}/MapGuideApi.i"
COMMAND ${CMAKE_COMMAND} -E remove -f
${CMAKE_CURRENT_SOURCE_DIR}/MapGuideDotNetApi/MapGuideDotNetUnmanagedApi.cs
${MG_DOTNET_PROJECT_DIR}/MapGuideDotNetUnmanagedApi.cs
)

target_link_libraries(MapGuideDotNetUnmanagedApi${MG_VERSION_SUFFIX}
Expand Down Expand Up @@ -94,8 +92,7 @@ target_link_libraries(MapGuideDotNetUnmanagedApi${MG_VERSION_SUFFIX}
# Only needed for Linux
if (UNIX)
file(COPY "InitializeWebTier.cpp" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
install( TARGETS MapGuideDotNetUnmanagedApi${MG_VERSION_SUFFIX} DESTINATION "${MG_BINDING_SRC_DIR}/src/Bindings/DotNet/MapGuideDotNetApi/runtimes/${MG_DOTNET_RID}/native" )
install( TARGETS MapGuideDotNetUnmanagedApi${MG_VERSION_SUFFIX} DESTINATION ${MG_DOTNET_OUTPUT_DIR})
endif (UNIX)

file(COPY "dotnetcore.i" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY "MapGuideDotNetApi" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY "dotnetcore.i" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
Loading

0 comments on commit 7162d70

Please sign in to comment.