[Build] Remove mono dependency (#206)
authorWonYoung Choi <wy80.choi@samsung.com>
Mon, 2 Apr 2018 08:24:39 +0000 (17:24 +0900)
committerGitHub <noreply@github.com>
Mon, 2 Apr 2018 08:24:39 +0000 (17:24 +0900)
* [Build] Remove mono dependency

build.cmd
build.sh
build/build.proj
build/pack.csproj [new file with mode: 0644]
tools/NuGet.exe [deleted file]

index b92b51f..b37b657 100644 (file)
--- a/build.cmd
+++ b/build.cmd
@@ -42,15 +42,9 @@ goto :EOF
 
 :Pack
 set VERSION=%2
-set VERSION_INTERNAL=%3
 call :GetUnixTime TIMESTAMP
 if /I [%VERSION%] == [] set VERSION=4.0.1-local-%TIMESTAMP%
-if /I [%VERSION_INTERNAL%] == [] set VERSION_INTERNAL=%VERSION%
-set OUTDIR=%~dp0Artifacts
-set NUGET_CMD=%~dp0tools\NuGet.exe
-%NUGET_CMD% pack %~dp0pkg\Tizen.NET.nuspec -NoPackageAnalysis -Version %VERSION% -BasePath %~dp0 -OutputDirectory %OUTDIR%
-%NUGET_CMD% pack %~dp0pkg\Tizen.NET.API4.nuspec -NoPackageAnalysis -Version %VERSION% -BasePath %~dp0 -OutputDirectory %OUTDIR%
-%NUGET_CMD% pack %~dp0pkg\Tizen.NET.Internals.nuspec -NoPackageAnalysis -Version %VERSION_INTERNAL% -BasePath %~dp0 -OutputDirectory %OUTDIR%
+call dotnet msbuild %~dp0build\build.proj /nologo /t:pack /p:Version=%VERSION%
 goto :EOF
 
 :Clean
index 377421e..378ba30 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -5,7 +5,6 @@ SCRIPT_DIR=$(dirname $SCRIPT_FILE)
 
 OUTDIR=$SCRIPT_DIR/Artifacts
 
-NUGET_CMD="mono $SCRIPT_DIR/tools/NuGet.exe"
 RETRY_CMD="$SCRIPT_DIR/tools/retry.sh"
 TIMEOUT_CMD="$SCRIPT_DIR/tools/timeout.sh"
 DOTNET_CMD="$RETRY_CMD $TIMEOUT_CMD 600 dotnet"
@@ -53,18 +52,12 @@ cmd_dummy_build() {
 
 cmd_pack() {
   VERSION=$1
-  VERSION_INTERNAL=$2
   if [ -z "$VERSION" ]; then
     TIMESTAMP=$(date +"%s")
     VERSION="4.0.1-local-$TIMESTAMP"
   fi
-  if [ -z "$VERSION_INTERNAL" ]; then
-    VERSION_INTERNAL=$VERSION
-  fi
 
-  $NUGET_CMD pack $SCRIPT_DIR/pkg/Tizen.NET.nuspec -NoPackageAnalysis -Version $VERSION -BasePath $SCRIPT_DIR -OutputDirectory $OUTDIR
-  $NUGET_CMD pack $SCRIPT_DIR/pkg/Tizen.NET.API4.nuspec -NoPackageAnalysis -Version $VERSION -BasePath $SCRIPT_DIR -OutputDirectory $OUTDIR
-  $NUGET_CMD pack $SCRIPT_DIR/pkg/Tizen.NET.Internals.nuspec -NoPackageAnalysis -Version $VERSION_INTERNAL -BasePath $SCRIPT_DIR -OutputDirectory $OUTDIR
+  $RUN_BUILD /t:pack /p:Version=$VERSION
 }
 
 cmd_clean() {
index dc28ff4..4ba6337 100644 (file)
     <ProjectToBuild Include="$(InternalProjectSrcDir)**\*.csproj" Condition="'$(Project)' == ''" />
   </ItemGroup>
 
+  <!-- Nuspec files to pack -->
+  <ItemGroup>
+    <NuspecFiles Include="$(ProjectRootDir)pkg\*.nuspec" />
+  </ItemGroup>
+
   <!--
     Target : Clean
     ==============
 
   </Target>
 
+  <!--
+    Target : Pack
+    ==============
+    Generate nuget packages.
+  -->
+  <Target Name="Pack">
+
+    <MSBuild Projects="$(MSBuildThisFileDirectory)pack.csproj"
+             Properties="NoBuild=True"
+             Targets="Restore" />
+
+    <MSBuild Projects="$(MSBuildThisFileDirectory)pack.csproj"
+             Properties="NoBuild=True;Version=$(Version);NuspecFile=%(NuspecFiles.Identity)"
+             Targets="Pack" />
+
+  </Target>
+
 </Project>
diff --git a/build/pack.csproj b/build/pack.csproj
new file mode 100644 (file)
index 0000000..fc730dc
--- /dev/null
@@ -0,0 +1,21 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <Import Project="$(MSBuildThisFileDirectory)directories.props" />
+
+  <PropertyGroup>
+    <TargetFramework>netstandard2.0</TargetFramework>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <DisableImplicitFrameworkReferences>false</DisableImplicitFrameworkReferences>
+  </PropertyGroup>
+
+  <PropertyGroup>
+    <IncludeBuildOutput>false</IncludeBuildOutput>
+    <NoPackageAnalysis>true</NoPackageAnalysis>
+    <NuspecBasePath>$(ProjectRootDir)</NuspecBasePath>
+    <NuspecProperties>$(NuspecProperties);version=$(Version)</NuspecProperties>
+    <PackageOutputPath>$(OutputBaseDir)</PackageOutputPath>
+  </PropertyGroup>
+
+</Project>
diff --git a/tools/NuGet.exe b/tools/NuGet.exe
deleted file mode 100755 (executable)
index ec1309c..0000000
Binary files a/tools/NuGet.exe and /dev/null differ