Change Version of PackageReference to latest always accepted/tizen/unified/20170705.163112 submit/tizen/20170703.060438 submit/tizen/20170705.042504
authorWonYoung Choi <wy80.choi@samsung.com>
Thu, 29 Jun 2017 12:12:28 +0000 (21:12 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Thu, 29 Jun 2017 12:12:28 +0000 (21:12 +0900)
Change-Id: I8fa6eb22c345438bd2ab1c0f045df4c9f05b56b6

Tools/dotnet-build.sh

index b9e636f..bd967b4 100755 (executable)
@@ -52,6 +52,21 @@ run_dotnet() {
   exit_on_error $?
 }
 
+update_version_to_asterisk() {
+  local PROJS=""
+  if [[ $PROJECT_TYPE == "csproj" ]]; then
+    PROJS=$PROJECT
+  elif [[ $PROJECT_TYPE == "dir" ]]; then
+    PROJS=$PROJECT/*.csproj
+  elif [[ $PROJECT_TYPE == "sln" ]]; then
+    PROJS=$(find . -name "*.csproj")
+  fi
+  for p in $PROJS; do
+    xmlstarlet ed -L -u "//PackageReference/@Version" --value "*" $p
+    xmlstarlet ed -L -u "//PackageReference/@version" --value "*" $p
+  done
+}
+
 build_project() {
   local CSPROJ=$1; shift
 
@@ -65,6 +80,7 @@ build_project() {
 
 cmd_restore() {
   if $USE_DOTNET_CLI; then
+    update_version_to_asterisk # update PackageReference version to * in .csproj
     local OPTS=""
     [ -n "$SOURCE" ] && OPTS="$OPTS -s $SOURCE"
     run_dotnet restore $PROJECT $OPTS $@